Skip to content

Commit

Permalink
Merge pull request #555 from AudiovisualMetadataPlatform/AMP-3303_del…
Browse files Browse the repository at this point in the history
…eteWF

AMP-3303
  • Loading branch information
yingfeng-iu authored Dec 19, 2024
2 parents 9fc28d6 + 6c1ef4b commit 29a66f8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/unused/WorkflowFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default {
computed: {
workflowDashboard: sync("workflowDashboard"),
workflows: sync("workflowDashboard.searchResult.filters.workflows"),
getWorkflows() {
getPublishedWorkflows() {
if (!this.workflows) return [];
return this.workflows;
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/unused/WorkflowSelection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export default {
parameters: sync("parameters"),
},
methods: {
async getWorkflows() {
async getPublishedWorkflows() {
let self = this;
this.workflowService.getWorkflows().then((response) => {
this.workflowService.getPublishedWorkflows().then((response) => {
self.workflows = response.data;
});
},
Expand All @@ -51,7 +51,7 @@ export default {
},
mounted() {
let self = this;
self.getWorkflows();
self.getPublishedWorkflows();
},
};
</script>
Expand Down
6 changes: 3 additions & 3 deletions src/components/workflow/SelectWorkflow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,9 @@ export default {
}
}
},
async getWorkflows() {
async getPublishedWorkflows() {
let self = this;
this.workflowService.getWorkflows().then((response) => {
this.workflowService.getPublishedWorkflows().then((response) => {
let workflowResponse = response.data;
self.workflows = self.sharedService.sortByAlphabatical(
workflowResponse.rows
Expand Down Expand Up @@ -898,7 +898,7 @@ export default {
},
mounted() {
let self = this;
self.getWorkflows();
self.getPublishedWorkflows();
},
beforeDestroy() {
const self = this;
Expand Down
4 changes: 2 additions & 2 deletions src/components/workflow/WorkflowList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ export default {
const annotations = searchFields.annotations;
const tags = searchFields.tags;
self.workflowService
.getFilteredWorkflows(name, creator, dateRange, annotations, tags)
.getActiveFilteredWorkflows(name, creator, dateRange, annotations, tags)
.then((response) => {
self.listOfWorkflows = self.sharedService.sortByAlphabatical(
response.data.rows
Expand All @@ -281,7 +281,7 @@ export default {
getWorkflowList() {
const self = this;
self.workflowService
.getAllWorkflows()
.getActiveWorkflows()
.then((response) => {
self.listOfWorkflows = self.sharedService.sortByAlphabatical(
response.data.rows
Expand Down
15 changes: 12 additions & 3 deletions src/service/workflow-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,27 @@ export default class WorkflowService extends BaseService {
tempName = tempName.replace(/(^\w)|(\s+\w)/g, match => match.toUpperCase());
return tempName;
}
getWorkflows() {

getPublishedWorkflows() {
return super.get_auth('/workflows?showPublished=true');
}

getAllWorkflows() {
getActiveWorkflows() {
return super.get_auth('/workflows');
}

getFilteredWorkflows(name, creator, dateRange, annotations, tags) {
getInactiveWorkflows() {
return super.get_auth('/workflows?showHidden=true');
}

getActiveFilteredWorkflows(name, creator, dateRange, annotations, tags) {
return super.get_auth(`/workflows?name=${name}&creator=${creator}&dateRange=${dateRange}&annotations=${annotations}&tags=${tags}`);
}

getInactiveFilteredWorkflows(name, creator, dateRange, annotations, tags) {
return super.get_auth(`/workflows?showHidden=true&name=${name}&creator=${creator}&dateRange=${dateRange}&annotations=${annotations}&tags=${tags}`);
}

async getWorkflowDetails(id) {
var tempParams = [];
return await super.get_auth('/workflows/' + id).then(response => {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/components/workflows/workflowList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jest.mock('../../../../src/service/workflow-service',
return Promise.resolve({data: [{id:1, name: "TestName1", visible: true}, {id:2, name: "TestName2", visible: true}]});

},
getAllWorkflows: ()=>{
getActiveWorkflows: ()=>{
return Promise.resolve({data: { rows:[{id:1, name: "TestName1", visible: true, annotations: ['test']}, {id:2, name: "TestName2", visible: true, annotations: ['test']}] }});

},
Expand Down

0 comments on commit 29a66f8

Please sign in to comment.