Skip to content

Commit

Permalink
remove default color options from labels display (directus#9362)
Browse files Browse the repository at this point in the history
  • Loading branch information
benhaynes authored and dimitrov-adrian committed Nov 5, 2021
1 parent 86fc79b commit 255048d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 36 deletions.
24 changes: 0 additions & 24 deletions app/src/displays/labels/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,6 @@ export default defineDisplay({
icon: 'flag',
component: DisplayLabels,
options: [
{
field: 'defaultForeground',
name: '$t:displays.labels.default_foreground',
type: 'string',
meta: {
interface: 'select-color',
width: 'half',
},
schema: {
default_value: '#263238',
},
},
{
field: 'defaultBackground',
name: '$t:displays.labels.default_background',
type: 'string',
meta: {
interface: 'select-color',
width: 'half',
},
schema: {
default_value: '#eceff1',
},
},
{
field: 'format',
name: '$t:format_text',
Expand Down
16 changes: 4 additions & 12 deletions app/src/displays/labels/labels.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ export default defineComponent({
type: Array as PropType<Choice[]>,
default: () => [],
},
defaultBackground: {
type: String,
default: '#eceff1',
},
defaultForeground: {
type: String,
default: '#263238',
},
type: {
type: String,
required: true,
Expand Down Expand Up @@ -99,15 +91,15 @@ export default defineComponent({
return {
value: item,
text: itemStringValue,
foreground: props.defaultForeground,
background: props.defaultBackground,
foreground: 'var(--foreground-normal)',
background: 'var(--background-normal)',
};
} else {
return translate({
value: item,
text: choice.text || itemStringValue,
foreground: choice.foreground || props.defaultForeground,
background: choice.background || props.defaultBackground,
foreground: choice.foreground || 'var(--foreground-normal)',
background: choice.background || 'var(--background-normal)',
});
}
});
Expand Down

0 comments on commit 255048d

Please sign in to comment.