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

Jkmarx/fix add file bug ui #2853

Merged
merged 3 commits into from
Jul 11, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions refinery/ui/source/js/data-set-import/controllers/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ function RefineryFileUploadCtrl (
} else {
vm.overallFileStatus = fileUploadStatusService.setFileUploadStatus('queuing');
}
if (vm.isNodeUpdate) {
addFileToDataSetService.update({ data_set_uuid: $window.dataSetUuid }).$promise
.then(function () {
vm.addFileStatus = 'success';
}, function () {
vm.addFileStatus = 'error';
});
}

$timeout(function () {
// Fritz: I am not sure why we need to wait 100ms instead of 0ms
Expand Down Expand Up @@ -209,14 +217,6 @@ function RefineryFileUploadCtrl (
};

var uploadAlways = function () {
if (vm.isNodeUpdate) {
addFileToDataSetService.update({ data_set_uuid: $window.dataSetUuid }).$promise
.then(function () {
vm.addFileStatus = 'success';
}, function () {
vm.addFileStatus = 'error';
});
}
formData = [];
/* After uploads, clear formData, including upload_id for the next
upload. This reset require for mutliple large files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@

DataFileEditModalCtrl.$inject = [
'$log',
'$scope',
'fileBrowserFactory',
'fileUploadStatusService',
'nodesV2Service',
'settings'
];

function DataFileEditModalCtrl (
$log,
$scope,
fileBrowserFactory,
fileUploadStatusService,
nodesV2Service,
settings
) {
Expand Down Expand Up @@ -80,6 +84,15 @@
var nameInternal = fileBrowserFactory.attributesNameKey.Name;
vm.nodeURL = vm.resolve.config.nodeObj.REFINERY_DOWNLOAD_URL_s;
vm.nodeName = vm.resolve.config.nodeObj[nameInternal];

$scope.$watch(
function () {
return fileUploadStatusService.fileUploadStatus;
},
function (fileStatus) {
vm.fileStatus = fileStatus;
}
);
};
}
})();
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<div class="modal-content" id="data-file-edit-modal">
<div class="modal-header">
<a class="float-right modal-close" ng-click="$ctrl.close()">
<a class="float-right modal-close"
ng-class="{disabledLink: $ctrl.fileStatus == 'running' || $ctrl.isLoading}"
ng-click="$ctrl.close()">
<i class="fa fa-times close" aria-hidden="true"></i>
</a>
<h3 class="modal-title" ng-if="$ctrl.fileAction === 'add'">Add File</h3>
Expand Down Expand Up @@ -61,7 +63,7 @@ <h3 class="modal-title" ng-if="$ctrl.fileAction === 'remove'">
type="button"
class="refinery-base btn btn-default"
ng-click="$ctrl.close()"
ng-disabled="$ctrl.isLoading">
ng-disabled="$ctrl.isLoading || $ctrl.fileStatus == 'running'">
Close
</button>
</div>
Expand Down
4 changes: 3 additions & 1 deletion refinery/ui/source/js/file-browser/views/files-tab.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
<h3 class="p-l-1">
{{ FBCtrl.assayFilesTotal }} files
</h3>
<span class="p-l-1 banned"
<span class="p-l-1"
ng-class="{banned: !FBCtrl.dataSet.is_clean}"
ng-if="FBCtrl.dataSet.isa_archive.length && FBCtrl.dataSet.is_owner">
<a
ng-class="{disabledLink: !FBCtrl.dataSet.is_clean}"
Expand All @@ -76,6 +77,7 @@ <h3 class="p-l-1">
</a>
</span>
<span class="p-l-1"
ng-class="{banned: !FBCtrl.dataSet.is_clean}"
ng-if="FBCtrl.dataSet.pre_isa_archive.length && FBCtrl.dataSet.is_owner">
<a
ng-class="{disabledLink: !FBCtrl.dataSet.is_clean}"
Expand Down