Skip to content

Commit

Permalink
alter key name to editableBy
Browse files Browse the repository at this point in the history
  • Loading branch information
RODO94 committed Nov 19, 2024
1 parent bb671d4 commit 943f540
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { FONT_WEIGHT_SEMI_BOLD } from "theme";

export const TAG_DISPLAY_VALUES: Record<
NodeTag,
{ color: keyof Palette["nodeTag"]; displayName: string; isEditable?: Role[] }
{ color: keyof Palette["nodeTag"]; displayName: string; editableBy?: Role[] }
> = {
placeholder: {
color: "blocking",
displayName: "Placeholder",
isEditable: ["platformAdmin"], // if new roles are added, we should update the canEdit() in ComponentTagSelect.tsx
editableBy: ["platformAdmin"], // if new roles are added, we should update the canEdit() in ComponentTagSelect.tsx
},
toReview: {
color: "nonBlocking",
Expand Down
4 changes: 2 additions & 2 deletions editor.planx.uk/src/ui/editor/ComponentTagSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const renderOption: AutocompleteProps<
false,
"div"
>["renderOption"] = (props, tag, { selected }) => {
if (TAG_DISPLAY_VALUES[tag].isEditable?.some(canEdit)) return null;
if (TAG_DISPLAY_VALUES[tag].editableBy?.some(canEdit)) return null;
return (
<ListItem {...props}>
<CustomCheckbox
Expand Down Expand Up @@ -70,7 +70,7 @@ const renderTags: AutocompleteProps<
),
})}
onDelete={
TAG_DISPLAY_VALUES[tag].isEditable?.some(canEdit)
TAG_DISPLAY_VALUES[tag].editableBy?.some(canEdit)
? undefined
: getTagProps({ index }).onDelete
}
Expand Down

0 comments on commit 943f540

Please sign in to comment.