Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMP-3303 #555

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading