Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
NaicheD committed Sep 25, 2023
2 parents 6c2d19f + 81c41d2 commit 9aa5d5d
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface Props {
export default function EmptyContentSection({ hideLinksButton, readOnly }: Props) {
const routeToTab = useRouteToTab();
const refetch = useRefetch();
const { t } = useTranslation(['empty-message']);
const { t } = useTranslation(['translation', 'empty-message']);

return (
<EmptyContentWrapper>
Expand All @@ -38,7 +38,7 @@ export default function EmptyContentSection({ hideLinksButton, readOnly }: Props
</EmptyContentMessage>
{!readOnly && (
<Button onClick={() => routeToTab({ tabName: 'Documentation', tabParams: { editing: true } })}>
<EditOutlined /> Add Documentation
<EditOutlined /> {t('crud.addWithName', { name: t('common.documentation') })}
</Button>
)}
{!readOnly && !hideLinksButton && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface Props {
export default function DataProductSection({ readOnly }: Props) {
const [isModalVisible, setIsModalVisible] = useState(false);
const { entityData, urn } = useEntityData();
const { t } = useTranslation(['empty-message']);
const { t } = useTranslation(['translation', 'empty-message']);
const [batchSetDataProductMutation] = useBatchSetDataProductMutation();
const [dataProduct, setDataProduct] = useState<DataProduct | null>(null);
const dataProductRelationships = entityData?.dataProduct?.relationships;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const SidebarDomainSection = ({ readOnly, properties }: Props) => {
)}
{!readOnly && (
<StyledButton type="default" onClick={() => setShowModal(true)}>
<EditOutlined /> {t('crud.setWithname', { name: t('common.domain') })}
<EditOutlined /> {t('crud.setWithName', { name: t('common.domain') })}
</StyledButton>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import styled from 'styled-components';
import { Button, Table } from 'antd';
import { useTranslation } from 'react-i18next';
import { useBaseEntity } from '../../../EntityContext';
import { GetDatasetQuery, useGetExternalRolesQuery } from '../../../../../../graphql/dataset.generated';
import { useGetMeQuery } from '../../../../../../graphql/me.generated';
import { handleAccessRoles } from './utils';
import AccessManagerDescription from './AccessManagerDescription';
import { useTranslation } from 'react-i18next';

const StyledTable = styled(Table)`
overflow: inherit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export default function AccessManagerDescription({ description }: Props) {
toggleExpanded();
}}
>
{(shouldTruncateDescription && (expanded ? ` ${t('common.readLess')}` : `...${t('common.readMore')}`)) || undefined}
{(shouldTruncateDescription &&
(expanded ? ` ${t('common.readLess')}` : `...${t('common.readMore')}`)) ||
undefined}
</Typography.Link>
</DescriptionContainer>
);
Expand Down
4 changes: 1 addition & 3 deletions datahub-web-react/src/app/entity/tag/TagProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from 'react';

import { useParams } from 'react-router';
import styled from 'styled-components';

import { useTranslation } from 'react-i18next';
import { Message } from '../../shared/Message';
import { decodeUrn } from '../shared/utils';
import TagStyleEntity from '../../shared/TagStyleEntity';
import { useGetTagQuery } from '../../../graphql/tag.generated';
import { useTranslation } from 'react-i18next';

const PageContainer = styled.div`
padding: 32px 100px;
Expand Down
2 changes: 1 addition & 1 deletion datahub-web-react/src/app/glossary/GlossarySearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function GlossarySearch() {
<ClickOutside onClickOutside={() => setIsSearchBarFocused(false)}>
<SearchBar
initialQuery={query || ''}
placeholderText={t('placeholder.searchWithName', { name: t('common.common.glossary') })}
placeholderText={t('placeholder.searchWithName', { name: t('common.glossary') })}
suggestions={[]}
hideRecommendations
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,12 @@ export default function AssignRoleConfirmation({
})
: t('user.removeRoleTitle', { username });

return <Popconfirm title={assignRoleText} visible={visible} onConfirm={batchAssignRole} onCancel={onClose} />;
return <Popconfirm
title={assignRoleText}
visible={visible}
onConfirm={batchAssignRole}
onCancel={onClose}
okText={t('common.ok')}
cancelText={t('common.cancel')}
/>;
}
2 changes: 1 addition & 1 deletion datahub-web-react/src/app/identity/user/SelectRole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { UserOutlined } from '@ant-design/icons';
import { Select } from 'antd';
import { useApolloClient } from '@apollo/client';
import styled from 'styled-components';
import { useTranslation } from 'react-i18next';
import { CorpUser, DataHubRole } from '../../../types.generated';
import AssignRoleConfirmation from './AssignRoleConfirmation';
import { mapRoleIcon } from './UserUtils';
import { ANTD_GRAY } from '../../entity/shared/constants';
import { clearRoleListCache } from '../../permissions/roles/cacheUtils';
import { useTranslation } from 'react-i18next';

const NO_ROLE_TRANS_KEY = 'permissions.noRole';
const NO_ROLE_URN = 'urn:li:dataHubRole:NoRole';
Expand Down
2 changes: 1 addition & 1 deletion datahub-web-react/src/app/ingest/source/IngestedAssets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default function IngestedAssets({ id }: Props) {
</ViewAllButton>
{showAssetSearch && (
<EmbeddedListSearchModal
title="View Ingested Assets"
title={t('ingest.viewIngestedAssets')}
searchBarStyle={{ width: 600, marginRight: 40 }}
fixedFilters={{
unionType: UnionType.AND,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function IngestionSourceTable({
title: t('common.schedule'),
dataIndex: 'schedule',
key: 'schedule',
render: ScheduleColumn,
render: (schedule: any, record: any) => ScheduleColumn(schedule, record, t),
},
{
title: t('ingest.executionCount'),
Expand All @@ -77,7 +77,7 @@ function IngestionSourceTable({
title: t('ingest.lastExecution'),
dataIndex: 'lastExecTime',
key: 'lastExecTime',
render: LastExecutionColumn,
render: (schedule: any) => LastExecutionColumn(schedule, t),
sorter: (sourceA, sourceB) => sourceA.lastExecTime - sourceB.lastExecTime,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import cronstrue from 'cronstrue';
import React from 'react';
import styled from 'styled-components/macro';
import { useTranslation } from 'react-i18next';
import { TFunction } from 'i18next';
import { ANTD_GRAY } from '../../entity/shared/constants';
import { capitalizeFirstLetter } from '../../shared/textUtil';
import useGetSourceLogoUrl from './builder/useGetSourceLogoUrl';
Expand All @@ -19,7 +20,7 @@ const PreviewImage = styled(Image)`
max-height: 28px;
width: auto;
object-fit: contain;
margin: 0px;
margin: 0;
background-color: transparent;
`;

Expand All @@ -30,8 +31,8 @@ const StatusContainer = styled.div`
`;

const StatusButton = styled(Button)`
padding: 0px;
margin: 0px;
padding: 0;
margin: 0;
`;

const ActionButtonContainer = styled.div`
Expand All @@ -49,8 +50,6 @@ const CliBadge = styled.span`
border-radius: 15px;
border: 1px solid ${ANTD_GRAY[8]};
padding: 1px 4px;
font-size: 10px;
font-size: 8px;
font-weight: bold;
letter-spacing: 0.5px;
Expand Down Expand Up @@ -93,15 +92,13 @@ export function TypeColumn({ type, record }: TypeColumnProps) {
);
}

export function LastExecutionColumn(time: any) {
const { t } = useTranslation();
export function LastExecutionColumn(time: any, t: TFunction) {
const executionDate = time && new Date(time);
const localTime = executionDate && `${executionDate.toLocaleDateString()} at ${executionDate.toLocaleTimeString()}`;
return <Typography.Text>{localTime || t('common.none')}</Typography.Text>;
}

export function ScheduleColumn(schedule: any, record: any) {
const { t } = useTranslation();
export function ScheduleColumn(schedule: any, record: any, t: TFunction) {
const tooltip =
schedule && `${t('common.runs')} ${cronstrue.toString(schedule).toLowerCase()} (${record.timezone})`;
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ type Props = {
export const IngestionSourceBuilderModal = ({ initialState, visible, onSubmit, onCancel }: Props) => {
const { t } = useTranslation();
const isEditing = initialState !== undefined;
const titleText = isEditing ? 'Edit Ingestion Source' : 'New Ingestion Source';
const titleText = isEditing
? t('crud.editWithName', { name: t('ingest.ingestionSource') })
: t('crud.createWithName', { name: t('ingest.ingestionSource') });
const initialStep = isEditing
? IngestionSourceBuilderStep.DEFINE_RECIPE
: IngestionSourceBuilderStep.SELECT_TEMPLATE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ export default function IngestionExecutionTable({
title: t('ingest.requestedAt'),
dataIndex: 'requestedAt',
key: 'requestedAt',
render: TimeColumn,
render: (time: string) => TimeColumn(time, t),
},
{
title: t('ingest.startedAt'),
dataIndex: 'executedAt',
key: 'executedAt',
render: TimeColumn,
render: (time: string) => TimeColumn(time, t),
},
{
title: `${t('ingest.duration')} (s)`,
title: t('ingest.duration'),
dataIndex: 'duration',
key: 'duration',
render: (durationMs: number) => {
Expand All @@ -56,7 +56,7 @@ export default function IngestionExecutionTable({
title: t('common.source'),
dataIndex: 'source',
key: 'source',
render: SourceColumn,
render: (source: string) => SourceColumn(source, t),
},
{
title: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { CopyOutlined } from '@ant-design/icons';
import { Button, Typography, Tooltip } from 'antd';
import styled from 'styled-components';
import { useTranslation } from 'react-i18next';
import { TFunction } from 'i18next';
import {
getExecutionRequestStatusDisplayColor,
getExecutionRequestStatusIcon,
Expand All @@ -21,12 +22,11 @@ const StatusContainer = styled.div`
`;

const StatusButton = styled(Button)`
padding: 0px;
margin: 0px;
padding: 0;
margin: 0;
`;

export function TimeColumn(time: string) {
const { t } = useTranslation();
export function TimeColumn(time: string, t: TFunction) {
const date = time && new Date(time);
const localTime = date && `${date.toLocaleDateString()} at ${date.toLocaleTimeString()}`;
return <Typography.Text>{localTime || t('common.none')}</Typography.Text>;
Expand Down Expand Up @@ -55,8 +55,7 @@ export function StatusColumn({ status, record, setFocusExecutionUrn }: StatusCol
);
}

export function SourceColumn(source: string) {
const { t } = useTranslation();
export function SourceColumn(source: string, t: TFunction) {
return (
(source === MANUAL_INGESTION_SOURCE && t('ingest.manualExecution')) ||
(source === SCHEDULED_INGESTION_SOURCE && t('ingest.scheduledExecution')) ||
Expand Down
10 changes: 8 additions & 2 deletions datahub-web-react/src/app/permissions/policy/PolicyTypeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function PolicyTypeForm({
labelAlign="right"
label={<Typography.Text strong>{t('common.name')}</Typography.Text>}
>
<Typography.Paragraph>{t('nameForNewPolicy')}</Typography.Paragraph>
<Typography.Paragraph>{t('permissions.nameForNewPolicy')}</Typography.Paragraph>
<Input
placeholder={t('placeholder.yourPolicyNamePlaceholder')}
data-testid="policy-name"
Expand All @@ -70,7 +70,13 @@ export default function PolicyTypeForm({
<TypeDescriptionParagraph type="secondary">
<Trans
{...{
i18nKey: 'permissions.typeOfPolicyDescription_component',
i18nKey: 'permissions.typeOfPolicyDescriptionPlatform_component',
components: { bold: <b /> },
}}
/>
<Trans
{...{
i18nKey: 'permissions.typeOfPolicyDescriptionMetadata_component',
components: { bold: <b /> },
}}
/>
Expand Down
1 change: 0 additions & 1 deletion datahub-web-react/src/conf/locales/en/empty-message.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{
"documentation": {
"title": "No documentation yet",
Expand Down
6 changes: 5 additions & 1 deletion datahub-web-react/src/conf/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,8 @@
"welcomeBack": "Welcome back"
},
"ingest": {
"viewIngestedAssets": "View Ingested Assets",
"ingestionSource": "Ingestion Source",
"aConnectionWasNotAbleToBeEstablishedWithSourceName": "A connection was not able to be established with {{sourceName}}.",
"aConnectionWasSuccessfullyEstablishedWithSourceName": "A connection was successfully established with {{sourceName}}.",
"advancedProvideCustomCLIVersionToUseForIngestion": "Advanced: Provide a custom CLI version to use for ingestion.",
Expand Down Expand Up @@ -1381,6 +1383,7 @@
"policyAppliesToLabel": "Select the users & groups that this policy should apply to.",
"policyAppliesToUserDescription": "Search for specific users that this policy should apply to, or select `All Users` to apply it to all users.",
"policyBuilderSteps": {

"assignUserAndGroups": "Assign Users & Groups",
"choosePolicyType": "Choose Policy Type",
"configurePrivileges": "Configure Privileges"
Expand All @@ -1393,7 +1396,8 @@
"successfullyDeactivatedPolicy": "Successfully deactivated policy.",
"successfullyRemovedPolicy": "Successfully removed policy.",
"successfullySavedPolicy": "Successfully saved policy.",
"typeOfPolicyDescription_component": "The <bold>Platform</bold> policy type allows you to assign top-level DataHub Platform privileges to users.These include managing users and groups, creating policies, viewing analytics dashboards and more.<br /><br />The <bold>Metadata</bold> policy type allows you to assign metadata privileges to users. These include the ability to manipulate metadata like ownership, tags, documentation associated with Datasets, Charts, Dashboards, & more.",
"typeOfPolicyDescriptionPlatform_component": "The <bold>Platform</bold> policy type allows you to assign top-level DataHub Platform privileges to users.These include managing users and groups, creating policies, viewing analytics dashboards and more.<br /><br />",
"typeOfPolicyDescriptionMetadata_component": "The <bold>Metadata</bold> policy type allows you to assign metadata privileges to users. These include the ability to manipulate metadata like ownership, tags, documentation associated with Datasets, Charts, Dashboards, & more.",
"typeOfPolicyToCreate": "The type of policy you would like to create."
},
"placeholder": {
Expand Down
1 change: 0 additions & 1 deletion datahub-web-react/src/conf/locales/fr/empty-message.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{
"documentation": {
"title": "Aucune documentation pour le moment",
Expand Down
13 changes: 8 additions & 5 deletions datahub-web-react/src/conf/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,8 @@
"welcomeBack": "Bienvenue"
},
"ingest": {
"viewIngestedAssets": "Voir les Assets ingérés",
"ingestionSource": "Source d'Ingestion",
"aConnectionWasNotAbleToBeEstablishedWithSourceName": "Impossible d'établir une connexion avec {{sourceName}}.",
"aConnectionWasSuccessfullyEstablishedWithSourceName": "Une connexion a été établie avec succès avec {{sourceName}}.",
"advancedProvideCustomCLIVersionToUseForIngestion": "Avancé : Fournissez une version personnalisée de l'interface de ligne de commande (CLI) à utiliser pour l'ingestion.",
Expand Down Expand Up @@ -1381,9 +1383,9 @@
"policyAppliesToLabel": "Choisissez les Utilisateurs et Groupes auxquel ce Droit s'appliquera.",
"policyAppliesToUserDescription": "Cherchz des Utilisateurs spécifiques auxquels ce Droit doit s'appliquer ou sélectionnez <bold>TouT Utilisateurs</bold> pour l'appliquer à tous les utilisateurs.",
"policyBuilderSteps": {
"assignUserAndGroups": "Assigners des Utilisateurs et des Groupes",
"choosePolicyType": "Choisir un Type de Droit",
"configurePrivileges": "Configurer les Privilèges"
"assignUserAndGroups": "Assigner Utilisateurs et Groupes",
"choosePolicyType": "Choisir Type de Droit",
"configurePrivileges": "Configurer Privilèges"
},
"privilegesLabel": "Choisissez un ensemble de privilèges à accorder.",
"resourceDescription": "Cherchez des ressources spécifiques auxquelles appliquer ce Droit. Si vous sélectionnez <bold>Aucun</bold>, le droit s'appliquera à <bold>toute</bold> les ressources du type sélectionné.",
Expand All @@ -1393,7 +1395,8 @@
"successfullyDeactivatedPolicy": "Droit désactivé.",
"successfullyRemovedPolicy": "Droit supprimé.",
"successfullySavedPolicy": "Droit enregistré.",
"typeOfPolicyDescription_component": "Le Droit <bold>Plateforme</bold> vous permet d'attribuer des privilèges de niveau supérieur à la plateforme DataHub aux utilisateurs. Cela inclut la gestion des utilisateurs et des groupes, la création de politiques, la consultation des tableaux de bord d'analyse, et bien plus encore.<br /><br />Le type de politique <bold>MetaData</bold> vous permet d'attribuer des privilèges de metadatas aux utilisateurs. Cela inclut la possibilité de manipuler des métadonnées telles que la propriété, les balises, la documentation associée aux jeux de données, aux graphiques, aux tableaux de bord, et bien plus encore.",
"typeOfPolicyDescriptionPlatform_component": "Le Droit <bold>Plateforme</bold> vous permet d'attribuer des privilèges de niveau supérieur à la plateforme DataHub aux utilisateurs. Cela inclut la gestion des utilisateurs et des groupes, la création de politiques, la consultation des tableaux de bord d'analyse, et bien plus encore.<br /><br />",
"typeOfPolicyDescriptionMetadata_component": "Le Droit <bold>MetaData</bold> vous permet d'attribuer des privilèges de metadatas aux utilisateurs. Cela inclut la possibilité de manipuler des métadonnées telles que la propriété, les balises, la documentation associée aux jeux de données, aux graphiques, aux tableaux de bord, et bien plus encore.",
"typeOfPolicyToCreate": "Le type de droit que vous voulez créer."
},
"placeholder": {
Expand All @@ -1418,7 +1421,7 @@
"searchWithName": "Rechercher {{name}}...",
"selectAColumn": "Sélectionner une colonne",
"shortLabelForLink": "Un libellé court pour ce lien",
"viewUsefulForDataAnalysts": "Cette Vue est utile pour les Data Analyste",
"viewUsefulForDataAnalysts": "Cette Vue est utile pour les Data Analystes",
"yourPolicyNamePlaceholder": "Le nom de votre Droit"
},
"post": {
Expand Down
5 changes: 0 additions & 5 deletions datahub-web-react/src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ i18n
.init({
fallbackLng: 'en',
debug: true,
// ns: ['translation', 'empty-message', 'form', 'react-cron', 'theme'],
// backend: {
// loadPath: '/conf/locales/{{lng}}/{{ns}}.json',
// allowMultiLoading: true,
// },
resources,
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
Expand Down

0 comments on commit 9aa5d5d

Please sign in to comment.