From f9506b1440d6ea574dce667d5b3919691e0b96b1 Mon Sep 17 00:00:00 2001 From: Sergey Motornyuk Date: Tue, 12 Mar 2024 03:25:51 +0200 Subject: [PATCH] chore: py2 fixes of select statements --- ckanext/files/assets/resource.config | 11 ++++++++++ .../files--google-cloud-storage-uploader.js | 2 +- ckanext/files/assets/scripts/files--queue.js | 10 ++++----- ckanext/files/assets/scripts/files--shared.js | 16 ++++++++++++-- ckanext/files/assets/ts/files--queue.ts | 8 +++---- ckanext/files/assets/ts/files--shared.ts | 14 ++++++++++++- ckanext/files/logic/action.py | 13 ++++++------ ckanext/files/logic/auth.py | 7 +++++-- ckanext/files/model/owner.py | 8 ++++--- .../templates/files/snippets/_resource.html | 4 +--- .../templates/files/snippets/file_table.html | 4 ++-- .../templates/files/snippets/uploader.html | 21 ++++++++++++------- ckanext/files/views.py | 4 ++-- 13 files changed, 84 insertions(+), 38 deletions(-) create mode 100644 ckanext/files/assets/resource.config diff --git a/ckanext/files/assets/resource.config b/ckanext/files/assets/resource.config new file mode 100644 index 0000000..f251d64 --- /dev/null +++ b/ckanext/files/assets/resource.config @@ -0,0 +1,11 @@ +[depends] + +files = base/main + +[groups] + +files = + scripts/files--shared.js + scripts/files--queue.js + scripts/files--google-cloud-storage-uploader.js + styles/files--style.css diff --git a/ckanext/files/assets/scripts/files--google-cloud-storage-uploader.js b/ckanext/files/assets/scripts/files--google-cloud-storage-uploader.js index 724aedf..13f7b58 100644 --- a/ckanext/files/assets/scripts/files--google-cloud-storage-uploader.js +++ b/ckanext/files/assets/scripts/files--google-cloud-storage-uploader.js @@ -49,4 +49,4 @@ var ckan; })(adapters = CKANEXT_FILES.adapters || (CKANEXT_FILES.adapters = {})); })(CKANEXT_FILES = ckan.CKANEXT_FILES || (ckan.CKANEXT_FILES = {})); })(ckan || (ckan = {})); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZXMtLWdvb2dsZS1jbG91ZC1zdG9yYWdlLXV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Skge1xuICAgICAgICAgICAgdXBsb2FkZWQgPSBpbmZvLnN0b3JhZ2VfZGF0YS5zaXplO1xuICAgICAgICAgIH0gZWxzZSBpZiAocmVzcC5zdGF0dXMgPT09IDMwOCkge1xuICAgICAgICAgICAgY29uc3QgcmFuZ2UgPSByZXNwLmdldFJlc3BvbnNlSGVhZGVyKFwicmFuZ2VcIik7XG4gICAgICAgICAgICB1cGxvYWRlZCA9IE51bWJlcihyYW5nZS5zcGxpdChcIj1cIilbMV0uc3BsaXQoXCItXCIpWzFdKSArIDE7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihhd2FpdCByZXNwLnJlc3BvbnNlVGV4dCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKCFOdW1iZXIuaXNJbnRlZ2VyKHVwbG9hZGVkKSkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBJbnZhbGlkIHVwbG9hZGVkIHNpemUgJHt1cGxvYWRlZH1gKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKGRvbmUsIGZhaWwpID0+IHtcbiAgICAgICAgICAgIHRoaXMuc2FuZGJveC5jbGllbnQuY2FsbChcbiAgICAgICAgICAgICAgXCJQT1NUXCIsXG4gICAgICAgICAgICAgIFwiZmlsZXNfdXBsb2FkX3VwZGF0ZVwiLFxuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgaWQ6IGluZm8uaWQsXG4gICAgICAgICAgICAgICAgdXBsb2FkZWQsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChkYXRhOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICBkb25lKGRhdGEucmVzdWx0KTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgKHJlc3A6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgIGZhaWwoXG4gICAgICAgICAgICAgICAgICB0eXBlb2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VfZGF0YS5zaXplfWAsXG4gICAgICAgICAgKTtcbiAgICAgICAgICByZXF1ZXN0LnNlbmQocGFydCk7XG5cbiAgICAgICAgICBjb25zdCByZXNwOiBhbnkgPSBhd2FpdCBuZXcgUHJvbWlzZSgoZG9uZSwgZmFpbCkgPT4ge1xuICAgICAgICAgICAgcmVxdWVzdC5hZGRFdmVudExpc3RlbmVyKFwibG9hZFwiLCAoZXZlbnQpID0+IGRvbmUocmVxdWVzdCkpO1xuICAgICAgICAgIH0pO1xuICAgICAgICAgIGxldCB1cGxvYWRlZDtcblxuICAgICAgICAgIGlmIChbMjAwLCAyMDFdLmluY2x1ZGVzKHJlc3Auc3RhdHVzKSkge1xuICAgICAgICAgICAgdXBsb2FkZWQgPSBpbmZvLnN0b3JhZ2VfZGF0YS5zaXplO1xuICAgICAgICAgIH0gZWxzZSBpZiAocmVzcC5zdGF0dXMgPT09IDMwOCkge1xuICAgICAgICAgICAgY29uc3QgcmFuZ2UgPSByZXNwLmdldFJlc3BvbnNlSGVhZGVyKFwicmFuZ2VcIik7XG4gICAgICAgICAgICB1cGxvYWRlZCA9IE51bWJlcihyYW5nZS5zcGxpdChcIj1cIilbMV0uc3BsaXQoXCItXCIpWzFdKSArIDE7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihhd2FpdCByZXNwLnJlc3BvbnNlVGV4dCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKCFOdW1iZXIuaXNJbnRlZ2VyKHVwbG9hZGVkKSkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBJbnZhbGlkIHVwbG9hZGVkIHNpemUgJHt1cGxvYWRlZH1gKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKGRvbmUsIGZhaWwpID0+IHtcbiAgICAgICAgICAgIHRoaXMuc2FuZGJveC5jbGllbnQuY2FsbChcbiAgICAgICAgICAgICAgXCJQT1NUXCIsXG4gICAgICAgICAgICAgIFwiZmlsZXNfdXBsb2FkX3VwZGF0ZVwiLFxuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgaWQ6IGluZm8uaWQsXG4gICAgICAgICAgICAgICAgdXBsb2FkZWQsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChkYXRhOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICBkb25lKGRhdGEucmVzdWx0KTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgKHJlc3A6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgIGZhaWwoXG4gICAgICAgICAgICAgICAgICB0eXBlb2YgcmVzcC5yZXNwb25zZUpTT04gPT09IFwic3RyaW5nXCJcbiAgICAgICAgICAgICAgICAgICAgPyByZXNwLnJlc3BvbnNlVGV4dFxuICAgICAgICAgICAgICAgICAgICA6IHJlc3AucmVzcG9uc2VKU09OLmVycm9yLFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/ckanext/files/assets/scripts/files--queue.js b/ckanext/files/assets/scripts/files--queue.js index 6a99be6..98b9975 100644 --- a/ckanext/files/assets/scripts/files--queue.js +++ b/ckanext/files/assets/scripts/files--queue.js @@ -76,13 +76,13 @@ ckan.module("files--queue", function ($) { info.uploader.addEventListener("fail", ({ detail: { reasons, file }, }) => { this.sandbox.notify(file.name, Object.entries(reasons) .filter(([k, v]) => k[0] !== "_") - .map(([k, v]) => v.join("; ")) + .map(([k, v]) => (Array.isArray(v) ? v.join("; ") : v)) .join("; ")); this.toggleAnimation(widget, false); widget .find("[data-upload-progress]") .removeClass("bg-primary bg-secondary") - .addClass("bg-danger"); + .addClass("bg-danger progress-bar-danger"); }); info.uploader.addEventListener("error", ({ detail: { message, file }, }) => { this.sandbox.notify(file.name, message); @@ -90,7 +90,7 @@ ckan.module("files--queue", function ($) { widget .find("[data-upload-progress]") .removeClass("bg-primary bg-secondary") - .addClass("bg-danger"); + .addClass("bg-danger progress-bar-danger"); }); info.uploader.addEventListener("progress", ({ detail: { loaded, total } }) => this.setWidgetCompletion(widget, loaded, total)); info.uploader.addEventListener("finish", ({ detail: { file, result } }) => { @@ -98,7 +98,7 @@ ckan.module("files--queue", function ($) { widget .find("[data-upload-progress]") .removeClass("bg-primary bg-secondary") - .addClass("bg-success"); + .addClass("bg-success progress-bar-succes"); this.sandbox.publish(ckan.CKANEXT_FILES.topics.queueItemUploaded, file, result); }); this.setWidgetName(widget, info.file.name); @@ -153,4 +153,4 @@ ckan.module("files--queue", function ($) { }, }; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZXMtLXF1ZXVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvZmlsZXMtLXF1ZXVlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxJQUFJLENBQUMsTUFBTSxDQUFDLGtCQUFrQixFQUFFLFVBQVUsQ0FBQztJQUN6QyxPQUFPO1FBQ0wsVUFBVTtZQUNSLE1BQU0sU0FBUyxHQUFHLElBQUksQ0FBQyxDQUFDLENBQUMsd0JBQXdCLENBQUMsQ0FBQztZQUNuRCxTQUFTLENBQUMsRUFBRSxDQUFDLFFBQVEsRUFBRSxDQUFDLEtBQVksRUFBRSxFQUFFLENBQ3RDLElBQUksQ0FBQyxJQUFJLENBQUMsR0FBSSxLQUFLLENBQUMsTUFBMkIsQ0FBQyxLQUFNLENBQUMsQ0FDeEQsQ0FBQztRQUNKLENBQUM7UUFFRCxJQUFJLENBQUMsR0FBRyxLQUFhO1lBQ25CLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUNyQixJQUFJLENBQUMsT0FBT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lIH0sXG4gICAgICAgIH06IEN1c3RvbUV2ZW50PHtcbiAgICAgICAgICByZWFzb25zOiB7IFtrZXk6IHN0cmluZ106IHN0cmluZ1tdIH07XG4gICAgICAgICAgZmlsZTogRmlsZTtcbiAgICAgICAgfT4pID0+IHtcbiAgICAgICAgICB0aGlzLnNhbmRib3gubm90aWZ5KFxuICAgICAgICAgICAgZmlsZS5uYW1lLFxuICAgICAgICAgICAgT2JqZWN0LmVudHJpZXMocmVhc29ucylcbiAgICAgICAgICAgICAgLmZpbHRlcigoW2ssIHZdKSA9PiBrWzBdICE9PSBcIl9cIilcbiAgICAgICAgICAgICAgLm1hcCgoW2ssIHZdKSA9PiB2LmpvaW4oXCI7IFwiKSlcbiAgICAgICAgICAgICAgLmpvaW4oXCI7IFwiKSxcbiAgICAgICAgICApO1xuICAgICAgICAgIHRoaXMudG9nZ2xlQW5pbWF0aW9uKHdpZGdldCwgZmFsc2UpO1xuXG4gICAgICAgICAgd2lkZ2V0XG4gICAgICAgICAgICAuZmluZChcIltkYXRhLXVwbG9hZC1wcm9ncmVzc11cIilcbiAgICAgICAgICAgIC5yZW1vdmVDbGFzcyhcImJnLXByaW1hcnkgYmctc2Vjb25kYXJ5XCIpXG4gICAgICAgICAgICAuYWRkQ2xhc3MoXCJiZy1kYW5nZXJcIik7XG4gICAgICAgIH0sXG4gICAgICApO1xuICAgICAgaW5mby51cGxvYWRlci5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICBcImVycm9yXCIsXG4gICAgICAgICh7XG4gICAgICAgICAgZGV0YWlsOiB7IG1lc3NhZ2UsIGZpbGUgfSxcbiAgICAgICAgfTogQ3VzdG9tRXZlbnQ8eyBtZXNzYWdlOiBzdHJpbmc7IGZpbGU6IEZpbGUgfT4pID0+IHtcbiAgICAgICAgICB0aGlzLnNhbmRib3gubm90aWZ5KGZpbGUubmFtZSwgbWVzc2FnZSk7XG4gICAgICAgICAgdGhpcy50b2dnbGVBbmltYXRpb24od2lkZ2V0LCBmY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IHN0cmluZ1tdIH07XG4gICAgICAgICAgZmlsZTogRmlsZTtcbiAgICAgICAgfT4pID0+IHtcbiAgICAgICAgICB0aGlzLnNhbmRib3gubm90aWZ5KFxuICAgICAgICAgICAgZmlsZS5uYW1lLFxuICAgICAgICAgICAgT2JqZWN0LmVudHJpZXMocmVhc29ucylcbiAgICAgICAgICAgICAgLmZpbHRlcigoW2ssIHZdKSA9PiBrWzBdICE9PSBcIl9cIilcbiAgICAgICAgICAgICAgLm1hcCgoW2ssIHZdKSA9PiAoQXJyYXkuaXNBcnJheSh2KSA/IHYuam9pbihcIjsgXCIpIDogdikpXG4gICAgICAgICAgICAgIC5qb2luKFwiOyBcIiksXG4gICAgICAgICAgKTtcbiAgICAgICAgICB0aGlzLnRvZ2dsZUFuaW1hdGlvbih3aWRnZXQsIGZhbHNlKTtcblxuICAgICAgICAgIHdpZGdldFxuICAgICAgICAgICAgLmZpbmQoXCJbZGF0YS11cGxvYWQtcHJvZ3Jlc3NdXCIpXG4gICAgICAgICAgICAucmVtb3ZlQ2xhc3MoXCJiZy1wcmltYXJ5IGJnLXNlY29uZGFyeVwiKVxuICAgICAgICAgICAgLmFkZENsYXNzKFwiYmctZGFuZ2VyIHByb2dyZXNzLWJhci1kYW5nZXJcIik7XG4gICAgICAgIH0sXG4gICAgICApO1xuICAgICAgaW5mby51cGxvYWRlci5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICBcImVycm9yXCIsXG4gICAgICAgICh7XG4gICAgICAgICAgZGV0YWlsOiB7IG1lc3NhZ2UsIGZpbGUgfSxcbiAgICAgICAgfTogQ3VzdG9tRXZlbnQ8eyBtZXNzYWdlOiBzdHJpbmc7IGZpbGU6IEZpbGUgfT4pID0+IHtcbiAgICAgICAgICB0aGlzLnNhbmRib3gubm90aWZ5KGZpbGUubmFtZSwgbWVzc2FnZSk7XG4gICAgICAgICAgdGhpcy50b2dnbGVBbmltYXRpb24od2lkZ2V0LCBmYWxzZSk7XG4gICAgICAgICAgd2lk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AgICAgIC5maW5kKFwiW2RhdGEtdXBsb2FkLXByb2dyZXNzXVwiKVxuICAgICAgICAucmVtb3ZlQ2xhc3MoXCJiZy1wcmltYXJ5XCIpXG4gICAgICAgIC5hZGRDbGFzcyhcImJnLXNlY29uZGFyeVwiKTtcblxuICAgICAgaW5mby51cGxvYWRlci5wYXVzZShpbmZvLmZpbGUpO1xuICAgICAgdGhpcy50b2dnbGVBbmltYXRpb24od2lkZ2V0LCBmYWxzZSk7XG4gICAgfSxcbiAgfTtcbn0pO1xuIl19 \ No newline at end of file diff --git a/ckanext/files/assets/scripts/files--shared.js b/ckanext/files/assets/scripts/files--shared.js index d88b626..1814708 100644 --- a/ckanext/files/assets/scripts/files--shared.js +++ b/ckanext/files/assets/scripts/files--shared.js @@ -116,7 +116,19 @@ var ckan; return; } this._active.add(file); - let info = await this._initializeUpload(file); + let info; + try { + info = await this._initializeUpload(file); + } + catch (err) { + if (typeof err === "string") { + this.dispatchError(file, err); + } + else { + this.dispatchFail(file, err); + } + return; + } this.dispatchCommit(file, info.id); this.dispatchStart(file); this._doUpload(file, info); @@ -223,4 +235,4 @@ var ckan; })(adapters = CKANEXT_FILES.adapters || (CKANEXT_FILES.adapters = {})); })(CKANEXT_FILES = ckan.CKANEXT_FILES || (ckan.CKANEXT_FILES = {})); })(ckan || (ckan = {})); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZXMtLXNoYXJlZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2ZpbGVzLS1zaGFyZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLElBQVUsSUFBSSxDQW1XYjtBQW5XRCxXQUFVLElBQUk7SUFLWixJQUFpQixhQUFhLENBNlY3QjtJQTdWRCxXQUFpQixhQUFhO1FBTWYsb0JBQU0sR0FBRztZQUNwQixjQUFjLEVBQUUsOEJBQThCO1lBQzlDLGtCQUFrQixFQU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HByb3RlY3RlZCBjc3JmVG9rZW46IHN0cmluZztcblxuICAgICAgICBjb25zdHJ1Y3RvcihzZXR0aW5ncyA9IHt9KSB7XG4gICAgICAgICAgc3VwZXIoKTtcbiAgICAgICAgICB0aGlzLnNldHRpbmdzID0ge1xuICAgICAgICAgICAgLi4uZGVmYXVsdFNldHRpbmdzLFxuICAgICAgICAgICAgLi4uKHRoaXMuY29uc3RydWN0b3IgYXMgdHlwZW9mIEJhc2UpLmRlZmF1bHRTZXR0aW5ncyxcbiAgICAgICAgICAgIC4uLnNldHRpbmdzLFxuICAgICAgICAgIH07XG4gICAgICAgICAgdGhpcy5zYW5kYm94ID0gY2thbi5zYW5kYm94KCk7XG5cbiAgICAgICAgICBjb25zdCBjc3JmRmllbGQgPVxuICAgICAgICAgICAgZG9jdW1lbnRcbiAgICAgICAgICAgICAgLnF1ZXJ5U2VsZWN0b3IoXCJtZXRhW25hbWU9Y3NyZl9maWVsZF9uYW1lXVwiKVxuICAgICAgICAgICAgICA/LmdldEF0dHJpYnV0ZShcImNvbnRlbnRcIikgPz8gXCJfY3NyZl90b2tlblwiO1xuICAgICAgICAgIHRoaXMuY3NyZlRva2VuID1cbiAgICAgICAgICAgIGRvY3VtZW50XG4gICAgICAgICAgICAgIC5xdWVyeVNlbGVjdG9yKGBtZXRhW25hbWU9JHtjc3JmRmllbGR9XWApXG4gICAgICAgICAgICAgID8uZ2V0QXR0cmlidXRlKFwiY29udGVudFwiKSB8fCBcIlwiO1xuICAgICAgICB9XG5cbiAgICAgICAgdXBsb2FkKGZpbGU6IEZpbGUpIHtcbiAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJCYXNlLnVwbG9hZCBpcyBub3QgaW1wbGVtZW50ZWRcIik7XG4gICAgICAgIH1cblxuICAgICAgICByZXN1bWUoZmlsZTogRmlsZSwgaWQ6IHN0cmluZykge1xuICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkJhc2UucmVzdW1lIGlzIG5vdCBpbXBsZW1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4gICAgICAgICAgICB0aGlzLnNhbmRib3guY2xpZW50LmNhbGwoXG4gICAgICAgICAgICAgIFwiUE9TVFwiLFxuICAgICAgICAgICAgICBcImZpbGVzX3VwbG9hZF9pbml0aWFsaXplXCIsXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzdG9yYWdlOiB0aGlzLnNldHRpbmdzLnN0b3JhZ2UsXG4gICAgICAgICAgICAgICAgbmFtZTogZmlsZS5uYW1lLFxuICAgICAgICAgICAgICAgIHNpemU6IGZpbGUuc2l6ZSxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgKGRhdGE6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgIGRvbmUoZGF0YS5yZXN1bHQpO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAocmVzcDogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgZmFpbChcbiAgICAgICAgICAgICAgICAgIHR5cGVvZiByZXNwLnJlc3BvbnNlSlNPTiA9PT0gXCJzdHJpbmdcIlxuICAgICAgICAgICAgICAgICAgICA/IHJlc3AucmVzcG9uc2VUZXh0XG4gICAgICAgICAgICAgICAgICAgIDogcmVzcC5yZXNwb25zZUpTT04uZXJyb3IsXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICksXG4gICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgICAgICBfc2hvd1VwbG9hZChpZDogc3RyaW5nKTogUHJvbWlzZTxVcGxvYWRJbmZvPiB7XG4gICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChkb25lLCBmYWlsKSA9PlxuICAgICAgICAgICAgdGhpcy5zYW5kYm94LmNsaWVudC5jYWxsKFxuICAgICAgICAgICAgICBcIkdFVFwiLFxuICAgICAgICAgICAgICBcImZpbGVzX3VwbG9hZF9zaG93XCIsXG4gICAgICAgICAgICAgIGA/aWQ9JHtpZH1gLFxuICAgICAgICAgICAgICAoZGF0YTogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgZG9uZShkYXRhLnJlc3VsdCk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChyZXNwOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICBmYWlsKFxuICAgICAgICAgICAgICAgICAgdHlwZW9mIHJlc3AucmVzcG9uc2VKU09OID09PSBcInN0cmluZ1wiXG4gICAgICAgICAgICAgICAgICAgID8gcmVzcC5yZXNwb25zZVRleHRcbiAgICAgICAgICAgICAgICAgICAgOiByZXNwLnJlc3BvbnNlSlNPTi5lcnJvcixcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgKSxcbiAgICAgICAgICApO1xuICAgICAgICB9XG5cbiAgICAgICAgX3VwbG9hZENodW5rKFxuICAgICAgICAgIGluZm86IFVwbG9hZEluZm8sXG4gICAgICAgICAgcGFydDogQmxvYixcbiAgICAgICAgICBzdGFydDogbnVtYmVyLFxuICAgICAgICApOiBQcm9taXNlPFVwbG9hZEluZm8+IHtcbiAgICAgICAgICBpZiAoIXBhcnQuc2l6ZSkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiMC1sZW5ndGggY2h1bmtzIGFyZSBub3QgYWxsb3dlZFwiKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgY29uc3QgcmVxdWVzdCA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpO1xuXG4gICAgICAgICAgY29uc3QgcmVzdWx0ID0gbmV3IFByb21pc2U8VXBsb2FkSW5mbz4oKGRvbmUsIGZhaWwpID0+IHtcbiAgICAgICAgICAgIHJlcXVlc3QuYWRkRXZlbnRMaXN0ZW5lcihcImxvYWRcIiwgKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgIGNvbnN0IHJlc3VsdCA9IEpTT04ucGFyc2UocmVxdWVzdC5yZXNwb25zZVRleHQpO1xuICAgICAgICAgICAgICBpZiAocmVzdWx0LnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICBkb25lKHJlc3VsdC5yZXN1bHQpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZhaWwocmVzdWx0LmVycm9yKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJlcXVlc3QuYWRkRXZlbnRMaXN0ZW5lcihcImVycm9yXCIsIChldmVudCkgPT5cbiAgICAgICAgICAgICAgZmFpbChyZXF1ZXN0LnJlc3BvbnNlVGV4dCksXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcmVxdWVzdC5vcGVuKFxuICAgICAgICAgICAgXCJQT1NUXCIsXG4gICAgICAgICAgICB0aGlzLnNhbmRib3guY2xpZW50LnVybChcIi9hcGkvYWN0aW9uL2ZpbGVzX3VwbG9hZF91cGRhdGVcIiksXG4gICAgICAgICAgKTtcblxuICAgICAgICAgIGlmICh0aGlzLmNzcmZUb2tlbikge1xuICAgICAgICAgICAgcmVxdWVzdC5zZXRSZXF1ZXN0SGVhZGVyKFwiWC1DU1JGVG9rZW5cIiwgdGhpcy5jc3JmVG9rZW4pO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuX3NlbmRSZXF1ZXN0KHJlcXVlc3QsIHBhcnQsIHN0YXJ0LCBpbmZvLmlkKTtcblxuICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgIH1cblxuICAgICAgICBfc2VuZFJlcXVlc3QoXG4gICAgICAgICAgcmVxdWVzdDogWE1MSHR0cFJlcXVlc3QsXG4gICAgICAgICAgcGFydDogQmxvYixcbiAgICAgICAgICBwb3NpdGlvbjogbnVtYmVyLFxuICAgICAgICAgIGlkOiBzdHJpbmcsXG4gICAgICAgICkge1xuICAgICAgICAgIGNvbnN0IGZvcm0gPSBuZXcgRm9ybURhdGEoKTtcbiAgICAgICAgICBmb3JtLmFwcGVuZChcInVwbG9hZFwiLCBwYXJ0KTtcbiAgICAgICAgICBmb3JtLmFwcGVuZChcInBvc2l0aW9uXCIsIFN0cmluZyhwb3NpdGlvbikpO1xuICAgICAgICAgIGZvcm0uYXBwZW5kKFwiaWRcIiwgaWQpO1xuICAgICAgICAgIHJlcXVlc3Quc2VuZChmb3JtKTtcbiAgICAgICAgfVxuXG4gICAgICAgIF9jb21wbGV0ZVVwbG9hZChpbmZvOiBVcGxvYWRJbmZvKTogUHJvbWlzZTxVcGxvYWRJbmZvPiB7XG4gICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChkb25lLCBmYWlsKSA9PlxuICAgICAgICAgICAgdGhpcy5zYW5kYm94LmNsaWVudC5jYWxsKFxuICAgICAgICAgICAgICBcIlBPU1RcIixcbiAgICAgICAgICAgICAgXCJmaWxlc191cGxvYWRfY29tcGxldGVcIixcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGlkOiBpbmZvLmlkLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAoZGF0YTogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgZG9uZShkYXRhLnJlc3VsdCk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChyZXNwOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICBmYWlsKFxuICAgICAgICAgICAgICAgICAgdHlwZW9mIHJlc3AucmVzcG9uc2VKU09OID09PSBcInN0cmluZ1wiXG4gICAgICAgICAgICAgICAgICAgID8gcmVzcC5yZXNwb25zZVRleHRcbiAgICAgICAgICAgICAgICAgICAgOiByZXNwLnJlc3BvbnNlSlNPTi5lcnJvcixcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgKSxcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG59XG4iXX0= +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZXMtLXNoYXJlZC5qcyIsInNvdXJjZ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nNlbmQoZGF0YSk7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgZXhwb3J0IGNsYXNzIE11bHRpcGFydCBleHRlbmRzIEJhc2Uge1xuICAgICAgICBzdGF0aWMgZGVmYXVsdFNldHRpbmdzID0geyBjaHVua1NpemU6IDEwMjQgKiAxMDI0ICogNSB9O1xuXG4gICAgICAgIHByaXZhdGUgX2FjdGl2ZTogU2V0PEZpbGU+O1xuXG4gICAgICAgIGNvbnN0cnVjdG9yKHNldHRpbmdzOiBPYmplY3QpIHtcbiAgICAgICAgICBzdXBlcihzZXR0aW5ncyk7XG4gICAgICAgICAgdGhpcy5fYWN0aXZlID0gbmV3IFNldCgpO1xuICAgICAgICB9XG5cbiAgICAgICAgYXN5bmMgdXBsb2FkKGZpbGU6IEZpbGUpIHtcbiAgICAgICAgICBpZiAodGhpcy5fYWN0aXZlLmhhcyhmaWxlKSkge1xuICAgICAgICAgICAgY29uc29sZS53YXJuKFwiRmlsZSB1cGxvYWQgaW4gcHJvZ3Jlc3NcIik7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIHRoaXMuX2FjdGl2ZS5hZGQoZmlsZSk7XG5cbiAgICAgICAgICBsZXQgaW5mbztcblxuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICBpbmZvID0gYXdhaXQgdGhpcy5faW5pdGlhbGl6ZVVwbG9hZChmaWxlKTtcbiAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgZXJyID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hFcnJvcihmaWxlLCBlcnIpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEZhaWwoZmlsZSwgZXJyIGFzIGFueSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gIC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AgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGluZm8gPSBhd2FpdCB0aGlzLl91cGxvYWRDaHVuayhcbiAgICAgICAgICAgICAgaW5mbyxcbiAgICAgICAgICAgICAgZmlsZS5zbGljZShzdGFydCwgc3RhcnQgKyB0aGlzLnNldHRpbmdzLmNodW5rU2l6ZSksXG4gICAgICAgICAgICAgIHN0YXJ0LFxuICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgY29uc3QgdXBsb2FkZWQgPSBpbmZvLnN0b3JhZ2VfZGF0YS51cGxvYWRlZDtcbiAgICAgICAgICAgIGlmICh1cGxvYWRlZCA8PSBzdGFydCkge1xuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJVcGxvYWRlZCBzaXplIGlzIHJlZHVjZWRcIik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hQcm9ncmVzcyhmaWxlLCB1cGxvYWRlZCwgZmlsZS5zaXplKTtcbiAgICAgICAgICAgIHN0YXJ0ID0gdXBsb2FkZWQ7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy5kaXNwYXRjaFByb2dyZXNzKGZpbGUsIGZpbGUuc2l6ZSwgZmlsZS5zaXplKTtcbiAgICAgICAgICBpbmZvID0gYXdhaXQgdGhpcy5fY29tcGxldGVVcGxvYWQoaW5mbyk7XG4gICAgICAgICAgdGhpcy5kaXNwYXRjaEZpbmlzaChmaWxlLCBpbmZvKTtcbiAgICAgICAgfVxuXG4gICAgICAgIF9pbml0aWFsaXplVXBsb2FkKGZpbGU6IEZpbGUpOiBQcm9taXNlPFVwbG9hZEluZm8+IHtcbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKGRvbmUsIGZhaWwpID0+XG4gICAgICAgICAgICB0aGlzLnNhbmRib3guY2xpZW50LmNhbGwoXG4gICAgICAgICAgICAgIFwiUE9TVFwiLFxuICAgICAgICAgICAgICBcImZpbGVzX3VwbG9hZF9pbml0aWFsaXplXCIsXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzdG9yYWdlOiB0aGlzLnNldHRpbmdzLnN0b3JhZ2UsXG4gICAgICAgICAgICAgICAgbmFtZTogZmlsZS5uYW1lLFxuICAgICAgICAgICAgICAgIHNpemU6IGZpbGUuc2l6ZSxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgKGRhdGE6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgIGRvbmUoZGF0YS5yZXN1bHQpO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAocmVzcDogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgZmFpbChcbiAgICAgICAgICAgICAgICAgIHR5cGVvZiByZXNwLnJlc3BvbnNlSlNPTiA9PT0gXCJzdHJpbmdcIlxuICAgICAgICAgICAgICAgICAgICA/IHJlc3AucmVzcG9uc2VUZXh0XG4gICAgICAgICAgICAgICAgICAgIDogcmVzcC5yZXNwb25zZUpTT04uZXJyb3IsXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICksXG4gICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgICAgICBfc2hvd1VwbG9hZChpZDogc3RyaW5nKTogUHJvbWlzZTxVcGxvYWRJbmZvPiB7XG4gICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChkb25lLCBmYWlsKSA9PlxuICAgICAgICAgICAgdGhpcy5zYW5kYm94LmNsaWVudC5jYWxsKFxuICAgICAgICAgICAgICBcIkdFVFwiLFxuICAgICAgICAgICAgICBcImZpbGVzX3VwbG9hZF9zaG93XCIsXG4gICAgICAgICAgICAgIGA/aWQ9JHtpZH1gLFxuICAgICAgICAgICAgICAoZGF0YTogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgZG9uZShkYXRhLnJlc3VsdCk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChyZXNwOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICBmYWlsKFxuICAgICAgICAgICAgICAgICAgdHlwZW9mIHJlc3AucmVzcG9uc2VKU09OID09PSBcInN0cmluZ1wiXG4gICAgICAgICAgICAgICAgICAgID8gcmVzcC5yZXNwb25zZVRleHRcbiAgICAgICAgICAgICAgICAgICAgOiByZXNwLnJlc3BvbnNlSlNPTi5lcnJvcixcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgKSxcbiAgICAgICAgICApO1xuICAgICAgICB9XG5cbiAgICAgICAgX3VwbG9hZENodW5rKFxuICAgICAgICAgIGluZm86IFVwbG9hZEluZm8sXG4gICAgICAgICAgcGFydDogQmxvYixcbiAgICAgICAgICBzdGFydDogbnVtYmVyLFxuICAgICAgICApOiBQcm9taXNlPFVwbG9hZEluZm8+IHtcbiAgICAgICAgICBpZiAoIXBhcnQuc2l6ZSkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiMC1sZW5ndGggY2h1bmtzIGFyZSBub3QgYWxsb3dlZFwiKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgY29uc3QgcmVxdWVzdCA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpO1xuXG4gICAgICAgICAgY29uc3QgcmVzdWx0ID0gbmV3IFByb21pc2U8VXBsb2FkSW5mbz4oKGRvbmUsIGZhaWwpID0+IHtcbiAgICAgICAgICAgIHJlcXVlc3QuYWRkRXZlbnRMaXN0ZW5lcihcImxvYWRcIiwgKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgIGNvbnN0IHJlc3VsdCA9IEpTT04ucGFyc2UocmVxdWVzdC5yZXNwb25zZVRleHQpO1xuICAgICAgICAgICAgICBpZiAocmVzdWx0LnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICBkb25lKHJlc3VsdC5yZXN1bHQpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZhaWwocmVzdWx0LmVycm9yKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJlcXVlc3QuYWRkRXZlbnRMaXN0ZW5lcihcImVycm9yXCIsIChldmVudCkgPT5cbiAgICAgICAgICAgICAgZmFpbChyZXF1ZXN0LnJlc3BvbnNlVGV4dCksXG4gICAgICAgICAgICApO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcmVxdWVzdC5vcGVuKFxuICAgICAgICAgICAgXCJQT1NUXCIsXG4gICAgICAgICAgICB0aGlzLnNhbmRib3guY2xpZW50LnVybChcIi9hcGkvYWN0aW9uL2ZpbGVzX3VwbG9hZF91cGRhdGVcIiksXG4gICAgICAgICAgKTtcblxuICAgICAgICAgIGlmICh0aGlzLmNzcmZUb2tlbikge1xuICAgICAgICAgICAgcmVxdWVzdC5zZXRSZXF1ZXN0SGVhZGVyKFwiWC1DU1JGVG9rZW5cIiwgdGhpcy5jc3JmVG9rZW4pO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuX3NlbmRSZXF1ZXN0KHJlcXVlc3QsIHBhcnQsIHN0YXJ0LCBpbmZvLmlkKTtcblxuICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgIH1cblxuICAgICAgICBfc2VuZFJlcXVlc3QoXG4gICAgICAgICAgcmVxdWVzdDogWE1MSHR0cFJlcXVlc3QsXG4gICAgICAgICAgcGFydDogQmxvYixcbiAgICAgICAgICBwb3NpdGlvbjogbnVtYmVyLFxuICAgICAgICAgIGlkOiBzdHJpbmcsXG4gICAgICAgICkge1xuICAgICAgICAgIGNvbnN0IGZvcm0gPSBuZXcgRm9ybURhdGEoKTtcbiAgICAgICAgICBmb3JtLmFwcGVuZChcInVwbG9hZFwiLCBwYXJ0KTtcbiAgICAgICAgICBmb3JtLmFwcGVuZChcInBvc2l0aW9uXCIsIFN0cmluZyhwb3NpdGlvbikpO1xuICAgICAgICAgIGZvcm0uYXBwZW5kKFwiaWRcIiwgaWQpO1xuICAgICAgICAgIHJlcXVlc3Quc2VuZChmb3JtKTtcbiAgICAgICAgfVxuXG4gICAgICAgIF9jb21wbGV0ZVVwbG9hZChpbmZvOiBVcGxvYWRJbmZvKTogUHJvbWlzZTxVcGxvYWRJbmZvPiB7XG4gICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChkb25lLCBmYWlsKSA9PlxuICAgICAgICAgICAgdGhpcy5zYW5kYm94LmNsaWVudC5jYWxsKFxuICAgICAgICAgICAgICBcIlBPU1RcIixcbiAgICAgICAgICAgICAgXCJmaWxlc191cGxvYWRfY29tcGxldGVcIixcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGlkOiBpbmZvLmlkLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAoZGF0YTogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgZG9uZShkYXRhLnJlc3VsdCk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIChyZXNwOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICBmYWlsKFxuICAgICAgICAgICAgICAgICAgdHlwZW9mIHJlc3AucmVzcG9uc2VKU09OID09PSBcInN0cmluZ1wiXG4gICAgICAgICAgICAgICAgICAgID8gcmVzcC5yZXNwb25zZVRleHRcbiAgICAgICAgICAgICAgICAgICAgOiByZXNwLnJlc3BvbnNlSlNPTi5lcnJvcixcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgKSxcbiAgICAgICAgICApO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/ckanext/files/assets/ts/files--queue.ts b/ckanext/files/assets/ts/files--queue.ts index 2f440c8..0cfaa85 100644 --- a/ckanext/files/assets/ts/files--queue.ts +++ b/ckanext/files/assets/ts/files--queue.ts @@ -131,7 +131,7 @@ ckan.module("files--queue", function ($) { file.name, Object.entries(reasons) .filter(([k, v]) => k[0] !== "_") - .map(([k, v]) => v.join("; ")) + .map(([k, v]) => (Array.isArray(v) ? v.join("; ") : v)) .join("; "), ); this.toggleAnimation(widget, false); @@ -139,7 +139,7 @@ ckan.module("files--queue", function ($) { widget .find("[data-upload-progress]") .removeClass("bg-primary bg-secondary") - .addClass("bg-danger"); + .addClass("bg-danger progress-bar-danger"); }, ); info.uploader.addEventListener( @@ -152,7 +152,7 @@ ckan.module("files--queue", function ($) { widget .find("[data-upload-progress]") .removeClass("bg-primary bg-secondary") - .addClass("bg-danger"); + .addClass("bg-danger progress-bar-danger"); }, ); @@ -168,7 +168,7 @@ ckan.module("files--queue", function ($) { widget .find("[data-upload-progress]") .removeClass("bg-primary bg-secondary") - .addClass("bg-success"); + .addClass("bg-success progress-bar-succes"); this.sandbox.publish( ckan.CKANEXT_FILES.topics.queueItemUploaded, file, diff --git a/ckanext/files/assets/ts/files--shared.ts b/ckanext/files/assets/ts/files--shared.ts index d505ed0..4aa1fdf 100644 --- a/ckanext/files/assets/ts/files--shared.ts +++ b/ckanext/files/assets/ts/files--shared.ts @@ -181,7 +181,19 @@ namespace ckan { } this._active.add(file); - let info = await this._initializeUpload(file); + let info; + + try { + info = await this._initializeUpload(file); + } catch (err) { + if (typeof err === "string") { + this.dispatchError(file, err); + } else { + this.dispatchFail(file, err as any); + } + return; + } + this.dispatchCommit(file, info.id); this.dispatchStart(file); diff --git a/ckanext/files/logic/action.py b/ckanext/files/logic/action.py index b63f0d6..3c3994c 100644 --- a/ckanext/files/logic/action.py +++ b/ckanext/files/logic/action.py @@ -30,7 +30,7 @@ def files_file_search_by_user(context, data_dict): tk.check_access("files_file_search_by_user", context, data_dict) sess = context["session"] - stmt = sa.select(File).join( + q = sess.query(File).join( Owner, sa.and_(File.id == Owner.item_id, Owner.item_type == "file"), # type: ignore ) @@ -39,9 +39,10 @@ def files_file_search_by_user(context, data_dict): if not user: raise tk.ObjectNotFound("user") - stmt = stmt.where(Owner.owner_type == "user", Owner.owner_id == user.id) - total = sess.scalar(sa.select(sa.func.count()).select_from(stmt)) + q = q.filter(sa.and_(Owner.owner_type == "user", Owner.owner_id == user.id)) + + total = q.count() parts = data_dict["sort"].split(".") sort = parts[0] @@ -62,11 +63,11 @@ def files_file_search_by_user(context, data_dict): if data_dict["reverse"]: column = column.desc() - stmt = stmt.order_by(column) + q = q.order_by(column) - stmt = stmt.limit(data_dict["rows"]).offset(data_dict["start"]) + q = q.limit(data_dict["rows"]).offset(data_dict["start"]) - return {"count": total, "results": [f.dictize(context) for f in sess.scalars(stmt)]} + return {"count": total, "results": [f.dictize(context) for f in q]} @action diff --git a/ckanext/files/logic/auth.py b/ckanext/files/logic/auth.py index 5cbc0dd..5deec1b 100644 --- a/ckanext/files/logic/auth.py +++ b/ckanext/files/logic/auth.py @@ -1,4 +1,5 @@ import ckan.plugins.toolkit as tk +import sqlalchemy as sa from ckan import authz, model from ckanext.files.model import Owner @@ -33,8 +34,10 @@ def _get_user(context): def _is_owner(user_id, file_id): # type: (str, str) -> bool stmt = Owner.owners_of(file_id, "file").where( - Owner.owner_type == "user", - Owner.owner_ie == user_id, + sa.and_( + Owner.owner_type == "user", + Owner.owner_ie == user_id, + ) ) return model.Session.query(stmt.exists()).scalar() diff --git a/ckanext/files/model/owner.py b/ckanext/files/model/owner.py index 16d9062..a81d97d 100644 --- a/ckanext/files/model/owner.py +++ b/ckanext/files/model/owner.py @@ -3,6 +3,7 @@ from ckan.lib.dictization import table_dictize from ckan.model.types import make_uuid +import ckan.plugins.toolkit as tk from .base import Base @@ -31,11 +32,12 @@ def dictize(self, context): def owners_of(cls, id, type): # type: (str, str) -> types.Select """List records with given item.""" - return sa.select(cls).where(cls.item_type == type, cls.item_id == id) + selectable = cls if tk.check_ckan_version("2.9") else [cls] + return sa.select(selectable).where(sa.and_(cls.item_type == type, cls.item_id == id)) @classmethod def owned_by(cls, id, type): # type: (str, str) -> types.Select """List records with given owner.""" - - return sa.select(cls).where(cls.owner_type == type, cls.owner_id == id) + selectable = cls if tk.check_ckan_version("2.9") else [cls] + return sa.select(selectable).where(sa.and_(cls.owner_type == type, cls.owner_id == id)) diff --git a/ckanext/files/templates/files/snippets/_resource.html b/ckanext/files/templates/files/snippets/_resource.html index 24f2d7e..8c4ef4d 100644 --- a/ckanext/files/templates/files/snippets/_resource.html +++ b/ckanext/files/templates/files/snippets/_resource.html @@ -1,3 +1 @@ -{% resource "files/styles/files--style.css" %} -{% resource "files/js/files--shared.js" %} -{% resource "files/js/files--queue.js" %} +{% resource "files/files" %} diff --git a/ckanext/files/templates/files/snippets/file_table.html b/ckanext/files/templates/files/snippets/file_table.html index 6d9a91d..46292c8 100644 --- a/ckanext/files/templates/files/snippets/file_table.html +++ b/ckanext/files/templates/files/snippets/file_table.html @@ -31,7 +31,7 @@ {% else %} - + {{ _(column.label) }} {% endif %} @@ -84,7 +84,7 @@ {% endif %} {% if not file.completed and h.check_access("files_upload_update", {"id": file.id})%} -