Skip to content

Commit

Permalink
Merge pull request #558 from Terralego/show_description_option
Browse files Browse the repository at this point in the history
Add show description switch
  • Loading branch information
Bo-Duke authored Oct 25, 2023
2 parents f10ca04 + 1d9d096 commit 204914e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@
"started": "Started at",
"ended": "Ended at"
},
"status": "Status",
"refresh": {
"accepted": "Refresh accepted",
"notAllowed": "Refresh not possible"
Expand Down Expand Up @@ -391,6 +390,7 @@
"view": "View",
"ordering": "Ordering",
"description": "Description",
"show-description": "Display description in layers tree",
"interactions": "Interactions",
"all-data-available": " All available data",
"error-required": "This field is required",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@
"started": "Commencée à",
"ended": "Finie à"
},
"status": "Statut",
"refresh": {
"accepted": "Actualisation acceptée",
"notAllowed": "Actualisation impossible"
Expand Down Expand Up @@ -443,6 +442,7 @@
"view": "Vue",
"ordering": "Classement",
"description": "Description",
"show-description": "Afficher la description dans l'arbre des couches",
"interactions": "Interactions",
"all-data-available": " Toutes les données disponibles",
"error-required": "Ce champ est requis",
Expand Down
5 changes: 5 additions & 0 deletions src/modules/RA/DataLayer/components/tabs/DefinitionTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ const DefinitionTab = ({ onSwitch, external }) => {
fullWidth
/>

<BooleanInput
source="settings.description.show_in_tree"
label="datalayer.form.show-description"
/>

<FieldUpdater />
</FormGroupContextProvider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const LegendItemInput = ({ source, parentSource }) => {
<div style={{ display: 'flex', alignItems: 'center', gap: '1em' }}>
<Condition when={parentSource} is={({ shape }) => shape !== 'icon'}>
<FormLabel>{translate('datalayer.form.legend.shape')}</FormLabel>
<Field name={`${source}.color`} defaultValue="#00000000">
<Field name={`${source}.color`} defaultValue="#000000">
{({ input: { onChange, value } }) => (
<ColorPicker value={value || '#000000'} onChange={onChange} />
)}
Expand All @@ -76,7 +76,7 @@ const LegendItemInput = ({ source, parentSource }) => {
<FormLabel>{translate('datalayer.form.legend.stroke')}</FormLabel>
<Field name={`${source}.strokeColor`} defaultValue={undefined}>
{({ input: { onChange, value } }) => (
<ColorPicker value={value || '#00000000'} onChange={onChange} />
<ColorPicker value={value || '#000000'} onChange={onChange} />
)}
</Field>
<NumberInput source={`${source}.strokeWidth`} label="datalayer.form.legend.width" style={{ width: '8em' }} helperText={false} />
Expand Down

0 comments on commit 204914e

Please sign in to comment.