Skip to content

Commit

Permalink
Remove dynamic formatted message ids (#1622)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxachun authored Jan 26, 2024
1 parent 298da50 commit 84e3e1f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ export const ContentScopeGrid: React.FC<{
value={JSON.stringify(contentScope)}
label={Object.entries(contentScope).map(([scope, value]) => (
<>
<FormattedMessage id={`contentScope.scope.${scope}`} defaultMessage={camelCaseToHumanReadable(scope)} />:{" "}
<FormattedMessage id={`contentScope.values.${value}`} defaultMessage={camelCaseToHumanReadable(value)} />
{camelCaseToHumanReadable(scope)}: {camelCaseToHumanReadable(value)}
<br />
</>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,7 @@ export const OverrideContentScopesDialog: React.FC<FormProps> = ({ permissionId,
value={JSON.stringify(contentScope)}
label={Object.entries(contentScope).map(([scope, value]) => (
<>
<FormattedMessage
id={`contentScope.scope.${scope}`}
defaultMessage={camelCaseToHumanReadable(scope)}
/>
:{" "}
<FormattedMessage
id={`contentScope.values.${value}`}
defaultMessage={camelCaseToHumanReadable(value)}
/>
{camelCaseToHumanReadable(scope)}: {camelCaseToHumanReadable(value)}
<br />
</>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ export const PermissionDialog: React.FC<FormProps> = ({ userId, permissionId, ha
name="permission"
component={FinalFormSelect}
options={availablePermissionsData.availablePermissions}
getOptionLabel={(permission: string) => (
<FormattedMessage id={`permission.${permission}`} defaultMessage={camelCaseToHumanReadable(permission)} />
)}
getOptionLabel={(permission: string) => camelCaseToHumanReadable(permission)}
disabled={disabled}
label={<FormattedMessage id="comet.userPermissions.permission" defaultMessage="Permission" />}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ export const PermissionGrid: React.FC<{
flex: 1,
pinnable: false,
headerName: intl.formatMessage({ id: "comet.userPermissions.permission", defaultMessage: "Permission" }),
renderCell: ({ row }) => (
<>
<Typography variant="h6">
<FormattedMessage id={`permission.${row.permission}`} defaultMessage={camelCaseToHumanReadable(row.permission)} />
</Typography>
</>
),
renderCell: ({ row }) => <Typography variant="h6">{camelCaseToHumanReadable(row.permission)}</Typography>,
},
{
field: "source",
Expand Down

0 comments on commit 84e3e1f

Please sign in to comment.