mirror of
https://github.com/directus/directus.git
synced 2026-04-03 03:00:39 -04:00
Explicitly nullify user/role when the other is set in presets (#7512)
Fixes #7366
This commit is contained in:
@@ -8,7 +8,8 @@ import { useI18n } from 'vue-i18n';
|
||||
import { toRefs, computed, ref, watch, Ref } from 'vue';
|
||||
|
||||
import { CameraOptions, AnyLayer } from 'maplibre-gl';
|
||||
import { GeometryOptions, toGeoJSON } from '@/utils/geometry';
|
||||
import { toGeoJSON } from '@/utils/geometry';
|
||||
import { GeometryOptions } from '@directus/shared/types';
|
||||
import { layers } from './style';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
@@ -56,7 +57,7 @@ export default defineLayout<LayoutOptions, LayoutQuery>({
|
||||
|
||||
const page = syncOption(layoutQuery, 'page', 1);
|
||||
const limit = syncOption(layoutQuery, 'limit', 1000);
|
||||
const sort = syncOption(layoutQuery, 'sort', fieldsInCollection.value[0].field);
|
||||
const sort = syncOption(layoutQuery, 'sort', fieldsInCollection.value?.[0]?.field);
|
||||
|
||||
const customLayerDrawerOpen = ref(false);
|
||||
const layoutElement = ref<HTMLElement | null>(null);
|
||||
|
||||
@@ -218,8 +218,10 @@ export default defineComponent({
|
||||
if (edits.value.scope) {
|
||||
if (edits.value.scope.startsWith('role_')) {
|
||||
editsParsed.role = edits.value.scope.substring(5);
|
||||
editsParsed.user = null;
|
||||
} else if (edits.value.scope.startsWith('user_')) {
|
||||
editsParsed.user = edits.value.scope.substring(5);
|
||||
editsParsed.role = null;
|
||||
} else {
|
||||
editsParsed.role = null;
|
||||
editsParsed.user = null;
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface LayoutConfig<Options = any, Query = any> {
|
||||
name: string;
|
||||
icon: string;
|
||||
component: Component;
|
||||
smallHeader?: boolean;
|
||||
slots: {
|
||||
options: Component;
|
||||
sidebar: Component;
|
||||
|
||||
Reference in New Issue
Block a user