X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/019459c71713b979cb4cc34ec3a91a947d2c235a..547ea9aed5331a2d7a9ffd64807c48294721a686:/src/services/workflow-service/workflow-service.ts diff --git a/src/services/workflow-service/workflow-service.ts b/src/services/workflow-service/workflow-service.ts index 57ad5fa40f..de9a1186e3 100644 --- a/src/services/workflow-service/workflow-service.ts +++ b/src/services/workflow-service/workflow-service.ts @@ -6,9 +6,44 @@ import { AxiosInstance } from "axios"; import { CommonResourceService } from "~/services/common-service/common-resource-service"; import { WorkflowResource } from '~/models/workflow'; import { ApiActions } from '~/services/api/api-actions'; +import { LinkService } from '~/services/link-service/link-service'; +import { FilterBuilder } from '~/services/api/filter-builder'; +import { LinkClass } from '~/models/link'; +import { OrderBuilder } from '~/services/api/order-builder'; export class WorkflowService extends CommonResourceService { + + private linksService = new LinkService(this.serverApi, this.actions); + constructor(serverApi: AxiosInstance, actions: ApiActions) { super(serverApi, "workflows", actions); } + + async presets(workflowUuid: string) { + + const { items: presetLinks } = await this.linksService.list({ + + filters: new FilterBuilder() + .addEqual('tailUuid', workflowUuid) + .addEqual('linkClass', LinkClass.PRESET) + .getFilters() + + }); + + const presetUuids = presetLinks.map(link => link.headUuid); + + return this.list({ + + filters: new FilterBuilder() + .addIn('uuid', presetUuids) + .getFilters(), + + order: new OrderBuilder() + .addAsc('name') + .getOrder(), + + }); + + } + }