Skip to content

Commit

Permalink
updated action table and detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
remko48 committed Feb 16, 2024
1 parent 0fe31a9 commit f35e41f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pwa/src/templates/actionsTemplate/ActionsTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const ActionsTemplate: React.FC = () => {

<TableCell>{action.lastRun ? dateTime(t(i18n.language), action.lastRun) : "-"}</TableCell>

<TableCell>{`${action.lastRunTime}ms` ?? "-"}</TableCell>
<TableCell>{`${action.lastRunTime}s` ?? "-"}</TableCell>

<TableCell>{translateDate(i18n.language, action.dateCreated) ?? "-"}</TableCell>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
padding-block-end: var(--gateway-ui-size-md);
}

.gridContainer > *:not(:first-child) {
margin-block-start: var(--gateway-ui-size-sm);
}

.grid {
display: grid;
grid-gap: var(--gateway-ui-size-lg);
Expand Down
47 changes: 45 additions & 2 deletions pwa/src/templates/templateParts/actionsForm/ActionFormTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import { SchemaFormTemplate } from "../schemaForm/SchemaFormTemplate";
import { useIsLoadingContext } from "../../../context/isLoading";
import { enrichValidation } from "../../../services/enrichReactHookFormValidation";
import { CodeEditor } from "../../../components/codeEditor/CodeEditor";
import { translateDate } from "../../../services/dateFormat";
import { StatusTag } from "../../../components/statusTag/StatusTag";
import { formatDateTime } from "../../../services/dateTime";

export const formId: string = "action-form";

Expand All @@ -23,7 +26,7 @@ interface ActionFormTemplateProps {
}

export const ActionFormTemplate: React.FC<ActionFormTemplateProps> = ({ action }) => {
const { t } = useTranslation();
const { t, i18n } = useTranslation();
const { setIsLoading, isLoading } = useIsLoadingContext();

const [listensAndThrows, setListensAndThrows] = React.useState<any[]>([]);
Expand Down Expand Up @@ -149,7 +152,7 @@ export const ActionFormTemplate: React.FC<ActionFormTemplateProps> = ({ action }
</Tabs>

<TabPanel className={styles.tabPanel} value="0">
<div className={styles.gridContainer}>
<div>
<div className={styles.grid}>
<FormField>
<FormFieldInput>
Expand Down Expand Up @@ -272,6 +275,46 @@ export const ActionFormTemplate: React.FC<ActionFormTemplateProps> = ({ action }
</FormFieldInput>
</FormField>
</div>
<Divider />
<div className={styles.grid}>
<FormField>
<FormFieldInput>
<FormFieldLabel>{t("Date Created")}</FormFieldLabel>
<div>{translateDate(i18n.language, action.dateCreated) ?? "-"}</div>
</FormFieldInput>
</FormField>

<FormField>
<FormFieldInput>
<FormFieldLabel>{t("Date Modified")}</FormFieldLabel>
<div>{translateDate(i18n.language, action.dateModified) ?? "-"}</div>
</FormFieldInput>
</FormField>

<FormField>
<FormFieldInput>
<FormFieldLabel>{t("Last run")}</FormFieldLabel>
<div> {action.lastRun ? formatDateTime(t(i18n.language), action.lastRun) : "-"}</div>
</FormFieldInput>
</FormField>

<FormField>
<FormFieldInput>
<FormFieldLabel>{t("Last run time")}</FormFieldLabel>
<div>{`${action.lastRunTime}s` ?? "-"}</div>
</FormFieldInput>
</FormField>

<FormField>
<FormFieldInput>
<FormFieldLabel>{t("Status")}</FormFieldLabel>
<StatusTag
type={action.status ? "success" : "default"}
label={action.status ? "Success" : "No status"}
/>
</FormFieldInput>
</FormField>
</div>
</div>
</TabPanel>

Expand Down

0 comments on commit f35e41f

Please sign in to comment.