More renaming element to property

This commit is contained in:
Eric Allam
2023-06-09 11:08:21 +01:00
parent f430bcf54a
commit bf0da9ccff
7 changed files with 23 additions and 23 deletions
@@ -165,10 +165,10 @@ export class ProjectPresenter {
}
if (alias.version.properties) {
const versionElements = z
const versionProperties = z
.array(DisplayPropertySchema)
.parse(alias.version.properties);
properties = [...properties, ...versionElements];
properties = [...properties, ...versionProperties];
}
return {
@@ -70,17 +70,17 @@ export class RunPresenter {
}
//merge the properties from the version and the run, with the run properties taking precedence
const mergedElements = new Map<string, DisplayProperty>();
const mergedProperties = new Map<string, DisplayProperty>();
if (run.version.properties) {
const properties = DisplayPropertiesSchema.parse(run.version.properties);
for (const property of properties) {
mergedElements.set(property.label, property);
mergedProperties.set(property.label, property);
}
}
if (run.properties) {
const properties = DisplayPropertiesSchema.parse(run.properties);
for (const property of properties) {
mergedElements.set(property.label, property);
mergedProperties.set(property.label, property);
}
}
@@ -130,7 +130,7 @@ export class RunPresenter {
isTest: run.isTest,
version: run.version.version,
output: runOutput,
properties: Array.from(mergedElements.values()),
properties: Array.from(mergedProperties.values()),
environment: {
type: run.environment.type,
slug: run.environment.slug,
@@ -10,7 +10,7 @@ import {
RunPanelBody,
RunPanelProperties,
RunPanelHeader,
RunPanelIconElement,
RunPanelIconProperty,
RunPanelIconSection,
} from "../_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.runs.$runParam/RunCard";
import { EventDetailsPresenter } from "~/presenters/EventDetailsPresenter.server";
@@ -54,19 +54,19 @@ export default function Page() {
<RunPanelBody>
<div className="mb-4 border-b border-slate-800 pb-4">
<RunPanelIconSection>
<RunPanelIconElement
<RunPanelIconProperty
icon="calendar"
label="Created"
value={formatDateTime(timestamp, "long")}
/>
{deliveredAt && (
<RunPanelIconElement
<RunPanelIconProperty
icon="flag"
label="Finished at"
value={formatDateTime(deliveredAt, "long")}
/>
)}
<RunPanelIconElement icon="id" label="Event name" value={name} />
<RunPanelIconProperty icon="id" label="Event name" value={name} />
</RunPanelIconSection>
</div>
<div className="mt-4 flex flex-col gap-2">
@@ -14,7 +14,7 @@ import {
RunPanelDescription,
RunPanelProperties,
RunPanelHeader,
RunPanelIconElement,
RunPanelIconProperty,
RunPanelIconSection,
RunPanelIconTitle,
} from "../_app.orgs.$organizationSlug.projects.$projectParam.jobs.$jobParam.runs.$runParam/RunCard";
@@ -84,21 +84,21 @@ export default function Page() {
<div className="mb-4 border-b border-slate-800 pb-4">
<RunPanelIconSection>
{startedAt && (
<RunPanelIconElement
<RunPanelIconProperty
icon="calendar"
label="Started at"
value={formatDateTime(startedAt, "long")}
/>
)}
{completedAt && (
<RunPanelIconElement
<RunPanelIconProperty
icon="flag"
label="Finished at"
value={formatDateTime(completedAt, "long")}
/>
)}
{delayUntil && (
<RunPanelIconElement
<RunPanelIconProperty
icon="clock"
label="Total delay"
value={formatDuration(startedAt, completedAt, {
@@ -162,7 +162,7 @@ export function RunPanelIconSection({
);
}
export function RunPanelIconElement({
export function RunPanelIconProperty({
icon,
label,
value,
@@ -9,7 +9,7 @@ import {
RunPanelProperties,
RunPanelError,
RunPanelHeader,
RunPanelIconElement,
RunPanelIconProperty,
RunPanelIconSection,
RunPanelIconTitle,
TaskSeparator,
@@ -97,14 +97,14 @@ export function TaskCard({
)}
<RunPanelIconSection>
{displayKey && (
<RunPanelIconElement
<RunPanelIconProperty
icon="key"
label="Key"
value={displayKey}
/>
)}
{connection && (
<RunPanelIconElement
<RunPanelIconProperty
icon={connection.apiConnection.client.integrationIdentifier}
label="Connection"
value={connection.apiConnection.client.title}
@@ -42,7 +42,7 @@ import {
RunPanelProperties,
RunPanelError,
RunPanelHeader,
RunPanelIconElement,
RunPanelIconProperty,
RunPanelIconSection,
RunPanelIconTitle,
} from "./RunCard";
@@ -225,7 +225,7 @@ export default function Page() {
<RunPanelBody>
{/* <RunPanelIconSection>
{connection && (
<RunPanelIconElement
<RunPanelIconProperty
icon={
connection.apiConnection.client.integrationIdentifier
}
@@ -275,21 +275,21 @@ export default function Page() {
<RunPanelBody>
<RunPanelIconSection className="mb-4">
{run.startedAt && (
<RunPanelIconElement
<RunPanelIconProperty
icon="calendar"
label="Started at"
value={formatDateTime(run.startedAt, "long")}
/>
)}
{run.completedAt && (
<RunPanelIconElement
<RunPanelIconProperty
icon="flag"
label="Finished at"
value={formatDateTime(run.completedAt, "long")}
/>
)}
{run.startedAt && run.completedAt && (
<RunPanelIconElement
<RunPanelIconProperty
icon="clock"
label="Total duration"
value={formatDuration(