mirror of
https://github.com/directus/directus.git
synced 2026-04-03 03:00:39 -04:00
Fix typing issue + fix presets detail page
This commit is contained in:
@@ -191,9 +191,9 @@ export default defineComponent({
|
||||
|
||||
if (edits.value.scope) {
|
||||
if (edits.value.scope.startsWith('role_')) {
|
||||
editsParsed.role = +edits.value.scope.substring(5);
|
||||
editsParsed.role = edits.value.scope.substring(5);
|
||||
} else if (edits.value.scope.startsWith('user_')) {
|
||||
editsParsed.user = +edits.value.scope.substring(5);
|
||||
editsParsed.user = edits.value.scope.substring(5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,7 +434,7 @@ export default defineComponent({
|
||||
field: 'collection',
|
||||
name: i18n.t('collection'),
|
||||
type: 'string',
|
||||
system: {
|
||||
meta: {
|
||||
interface: 'dropdown',
|
||||
options: {
|
||||
choices: collectionsStore.state.collections
|
||||
@@ -456,7 +456,7 @@ export default defineComponent({
|
||||
field: 'scope',
|
||||
name: i18n.t('scope'),
|
||||
type: 'string',
|
||||
system: {
|
||||
meta: {
|
||||
interface: 'dropdown',
|
||||
options: {
|
||||
choices: scopeChoices.value,
|
||||
@@ -468,7 +468,7 @@ export default defineComponent({
|
||||
field: 'layout',
|
||||
name: i18n.t('layout'),
|
||||
type: 'string',
|
||||
system: {
|
||||
meta: {
|
||||
interface: 'dropdown',
|
||||
options: {
|
||||
choices: layouts.map((layout) => ({
|
||||
@@ -483,7 +483,7 @@ export default defineComponent({
|
||||
field: 'name',
|
||||
name: i18n.t('name'),
|
||||
type: 'string',
|
||||
system: {
|
||||
meta: {
|
||||
interface: 'text-input',
|
||||
width: 'half',
|
||||
options: {
|
||||
@@ -495,7 +495,7 @@ export default defineComponent({
|
||||
field: 'divider',
|
||||
name: i18n.t('divider'),
|
||||
type: 'alias',
|
||||
system: {
|
||||
meta: {
|
||||
interface: 'divider',
|
||||
width: 'fill',
|
||||
options: {
|
||||
|
||||
@@ -17,8 +17,7 @@ export const useUserStore = createStore({
|
||||
return state.currentUser.first_name + ' ' + state.currentUser.last_name;
|
||||
},
|
||||
isAdmin(state) {
|
||||
/** @todo base this on UUID */
|
||||
return state.currentUser?.role.id === 1;
|
||||
return state.currentUser?.role.admin === true || false;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
|
||||
@@ -31,8 +31,8 @@ export type Filter = {
|
||||
export type Preset = {
|
||||
id?: number;
|
||||
title: string | null;
|
||||
user: number | null;
|
||||
role: number | null;
|
||||
user: string | null;
|
||||
role: string | null;
|
||||
collection: string;
|
||||
search_query: string | null;
|
||||
filters: readonly Filter[] | null;
|
||||
|
||||
Reference in New Issue
Block a user