This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
authentik/web/src/pages/flows/utils.ts
2022-05-16 01:10:23 +02:00

38 lines
1.2 KiB
TypeScript

import { t } from "@lingui/macro";
import { FlowDesignationEnum, LayoutEnum } from "@goauthentik/api";
export function DesignationToLabel(designation: FlowDesignationEnum): string {
switch (designation) {
case FlowDesignationEnum.Authentication:
return t`Authentication`;
case FlowDesignationEnum.Authorization:
return t`Authorization`;
case FlowDesignationEnum.Enrollment:
return t`Enrollment`;
case FlowDesignationEnum.Invalidation:
return t`Invalidation`;
case FlowDesignationEnum.Recovery:
return t`Recovery`;
case FlowDesignationEnum.StageConfiguration:
return t`Stage Configuration`;
case FlowDesignationEnum.Unenrollment:
return t`Unenrollment`;
}
}
export function LayoutToLabel(layout: LayoutEnum): string {
switch (layout) {
case LayoutEnum.Stacked:
return t`Stacked`;
case LayoutEnum.ContentLeft:
return t`Content left`;
case LayoutEnum.ContentRight:
return t`Content right`;
case LayoutEnum.SidebarLeft:
return t`Sidebar left`;
case LayoutEnum.SidebarRight:
return t`Sidebar right`;
}
}