Skip to content

Commit

Permalink
fix default values for system-theme-overrides (#20464)
Browse files Browse the repository at this point in the history
  • Loading branch information
azrikahar committed Nov 17, 2023
1 parent d9bd5ad commit 091d1a6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/moody-pants-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@directus/app': patch
---

Fixed default values for system-theme-overrides interface
4 changes: 4 additions & 0 deletions api/src/database/system-data/fields/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ fields:
- field: theme_light_overrides
width: full
interface: system-theme-overrides
options:
appearance: light
group: theming_group
special:
- cast-json
Expand All @@ -134,6 +136,8 @@ fields:
- field: theme_dark_overrides
width: full
interface: system-theme-overrides
options:
appearance: dark
group: theming_group
special:
- cast-json
Expand Down
4 changes: 4 additions & 0 deletions api/src/database/system-data/fields/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ fields:
- field: theme_light_overrides
width: full
interface: system-theme-overrides
options:
appearance: light
special:
- cast-json

Expand All @@ -137,6 +139,8 @@ fields:
- field: theme_dark_overrides
width: full
interface: system-theme-overrides
options:
appearance: dark
special:
- cast-json

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { useThemeConfiguration } from '@/composables/use-theme-configuration';
import { Theme, useTheme } from '@directus/themes';
import { clone, get, isEmpty, setWith, unset } from 'lodash';
import { computed } from 'vue';
import SystemThemeOverridesGroup from './system-theme-overrides-group.vue';
import type { SetValueFn } from './types.js';
Expand All @@ -11,6 +12,7 @@ defineOptions({
const props = defineProps<{
value: Record<string, unknown> | null;
appearance: 'dark' | 'light';
}>();
const emit = defineEmits<{
Expand All @@ -37,7 +39,9 @@ const set: SetValueFn = (path: string[], value: string) => {
}
};
const { darkMode, themeDark, themeLight } = useThemeConfiguration();
const { themeDark, themeLight } = useThemeConfiguration();
const darkMode = computed(() => props.appearance === 'dark');
const { theme } = useTheme(darkMode, themeLight, themeDark, {}, {});
</script>
Expand Down

0 comments on commit 091d1a6

Please sign in to comment.