Prevent creating, deleting or editing global fields for user in the backend UI of the builder
This commit is contained in:
parent
d47c48352c
commit
441fbd37fb
|
@ -57,10 +57,12 @@
|
||||||
>
|
>
|
||||||
<CreateColumnButton />
|
<CreateColumnButton />
|
||||||
{#if schema && Object.keys(schema).length > 0}
|
{#if schema && Object.keys(schema).length > 0}
|
||||||
|
{#if !isUsersTable}
|
||||||
<CreateRowButton
|
<CreateRowButton
|
||||||
title={isUsersTable ? "Create user" : "Create row"}
|
title={"Create row"}
|
||||||
modalContentComponent={isUsersTable ? CreateEditUser : CreateEditRow}
|
modalContentComponent={CreateEditRow}
|
||||||
/>
|
/>
|
||||||
|
{/if}
|
||||||
<CreateViewButton />
|
<CreateViewButton />
|
||||||
<ManageAccessButton resourceId={$tables.selected?._id} />
|
<ManageAccessButton resourceId={$tables.selected?._id} />
|
||||||
{#if isUsersTable}
|
{#if isUsersTable}
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="popovers">
|
<div class="popovers">
|
||||||
<slot />
|
<slot />
|
||||||
{#if selectedRows.length > 0}
|
{#if !isUsersTable && selectedRows.length > 0}
|
||||||
<DeleteRowsButton {selectedRows} {deleteRows} />
|
<DeleteRowsButton {selectedRows} {deleteRows} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
@ -116,7 +116,7 @@
|
||||||
{customRenderers}
|
{customRenderers}
|
||||||
{rowCount}
|
{rowCount}
|
||||||
bind:selectedRows
|
bind:selectedRows
|
||||||
allowSelectRows={allowEditing}
|
allowSelectRows={allowEditing && !isUsersTable}
|
||||||
allowEditRows={allowEditing}
|
allowEditRows={allowEditing}
|
||||||
allowEditColumns={allowEditing}
|
allowEditColumns={allowEditing}
|
||||||
showAutoColumns={!hideAutocolumns}
|
showAutoColumns={!hideAutocolumns}
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
notifications.success("User saved successfully.")
|
notifications.success("User saved successfully")
|
||||||
rows.save(rowResponse)
|
rows.save(rowResponse)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -88,10 +88,12 @@
|
||||||
<RowFieldControl
|
<RowFieldControl
|
||||||
meta={{ ...tableSchema.firstName, name: "First Name" }}
|
meta={{ ...tableSchema.firstName, name: "First Name" }}
|
||||||
bind:value={row.firstName}
|
bind:value={row.firstName}
|
||||||
|
readonly={!creating}
|
||||||
/>
|
/>
|
||||||
<RowFieldControl
|
<RowFieldControl
|
||||||
meta={{ ...tableSchema.lastName, name: "Last Name" }}
|
meta={{ ...tableSchema.lastName, name: "Last Name" }}
|
||||||
bind:value={row.lastName}
|
bind:value={row.lastName}
|
||||||
|
readonly={!creating}
|
||||||
/>
|
/>
|
||||||
<!-- Defer rendering this select until roles load, otherwise the initial
|
<!-- Defer rendering this select until roles load, otherwise the initial
|
||||||
selection is always undefined -->
|
selection is always undefined -->
|
||||||
|
|
|
@ -15,7 +15,14 @@ export const AppStatus = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// fields on the user table that cannot be edited
|
// fields on the user table that cannot be edited
|
||||||
export const UNEDITABLE_USER_FIELDS = ["email", "password", "roleId", "status"]
|
export const UNEDITABLE_USER_FIELDS = [
|
||||||
|
"email",
|
||||||
|
"password",
|
||||||
|
"roleId",
|
||||||
|
"status",
|
||||||
|
"firstName",
|
||||||
|
"lastName",
|
||||||
|
]
|
||||||
|
|
||||||
export const LAYOUT_NAMES = {
|
export const LAYOUT_NAMES = {
|
||||||
MASTER: {
|
MASTER: {
|
||||||
|
|
Loading…
Reference in New Issue