+interface AuthStateDataProps {
+ auth: AuthState;
+};
+
+export interface RegisteredWorkflowPanelDataProps {
+ item: WorkflowResource;
+ workflowCollection: string;
+ inputParams: ProcessIOParameter[];
+ outputParams: ProcessIOParameter[];
+ gitprops: { [key: string]: string; };
+};
+
+export const getRegisteredWorkflowPanelData = (item: WorkflowResource, auth: AuthState): RegisteredWorkflowPanelDataProps => {
+ let inputParams: ProcessIOParameter[] = [];
+ let outputParams: ProcessIOParameter[] = [];
+ let workflowCollection = "";
+ const gitprops: { [key: string]: string; } = {};
+
+ // parse definition
+ const wfdef = parseWorkflowDefinition(item);
+
+ const inputs = getWorkflowInputs(wfdef);
+ if (inputs) {
+ inputs.forEach(elm => {
+ if (elm.default !== undefined && elm.default !== null) {
+ elm.value = elm.default;
+ }
+ });
+ inputParams = formatInputData(inputs, auth);
+ }
+
+ const outputs = getWorkflowOutputs(wfdef);
+ if (outputs) {
+ outputParams = formatOutputData(outputs, {}, undefined, auth);
+ }
+
+ const wf = getWorkflow(wfdef);
+ if (wf) {
+ const REGEX = /keep:([0-9a-f]{32}\+\d+)\/.*/;
+ if (wf["steps"]) {
+ workflowCollection = wf["steps"][0].run.match(REGEX)[1];
+ }
+ }
+
+ for (const elm in wfdef) {
+ if (elm.startsWith("http://arvados.org/cwl#git")) {
+ gitprops[elm.substr(23)] = wfdef[elm]
+ }
+ }
+
+ return { item, workflowCollection, inputParams, outputParams, gitprops };
+};
+
+const mapStateToProps = (state: RootState): AuthStateDataProps => {
+ return { auth: state.auth };
+};
+
+export const WorkflowDetailsAttributes = connect(mapStateToProps, mapDispatchToProps)(