Skip to content

Commit

Permalink
first draft moving all components to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-burel committed Feb 28, 2022
1 parent d87c956 commit 30d2a90
Show file tree
Hide file tree
Showing 10 changed files with 312 additions and 236 deletions.
15 changes: 13 additions & 2 deletions packages/i18n/intl.ts
Expand Up @@ -374,13 +374,16 @@ export const getIntlLabel = (
{
intl,
fieldName,
modelName,
collectionName,
schema,
isDescription,
}: {
intl?: any;
fieldName: string;
schema: VulcanSchema;
modelName?: string;
/** @deprecated use modelName instead */
collectionName?: string;
isDescription?: boolean;
},
Expand All @@ -403,8 +406,14 @@ export const getIntlLabel = (
if (intlId) {
intlKeys.push(intlId);
}
if (collectionName) {
intlKeys.push(`${collectionName.toLowerCase()}.${fieldName}`);
if (collectionName || modelName) {
intlKeys.push(
`${(
collectionName ||
modelName ||
"unknown-model-name"
).toLowerCase()}.${fieldName}`
);
}
intlKeys.push(`global.${fieldName}`);
intlKeys.push(fieldName);
Expand Down Expand Up @@ -432,6 +441,8 @@ export const formatLabel = (
intl?: any;
fieldName: string;
schema: VulcanSchema;
modelName?: string;
/** @deprecated use modelName instead */
collectionName?: string;
},
values?: any
Expand Down
Expand Up @@ -110,7 +110,6 @@ export const DatatableContents = (props: DatatableContentsProps) => {
{showSelect && <th />}
{sortedColumns.map((column, index) => (
<Components.DatatableHeader
Components={Components}
key={index}
model={model}
column={column}
Expand Down

0 comments on commit 30d2a90

Please sign in to comment.