From 231ce24d23e772910516223f6cd609de09a5c15d Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Tue, 15 Dec 2020 14:38:01 +0100
Subject: [PATCH] Remove unused second backup
---
web/app/static/js/nopaque.lists.new.js | 127 -------------------------
1 file changed, 127 deletions(-)
delete mode 100644 web/app/static/js/nopaque.lists.new.js
diff --git a/web/app/static/js/nopaque.lists.new.js b/web/app/static/js/nopaque.lists.new.js
deleted file mode 100644
index 8e6ddfce..00000000
--- a/web/app/static/js/nopaque.lists.new.js
+++ /dev/null
@@ -1,127 +0,0 @@
-class RessourceList {
- constructor(idOrElement, options = {}) {
- this.list = new List(idOrElement, {...RessourceList.options, ...options});
- }
-
- init(ressources) {
- this.list.clear();
- this.add(Object.values(ressources));
- this.list.sort('id', {order: 'desc'});
- }
-
-
- update(patch) {
- let item, pathArray;
-
- for (let operation of patch) {
- /*
- * '/{ressourceName}/{ressourceId}/{valueName}' -> ['{ressourceId}', {valueName}]
- * Example: '/jobs/1/status' -> ['1', 'status']
- */
- let [id, valueName] = operation.path.split("/").slice(2);
- switch(operation.op) {
- case 'add':
- this.add(operation.value);
- break;
- case 'remove':
- this.remove(id);
- break;
- case 'replace':
- this.replace(id, valueName, operation.value);
- break;
- default:
- break;
- }
- }
- }
-
- add(values) {
- /* WORKAROUND: Set a callback function ('() => {return;}') to force List.js
- perform the add method asynchronous.
- * https://listjs.com/api/#add
- */
- this.list.add(values, () => {return;});
- }
-
- remove(id) {
- this.list.remove('id', id);
- }
-
- replace(id, valueName, newValue) {
- if (!this.list.valuesNames.includes(valueName)) {return;}
- let item = this.list.get('id', id);
- item.values({[valueName]: newValue});
- }
-}
-
-
-RessourceList.options = {page: 5, pagination: [{innerWindow: 4, outerWindow: 1}]};
-
-
-class CorpusList extends RessourceList {
- constructor(idOrElement, options = {}) {
- super(idOrElement, {...CorpusList.options, ...options});
- nopaque.corporaSubscribers.push(this);
- }
-}
-
-
-CorpusList.options = {
- item: `
- book |
-
|
- |
-
- delete
- edit
- search
- |
-
`,
- valueNames: [{data: ['id']}, 'description', 'status', 'title']
-};
-
-
-class JobList extends RessourceList {
- constructor(idOrElement, options = {}) {
- super(idOrElement, {...JobList.options, ...options});
- nopaque.jobsSubscribers.push(this);
- }
-}
-
-
-JobList.options = {
- item: `
- |
-
|
- |
-
- delete
- send
- |
-
`,
- valueNames: [{data: ['id']}, {name: 'service', attr: 'data-service'}, 'description', 'status', 'title']
-};
-
-
-class QueryResultList extends RessourceList {
- constructor(idOrElement, options = {}) {
- super(idOrElement, {...QueryResultList.options, ...options});
- nopaque.queryResultsSubscribers.push(this);
- }
-}
-
-
-QueryResultList.options = {
- item: `
-
|
-
|
-
- delete
- send
- search
- |
-
`,
- valueNames: [{data: ['id']}, 'corpus_title', 'description', 'query', 'title']
-};
-
-export { CorpusList, JobList, QueryResultList };