Skip to content

Commit

Permalink
Restore metadata file store multiple files upload
Browse files Browse the repository at this point in the history
  • Loading branch information
josegar74 committed Feb 7, 2025
1 parent 6693e62 commit 38467ac
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,20 @@
: attrs["visibility"];
scope.queue = [];

var input = element.find("input");
if (
scope.uploadOptions &&
angular.isDefined(scope.uploadOptions) &&
scope.uploadOptions.singleUpload === false
) {
input.attr("multiple", "multiple");
}

var uploadFile = function () {
scope.queue = [];
scope.filestoreUploadOptions = angular.extend(
{
singleUpload: true,
singleUpload: scope.singleUpload,
autoUpload: scope.autoUpload,
url:
"../api/records/" +
Expand Down Expand Up @@ -219,6 +228,17 @@
link: function (scope, element, attrs, controller) {
scope.autoUpload =
angular.isUndefined(attrs["autoUpload"]) || attrs["autoUpload"] == "true";

scope.filestoreUploadOptions = {
autoUpload: scope.autoUpload,
singleUpload: false
};

scope.filestoreUploadOptionsSetResource = {
autoUpload: scope.autoUpload,
singleUpload: true
};

var defaultStatus = angular.isUndefined(attrs["defaultStatus"])
? "public"
: attrs["defaultStatus"];
Expand Down Expand Up @@ -295,15 +315,6 @@
scope.loadMetadataResources();

scope.queue = [];
scope.filestoreUploadOptions = {
autoUpload: scope.autoUpload,
url:
"../api/records/" +
scope.uuid +
"/attachments?visibility=" +
defaultStatus,
singleUpload: false
};
}
});
if (angular.isDefined(scope.uuid)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div
data-gn-data-uploader-button="'chooseOnlinesrc'"
data-after-upload-cb="setResource"
data-upload-options="filestoreUploadOptions"
data-upload-options="filestoreUploadOptionsSetResource"
></div>
</div>
<div data-ng-if="layout !== 'select'">
Expand Down

0 comments on commit 38467ac

Please sign in to comment.