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

deposits-ui: disable publish button on files #1690

Merged
merged 1 commit into from
Feb 8, 2019

Conversation

Glignos
Copy link
Contributor

@Glignos Glignos commented Jan 29, 2019

@Glignos Glignos requested a review from slint January 29, 2019 17:42
@slint slint requested a review from ChiaraBi January 31, 2019 15:35
Copy link
Member

@slint slint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor naming stuff, otherwise 🔥

angular.module('invenioRecords')
.filter('fieldtitle', fieldtitle)
.filter('notIn', notIn)
.filter('formatGrant', formatGrant)
.filter('limitToEllipsis', limitToEllipsis)
.filter('striptags', striptags)
.filter('stable', stable);
.filter('stable', stable)
.filter('check_all_files_uploaded',check_all_files_uploaded);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.filter('check_all_files_uploaded',check_all_files_uploaded);
.filter('checkAllFilesUploaded', check_all_files_uploaded);

<li>
<button
class="btn btn-primary"
data-toggle="modal"
data-target="#warningModal"
ng-hide="recordsVM.invenioRecordsArgs.templateParams.is_published"
ng-disabled="depositionForm.$invalid || depositionForm.$dirty || recordsVM.invenioRecordsLoading"
ng-attr-title="{{(depositionForm.$invalid || depositionForm.$dirty || recordsVM.invenioRecordsLoading) && 'You need to save your deposit first' || 'Publish the record'}}">
ng-disabled="depositionForm.$invalid || depositionForm.$dirty || recordsVM.invenioRecordsLoading || (filesVM.files | check_all_files_uploaded) || filesVM.files.length == 0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ng-disabled="depositionForm.$invalid || depositionForm.$dirty || recordsVM.invenioRecordsLoading || (filesVM.files | check_all_files_uploaded) || filesVM.files.length == 0"
ng-disabled="depositionForm.$invalid || depositionForm.$dirty || recordsVM.invenioRecordsLoading || (filesVM.files | checkAllFilesUploaded) || filesVM.files.length == 0"

ng-attr-title="{{(depositionForm.$invalid || depositionForm.$dirty || recordsVM.invenioRecordsLoading) && 'You need to save your deposit first' || 'Publish the record'}}">
ng-disabled="depositionForm.$invalid || depositionForm.$dirty || recordsVM.invenioRecordsLoading || (filesVM.files | check_all_files_uploaded) || filesVM.files.length == 0"
ng-attr-title="{{(depositionForm.$invalid || depositionForm.$dirty || recordsVM.invenioRecordsLoading) && 'You need to save your deposit first'
|| (filesVM.files | check_all_files_uploaded) && 'There are pending files to be uploaded'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
|| (filesVM.files | check_all_files_uploaded) && 'There are pending files to be uploaded'
|| (filesVM.files | checkAllFilesUploaded) && 'There are pending files to be uploaded'

* Disable the publish button and display appropriate
  message in the case of selected but not uploaded files
  or if no selected files are present. (closes zenodo#1412)
@Glignos Glignos force-pushed the disable_publish_button_on_files branch from ad54373 to 5b6bb45 Compare February 1, 2019 10:34
@lnielsen lnielsen merged commit 5205911 into zenodo:master Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deposit-ui: more intutitve file upload indicators
4 participants