Added translations for the task types
This commit is contained in:
parent
6e939fae6e
commit
40e81a555f
@ -6,6 +6,7 @@
|
||||
"Active": "Active",
|
||||
"Add": "Add",
|
||||
"AddDomain": "Add Domain",
|
||||
"AddTask": "Add Task",
|
||||
"Address": "Address",
|
||||
"AddUser": "Add User",
|
||||
"AddWorkflowTemplate": "Add Workflow Template",
|
||||
|
||||
14
public/locales/en/taskTypes.json
Normal file
14
public/locales/en/taskTypes.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"AdhocApprovalTask": "Adhoc Approval",
|
||||
"ApprovalTask": "Approval",
|
||||
"AssetUploadTask": "Asset Upload",
|
||||
"BasicTask": "Basic",
|
||||
"ContentCollationTask": "Content Collation",
|
||||
"FileReleaseTask": "File Release",
|
||||
"FormDataInputTask": "Form Data Input",
|
||||
"LinkActivityTask": "Link Activity",
|
||||
"MilestoneTask": "Milestone",
|
||||
"StageTask": "Stage",
|
||||
"VisualBriefReviewTask": "Visual Brief Review",
|
||||
"VisualBriefUploadTask": "Visual Brief Upload"
|
||||
}
|
||||
@ -48,7 +48,7 @@ import WorkflowTemplateManager from "./modules/manager/workflowTemplates/Workflo
|
||||
import WorkflowTemplateDetails from "./modules/manager/workflowTemplates/WorkflowTemplateDetails";
|
||||
|
||||
function GetSecureRoutes() {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@ -21,7 +21,7 @@ function ConfirmButton<T>({
|
||||
onClick,
|
||||
}: ConfirmButtonProps<T>) {
|
||||
const [firstClick, setFirstClick] = useState(false);
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const handleFirstClick = useCallback(() => {
|
||||
setFirstClick(true);
|
||||
|
||||
@ -31,7 +31,7 @@ const CustomFieldsEditor: React.FC<CustomFieldsEditorProps> = ({
|
||||
onAdd,
|
||||
onDelete,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [id, setId] = useState<GeneralIdRef | undefined>(undefined);
|
||||
const [displayName, setDisplayName] = useState<string | undefined>(undefined);
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ import { Namespaces } from "../../i18n/i18n";
|
||||
interface LoadingProps {}
|
||||
|
||||
const LoadingPanel: React.FC<LoadingProps> = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
return <div>{t("Loading")}</div>;
|
||||
};
|
||||
|
||||
@ -51,7 +51,7 @@ export default function Select({
|
||||
onChange,
|
||||
...rest
|
||||
}: SelectProps) {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const isMultiple = multiple ?? options === undefined;
|
||||
const actualValue = NormalizeSelectValue(value, isMultiple);
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ export default function TableBody<T>({
|
||||
onSelectRow,
|
||||
showSecondaryAudit,
|
||||
}: TableBodyProps<T>): JSX.Element {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const resolvePath = (path: string, args: string[]) => {
|
||||
let modifiedPath = path;
|
||||
let index = 0;
|
||||
|
||||
@ -9,6 +9,7 @@ export const Namespaces = {
|
||||
Common: "common",
|
||||
MailTypes: "mailTypes",
|
||||
HtmlIsland: "htmlIsland",
|
||||
TaskTypes: "taskTypes",
|
||||
} as const;
|
||||
|
||||
export type Namespace = (typeof Namespaces)[keyof typeof Namespaces];
|
||||
|
||||
@ -11,7 +11,7 @@ import { Namespaces } from "../../i18n/i18n";
|
||||
export default function Audit() {
|
||||
const location = useLocation();
|
||||
const params = useParams();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [pagedData, setPagedData] = useState<Paginated<AuditLogEntry>>({
|
||||
|
||||
@ -27,7 +27,7 @@ interface AuditFieldChangeValues {
|
||||
|
||||
export default function AuditTable(props: PublishedTableProps<AuditLogEntry>) {
|
||||
const { data, sortColumn, onChangePage, onSearch, onSort } = props;
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const fieldColumns: Column<AuditFieldChangeValues>[] = useMemo(
|
||||
() => [
|
||||
|
||||
@ -10,7 +10,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Namespaces } from "../../i18n/i18n";
|
||||
|
||||
export default function BlockedIPs() {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [pagedData, setPagedData] = useState<Paginated<BlockedIPEntry>>({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
|
||||
@ -13,7 +13,7 @@ import { Namespaces } from "../../../i18n/i18n";
|
||||
export default function BlockedIPsTable(
|
||||
props: PublishedTableProps<BlockedIPEntry>,
|
||||
) {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const { data, sortColumn, onChangePage, onSearch, onSort, onDelete } = props;
|
||||
|
||||
const canUnblockBlockedIPAddress =
|
||||
|
||||
@ -10,7 +10,7 @@ import ExpandableCell from "../../../components/common/ExpandableCell";
|
||||
export default function ErrorLogsTable(
|
||||
props: PublishedTableProps<ErrorLog>,
|
||||
): JSX.Element {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const { data, sortColumn, onChangePage, onSearch, onSort } = props;
|
||||
|
||||
const columns: Column<ErrorLog>[] = useMemo(
|
||||
|
||||
@ -7,7 +7,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Namespaces } from "../../i18n/i18n";
|
||||
|
||||
const ErrorLogs = (): JSX.Element => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [pagedData, setPagedData] = useState<Paginated<ErrorLog>>({
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
|
||||
@ -19,7 +19,7 @@ interface Props {
|
||||
}
|
||||
|
||||
const EmailUserActionConfirmEmail: React.FC<Props> = ({ emailUserAction }) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [password, setPassword] = useState("");
|
||||
const [confirmPassword, setConfirmPassword] = useState("");
|
||||
const [emailConfirmed, setEmailConfirmed] = useState(false);
|
||||
|
||||
@ -16,7 +16,7 @@ interface Props {
|
||||
const EmailUserActionDiableTwoFactorAuthentication: React.FC<Props> = ({
|
||||
emailUserAction,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [authenticatorDisabled, setAuthenticatorDisabled] = useState(false);
|
||||
|
||||
const LABEL_DISABLE_AUTHENTICATOR = t("DisableAuthenticator");
|
||||
|
||||
@ -19,7 +19,7 @@ interface Props {
|
||||
}
|
||||
|
||||
const EmailUserActionPasswordReset: React.FC<Props> = ({ emailUserAction }) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [password, setPassword] = useState("");
|
||||
const [confirmPassword, setConfirmPassword] = useState("");
|
||||
const [passwordChanged, setPasswordChanged] = useState(false);
|
||||
|
||||
@ -12,7 +12,7 @@ export interface ForgotPasswordData extends FormData {
|
||||
}
|
||||
|
||||
const ForgotPassword: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [username, setUsername] = useState("");
|
||||
const [emailSent, setEmailSent] = useState(false);
|
||||
const [generalError, setGeneralError] = useState("");
|
||||
|
||||
@ -14,7 +14,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Namespaces } from "../../../i18n/i18n";
|
||||
|
||||
const InternalLoginForm: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [isInNextStage, setIsInNextStage] = useState(false);
|
||||
const [emailSent, setEmailSent] = useState(false);
|
||||
const passwordMaxLength = 255;
|
||||
|
||||
@ -13,7 +13,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Namespaces } from "../../../i18n/i18n";
|
||||
|
||||
const LeftMenu: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const [openMenuItem, setOpenMenuItem] = useState<
|
||||
{ id: string; children: React.ReactNode } | undefined
|
||||
|
||||
@ -4,7 +4,7 @@ import { Namespaces } from "../../../i18n/i18n";
|
||||
import authentication from "../services/authenticationService";
|
||||
|
||||
const Logout: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
useEffect(() => {
|
||||
authentication.logout();
|
||||
|
||||
@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Namespaces } from "../../../i18n/i18n";
|
||||
|
||||
const NotFound: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
return <h1>{t("NotFound")}</h1>;
|
||||
};
|
||||
|
||||
@ -19,7 +19,7 @@ export interface TopMenuProps {
|
||||
|
||||
function TopMenu(props: TopMenuProps) {
|
||||
const user = getCurrentUser();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
return (
|
||||
<Navbar className="navbar bg-body-tertiary px-4 Header">
|
||||
|
||||
@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Namespaces } from "../../i18n/i18n";
|
||||
|
||||
const HomePage: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const redirect = () => {
|
||||
window.location.href = "/organisations";
|
||||
|
||||
@ -11,7 +11,7 @@ import { CustomField } from "../services/customFieldsService";
|
||||
const CustomFieldsTable: React.FC<PublishedTableProps<CustomField>> = (
|
||||
props,
|
||||
) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const columns: Column<CustomField>[] = [
|
||||
{ key: "name", label: t("Name"), order: "asc" },
|
||||
|
||||
@ -37,7 +37,7 @@ const CustomFieldDetails: React.FC<CustomFieldDetailsProps> = ({
|
||||
editMode = false,
|
||||
}) => {
|
||||
const { customFieldId } = useParams<{ customFieldId: string }>();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const labelName = t("Name");
|
||||
const labelFieldType = t("FieldType");
|
||||
|
||||
@ -20,7 +20,7 @@ const initialPagedData: Paginated<CustomField> = {
|
||||
};
|
||||
|
||||
const CustomFields: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [pagedData, setPagedData] =
|
||||
useState<Paginated<CustomField>>(initialPagedData);
|
||||
|
||||
@ -18,7 +18,7 @@ const initialPagedData: Paginated<GetDomain> = {
|
||||
};
|
||||
|
||||
const Domains: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [pagedData, setPagedData] =
|
||||
useState<Paginated<GetDomain>>(initialPagedData);
|
||||
|
||||
@ -14,7 +14,7 @@ interface DomainsDetailsProps {
|
||||
}
|
||||
|
||||
const DomainsDetails: React.FC<DomainsDetailsProps> = ({ isEditMode }) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [searchParams] = useSearchParams();
|
||||
|
||||
const canViewMailTemplates = authentication.hasAccess("ViewDomain");
|
||||
|
||||
@ -23,7 +23,7 @@ const AddUserToRole: React.FC<LocAddUserToRoleProps> = ({ isEditMode }) => {
|
||||
domainId: string;
|
||||
roleId: string;
|
||||
}>();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const labelUserId = t("User");
|
||||
const labelApply = t("Save");
|
||||
|
||||
@ -24,7 +24,7 @@ const EmailTemplateEditor: React.FC<EmailTemplateEditorProps> = ({
|
||||
domainId,
|
||||
currentMailType,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const paramsData = useParams<{ domainId: string }>();
|
||||
const finalDomainId = domainId || paramsData.domainId;
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ interface GeneralTabProps {
|
||||
|
||||
const GeneralTab: React.FC<GeneralTabProps> = ({ isEditMode }) => {
|
||||
const { domainId } = useParams<{ domainId: string }>();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const labelName = t("Name");
|
||||
const labelSsoProvider = t("SsoProvider");
|
||||
|
||||
@ -32,7 +32,7 @@ interface RoleAccessEditorProps {
|
||||
}
|
||||
|
||||
const RoleAccessEditor: React.FC<RoleAccessEditorProps> = ({ role }) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [accessList, setAccessList] =
|
||||
useState<Paginated<GetSecurityAccess>>(initialAccessList);
|
||||
|
||||
@ -24,7 +24,7 @@ const RolesDetails: React.FC<RolesDetailsProps> = ({ isEditMode }) => {
|
||||
domainId: string;
|
||||
roleId: string;
|
||||
}>();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const labelName = t("Name");
|
||||
const labelApply = t("Save");
|
||||
|
||||
@ -35,7 +35,7 @@ const RolesEditor: React.FC<RolesEditorProps> = ({
|
||||
initialRoleId,
|
||||
hashSegment,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const hashRoleId = useHashSegment(
|
||||
hashSegment !== undefined ? hashSegment : -1,
|
||||
);
|
||||
|
||||
@ -9,7 +9,7 @@ import authentication from "../../../frame/services/authenticationService";
|
||||
import { GetRoleResponse } from "../serrvices/rolesService";
|
||||
|
||||
const RolesTable: React.FC<PublishedTableProps<GetRoleResponse>> = (props) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const columns: Column<GetRoleResponse>[] = [
|
||||
{ key: "name", label: t("Name"), order: "asc" },
|
||||
|
||||
@ -22,7 +22,7 @@ const RollAccessTable: React.FC<RollAccessTableProps> = ({
|
||||
onSort,
|
||||
data,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [deltaAdditions, setDeltaAdditions] = useState<string[]>([]);
|
||||
const [deltaDeletions, setDeltaDeletions] = useState<string[]>([]);
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ const SecurityRolesTab: React.FC<SecurityRolesTabProps> = ({
|
||||
initialRoleId,
|
||||
initialInnerTab,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [selectedRole, setSelectedRole] = useState<GetRoleResponse | undefined>(
|
||||
undefined,
|
||||
);
|
||||
|
||||
@ -23,7 +23,7 @@ interface UserRoleEditorProps {
|
||||
}
|
||||
|
||||
const UserRoleEditor: React.FC<UserRoleEditorProps> = ({ role }) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [pagedData, setPagedData] =
|
||||
useState<Paginated<RoleUser>>(initialPagedData);
|
||||
|
||||
@ -9,7 +9,7 @@ import authentication from "../../../frame/services/authenticationService";
|
||||
import { RoleUser } from "../serrvices/rolesService";
|
||||
|
||||
const UserRolesTable: React.FC<PublishedTableProps<RoleUser>> = (props) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const columns: Column<RoleUser>[] = [
|
||||
{ key: "displayName", label: t("Name"), order: "asc" },
|
||||
|
||||
@ -9,7 +9,7 @@ import authentication from "../../../frame/services/authenticationService";
|
||||
import { GetDomain } from "../serrvices/domainsService";
|
||||
|
||||
const DomainsTable: React.FC<PublishedTableProps<GetDomain>> = (props) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const columns: Column<GetDomain>[] = [
|
||||
{ key: "name", label: t("Name"), order: "asc" },
|
||||
|
||||
@ -10,7 +10,7 @@ import formsService, { GetFormResponse } from "./services/formsService";
|
||||
import Loading from "../../../components/common/Loading";
|
||||
|
||||
const Forms: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [pagedData, setPagedData] = useState<Paginated<GetFormResponse>>({
|
||||
|
||||
@ -20,7 +20,7 @@ const FormsDetails: React.FC<{ editMode?: boolean }> = ({
|
||||
editMode = false,
|
||||
}) => {
|
||||
const { formId } = useParams<{ formId: string }>();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const labelName = t("Name");
|
||||
const labelDefinition = t("Definition");
|
||||
|
||||
@ -16,7 +16,7 @@ const FormsTable: React.FC<PublishedTableProps<GetFormResponse>> = ({
|
||||
onDelete,
|
||||
onSort,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const columns: Column<GetFormResponse>[] = useMemo(
|
||||
() => [
|
||||
|
||||
@ -30,7 +30,7 @@ const GlossariesDetails: React.FC<GlossariesDetailsProps> = ({
|
||||
editMode = false,
|
||||
}) => {
|
||||
const { glossaryId } = useParams<{ glossaryId: string }>();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const labelName = t("Name");
|
||||
const labelChildCustomFieldDefinition = t("CustomFieldForChildEntries");
|
||||
|
||||
@ -14,7 +14,7 @@ import Loading from "../../../components/common/Loading";
|
||||
import Permission from "../../../components/common/Permission";
|
||||
|
||||
const Glossaries: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const { glossaryId } = useParams<{ glossaryId: string }>();
|
||||
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
|
||||
@ -23,7 +23,7 @@ const GlossariesTable: React.FC<GlossariesTableProps> = ({
|
||||
data,
|
||||
onDelete,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const [columnsList, setColumnsList] = useState<CustomColumn[]>([]);
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";import { Namespaces } from "../../../i18n/i18n";import Button, { ButtonType } from "../../../components/common/Button";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Namespaces } from "../../../i18n/i18n";
|
||||
import Button, { ButtonType } from "../../../components/common/Button";
|
||||
import Column from "../../../components/common/columns";
|
||||
import Permission from "../../../components/common/Permission";
|
||||
import { Paginated } from "../../../services/Paginated";
|
||||
@ -10,7 +12,7 @@ import organisationsService, {
|
||||
import Loading from "../../../components/common/Loading";
|
||||
|
||||
const Organisations: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [pagedData, setPagedData] = useState<Paginated<ReadOrganisation>>({
|
||||
page: 1,
|
||||
|
||||
@ -21,7 +21,7 @@ const OrganisationsDetails: React.FC<{ editMode?: boolean }> = ({
|
||||
editMode = false,
|
||||
}) => {
|
||||
const { organisationId } = useParams<{ organisationId: string }>();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const labelName = t("Name");
|
||||
const labelAddress = t("Address");
|
||||
|
||||
@ -16,7 +16,7 @@ const OrganisationsTable: React.FC<PublishedTableProps<ReadOrganisation>> = ({
|
||||
onDelete,
|
||||
onSort,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const canViewSite = authentication.hasAccess("ViewSite");
|
||||
|
||||
const columns: Column<ReadOrganisation>[] = useMemo(
|
||||
|
||||
@ -26,7 +26,7 @@ const SequenceDetails: React.FC<SequenceDetailsProps> = ({
|
||||
editMode = false,
|
||||
}) => {
|
||||
const { sequenceId } = useParams<{ sequenceId: string }>();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const labelName = t("Name");
|
||||
const labelSeed = t("Seed");
|
||||
|
||||
@ -16,7 +16,7 @@ const SequenceTable: React.FC<PublishedTableProps<ReadSequence>> = ({
|
||||
onDelete,
|
||||
onSort,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const columns: Column<ReadSequence>[] = useMemo(
|
||||
() => [{ key: "name", label: t("Name"), order: "asc" }],
|
||||
|
||||
@ -10,7 +10,7 @@ import Loading from "../../../components/common/Loading";
|
||||
import Permission from "../../../components/common/Permission";
|
||||
|
||||
const Sequence: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [pagedData, setPagedData] = useState<Paginated<ReadSequence>>({
|
||||
page: 1,
|
||||
|
||||
@ -26,7 +26,7 @@ const SiteDetails: React.FC<SiteDetailsProps> = ({ editMode = false }) => {
|
||||
organisationId: string;
|
||||
siteId?: string;
|
||||
}>();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const labelName = t("Name");
|
||||
const labelAddress = t("Address");
|
||||
|
||||
@ -19,7 +19,7 @@ const initialPagedData: Paginated<ReadSite> = {
|
||||
};
|
||||
|
||||
const Sites: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const { organisationId } = useParams<{ organisationId: string }>();
|
||||
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
|
||||
@ -17,7 +17,7 @@ const SitesTable: React.FC<PublishedTableProps<ReadSite>> = ({
|
||||
onDelete,
|
||||
onSort,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const columns: Column<ReadSite>[] = useMemo(
|
||||
() => [
|
||||
|
||||
@ -21,7 +21,7 @@ const initialPagedData: Paginated<ReadSpecification> = {
|
||||
};
|
||||
|
||||
const Specifications: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const { siteId } = useParams<{ siteId: string }>();
|
||||
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
|
||||
@ -35,7 +35,7 @@ const SpecificationsDetails: React.FC<SpecificationsDetailsProps> = ({
|
||||
siteId: string;
|
||||
specificationId?: string;
|
||||
}>();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const TemplateFillerRef = useRef<TemplateFillerHandle>(null);
|
||||
|
||||
const labelName = t("Name");
|
||||
|
||||
@ -16,7 +16,7 @@ const SpecificationsTable: React.FC<PublishedTableProps<ReadSpecification>> = ({
|
||||
onDelete,
|
||||
onSort,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const columns: Column<ReadSpecification>[] = useMemo(
|
||||
() => [{ key: "name", label: t("Name"), order: "asc" }],
|
||||
|
||||
@ -24,7 +24,7 @@ const SsoProviderDetails: React.FC<SsoProviderDetailsProps> = ({
|
||||
}) => {
|
||||
const { ssoProviderId } = useParams<{ ssoProviderId: string }>();
|
||||
const location = useLocation();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const labelName = t("Name");
|
||||
const labelClientId = t("ClientId");
|
||||
|
||||
@ -16,7 +16,7 @@ const SsoManagerTable: React.FC<PublishedTableProps<GetSsoProvider>> = ({
|
||||
onDelete,
|
||||
onSort,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const columns: Column<GetSsoProvider>[] = useMemo(
|
||||
() => [{ key: "name", label: t("Name"), order: "asc" }],
|
||||
|
||||
@ -12,7 +12,7 @@ import Loading from "../../../components/common/Loading";
|
||||
import Permission from "../../../components/common/Permission";
|
||||
|
||||
const SsoManager: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [pagedData, setPagedData] = useState<Paginated<GetSsoProvider>>({
|
||||
page: 1,
|
||||
|
||||
@ -10,7 +10,7 @@ interface UserDetailsProps {
|
||||
}
|
||||
|
||||
const UserDetails: React.FC<UserDetailsProps> = ({ editMode }) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const heading = editMode ? t("EditUser") : t("AddUser");
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ interface GeneralTabProps {
|
||||
|
||||
const GeneralTab: React.FC<GeneralTabProps> = ({ isEditMode }) => {
|
||||
const { userId } = useParams<{ userId: string }>();
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
const labelFirstName = t("FirstName");
|
||||
const labelMiddleNames = t("MiddleNames");
|
||||
|
||||
@ -24,7 +24,7 @@ const UsersTable: React.FC<UsersTableProps> = ({
|
||||
onSort,
|
||||
resendConfirmEmail,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const canResendConfirmMail = authentication.hasAccess("ResendConfirmMail");
|
||||
|
||||
const resendConfirmEmailHandler = useCallback(
|
||||
|
||||
@ -11,7 +11,7 @@ import Loading from "../../../components/common/Loading";
|
||||
import Permission from "../../../components/common/Permission";
|
||||
|
||||
const Users: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [pagedData, setPagedData] = useState<Paginated<GetUser>>({
|
||||
page: 1,
|
||||
|
||||
@ -26,7 +26,7 @@ import TasksTab from "./components/TasksTab";
|
||||
const WorkflowTemplateDetails: React.FC<{ editMode: boolean }> = ({
|
||||
editMode,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const { userId } = useParams<{ userId: string }>();
|
||||
const [activeTab, setActiveTab] = React.useState("general");
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ import workflowTemplatesService, {
|
||||
import WorkflowTemplateManagerTable from "./components/WorkflowTemplateTable";
|
||||
|
||||
const WotkflowTemplateManager: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [pagedData, setPagedData] = useState<Paginated<ReadWorkflowTemplate>>({
|
||||
page: 1,
|
||||
|
||||
@ -2,6 +2,8 @@ import React from "react";
|
||||
import templateVersionsService, {
|
||||
TaskMetadata,
|
||||
} from "../services/WorkflowTemplateService";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Namespaces } from "../../../../i18n/i18n";
|
||||
|
||||
interface AddTaskButtonProps {
|
||||
taskType: string;
|
||||
@ -13,6 +15,9 @@ const AddTaskButton: React.FC<AddTaskButtonProps> = ({ taskType, onAdd }) => {
|
||||
const [items, setItems] = React.useState<TaskMetadata[]>([]);
|
||||
const [loading, setLoading] = React.useState(false);
|
||||
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const { t: tTaskType } = useTranslation(Namespaces.TaskTypes);
|
||||
|
||||
const toggle = async () => {
|
||||
const next = !open;
|
||||
setOpen(next);
|
||||
@ -32,12 +37,12 @@ const AddTaskButton: React.FC<AddTaskButtonProps> = ({ taskType, onAdd }) => {
|
||||
return (
|
||||
<div className="add-task-button">
|
||||
<button className="btn btn-secondary" type="button" onClick={toggle}>
|
||||
Add Task
|
||||
{t("AddTask")}
|
||||
</button>
|
||||
|
||||
{open && (
|
||||
<div className="dropdown-menu show">
|
||||
{loading && <div className="dropdown-item">Loading…</div>}
|
||||
{loading && <div className="dropdown-item">{t("Loading")}</div>}
|
||||
|
||||
{!loading &&
|
||||
items.map((item) => (
|
||||
@ -49,7 +54,7 @@ const AddTaskButton: React.FC<AddTaskButtonProps> = ({ taskType, onAdd }) => {
|
||||
setOpen(false);
|
||||
}}
|
||||
>
|
||||
{item.displayName}
|
||||
{tTaskType(item.displayName)}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@ -24,7 +24,7 @@ const GeneralTab: React.FC<GeneralTabProps> = ({
|
||||
onFieldChange,
|
||||
handleDomainPickerChange,
|
||||
}) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
@ -11,7 +11,7 @@ import { ReadWorkflowTemplate } from "../services/WorkflowTemplateService";
|
||||
const WorkflowTemplateManagerTable: React.FC<
|
||||
PublishedTableProps<ReadWorkflowTemplate>
|
||||
> = ({ data, sortColumn, onChangePage, onSearch, onDelete, onSort }) => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
const canViewSite = authentication.hasAccess("ViewSite");
|
||||
|
||||
const columns: Column<ReadWorkflowTemplate>[] = useMemo(
|
||||
|
||||
@ -17,7 +17,7 @@ import {
|
||||
} from "../../../components/common/formHelpers";
|
||||
|
||||
const InternalProfile: React.FC = () => {
|
||||
const { t } = useTranslation<typeof Namespaces.Common>();
|
||||
const { t } = useTranslation(Namespaces.Common);
|
||||
//Internal login version
|
||||
const labelFirstName = t("FirstName");
|
||||
const labelMiddleNames = t("MiddleNames");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user