Skip to content

Commit

Permalink
Merge pull request #53 from thefrontside/pc/top-parameters
Browse files Browse the repository at this point in the history
add top level parameters
  • Loading branch information
RichardW98 committed Mar 17, 2023
2 parents 73a3022 + 6ddfdd8 commit c004df3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
2 changes: 1 addition & 1 deletion plugins/parodos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@parodos/plugin-parodos",
"version": "0.1.0",
"version": "0.2.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand Down
29 changes: 16 additions & 13 deletions plugins/parodos/src/components/ParodosPage/TabLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef, type ReactNode } from 'react';
import React, { type ReactNode } from 'react';
import { makeStyles } from '@material-ui/core';
import StarIcon from '@material-ui/icons/Star';

Expand All @@ -17,16 +17,19 @@ export interface TabLabelProps {
children: ReactNode;
}

export const TabLabel = forwardRef<HTMLSpanElement, TabLabelProps>(
({ children, icon, highlighted, ...props }, ref) => {
const styles = useStyles();
export function TabLabel({
children,
icon,
highlighted,
...props
}: TabLabelProps) {
const styles = useStyles();

return (
<span {...props} ref={ref}>
{icon}
{highlighted && <StarIcon className={styles.highlightedTab} />}
{children}
</span>
);
},
);
return (
<span {...props}>
{icon}
{highlighted && <StarIcon className={styles.highlightedTab} />}
{children}
</span>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,14 @@ function buildWorksTree(

if (childWorks.length > 0) {
for (const nextChildWork of childWorks) {
const nextSchema = get(schema, nextSchemaKey);
const nextUiSchema = get(uiSchema, nextUiSchemaKey);
const nextTitle = get(schema, `${nextSchemaKey}.title`);

buildWorksTree(nextChildWork, {
schema: get(schema, nextSchemaKey),
uiSchema: get(uiSchema, nextUiSchemaKey),
title: get(schema, `${nextSchemaKey}.title`),
schema: nextSchema,
uiSchema: nextUiSchema,
title: nextTitle,
});
}
}
Expand Down Expand Up @@ -198,6 +202,17 @@ export function jsonSchemaFromWorkflowDefinition(
steps: [],
};

const parameters = workflowDefinition.parameters ?? [];

if (parameters.length > 0) {
const step = transformWorkToStep({
name: workflowDefinition.name,
parameters: [...parameters],
} as WorkType);

result.steps.push(step);
}

for (const work of workflowDefinition.works) {
const step = transformWorkToStep(work);

Expand Down

0 comments on commit c004df3

Please sign in to comment.