Skip to content

Commit

Permalink
Merge pull request #9812 from archesproject/afs_9811_branch_excel_tem…
Browse files Browse the repository at this point in the history
…plates

Filter branches from branch excel templates
  • Loading branch information
njkim authored Jul 27, 2023
2 parents 8661345 + ce120f9 commit b5c2f70
Showing 1 changed file with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,20 @@ define([

this.moduleId = params.etlmoduleid;
ImporterViewModel.apply(this, arguments);
this.templates = ko.observableArray();
this.selectedTemplate = ko.observable();
this.loadStatus = ko.observable('ready');
this.downloadMode = ko.observable(false);

this.selectedLoadEvent = params.selectedLoadEvent || ko.observable();
this.validationErrors = params.validationErrors || ko.observable();
this.validated = params.validated || ko.observable();
this.getErrorReport = params.getErrorReport;
this.getNodeError = params.getNodeError;
this.templates = ko.observableArray(
arches.resources.map(resource => ({text: resource.name, id: resource.graphid}))
);

this.toggleDownloadMode = () => {
this.downloadMode(!this.downloadMode());
if (this.downloadMode() && !ko.unwrap(this.templates).length) {
getGraphs();
}
};

function getCookie(name) {
Expand Down Expand Up @@ -86,17 +84,6 @@ define([
this.loading(false);
};

const getGraphs = async function() {
const response = await fetch(arches.urls.graphs_api);
if (response.ok) {
let graphs = await response.json();
let templates = graphs.map(function(graph){
return {text: graph.name, id: graph.graphid};
});
self.templates(templates);
}
};

this.addFile = async function(file){
self.loading(true);
self.fileInfo({name: file.name, size: file.size});
Expand Down

0 comments on commit b5c2f70

Please sign in to comment.