diff --git a/lib/osf-components/addon/components/file-actions-menu/component.ts b/lib/osf-components/addon/components/file-actions-menu/component.ts index 4d71f8d7f40..71904dd56a8 100644 --- a/lib/osf-components/addon/components/file-actions-menu/component.ts +++ b/lib/osf-components/addon/components/file-actions-menu/component.ts @@ -5,6 +5,7 @@ import { inject as service } from '@ember/service'; import Media from 'ember-responsive'; import File from 'ember-osf-web/packages/files/file'; import StorageManager from 'osf-components/components/storage-provider-manager/storage-manager/component'; +import OsfStorageFile from 'ember-osf-web/packages/files/osf-storage-file'; interface Args { item: File; @@ -52,7 +53,17 @@ export default class FileActionsMenu extends Component { } get showSubmitToBoa() { - const { item } = this.args; - return this.isBoaEnabled && item.isBoaFile && item.providerIsOsfstorage && item.currentUserCanDelete; + const { item, manager } = this.args; + if (item.providerIsOsfstorage) { + let userCanUploadToHere; + if (manager) { + userCanUploadToHere = manager.currentFolder.userCanUploadToHere; + } else { + const parentFolder = new OsfStorageFile(item.currentUser, item.fileModel.get('parentFolder')); + userCanUploadToHere = parentFolder.userCanUploadToHere; + } + return this.isBoaEnabled && item.isBoaFile && userCanUploadToHere; + } + return false; } } diff --git a/lib/osf-components/addon/components/file-actions-menu/submit-to-boa-modal/component.ts b/lib/osf-components/addon/components/file-actions-menu/submit-to-boa-modal/component.ts index 02d46630c04..96915b0dfaf 100644 --- a/lib/osf-components/addon/components/file-actions-menu/submit-to-boa-modal/component.ts +++ b/lib/osf-components/addon/components/file-actions-menu/submit-to-boa-modal/component.ts @@ -18,7 +18,6 @@ interface Args { export default class SubmitToBoaModal extends Component { @service toast!: Toastr; @service intl!: IntlService; - datasets?: string[]; @tracked selectedDataset?: string; datasets = [ @@ -63,6 +62,7 @@ export default class SubmitToBoaModal extends Component { nodeId: fileModel.target.get('id'), name: file.name, materialized: fileModel.materializedPath, + sizeInt: fileModel.size, links: { download: file.links.download, upload: file.links.upload, diff --git a/mirage/scenarios/dashboard.ts b/mirage/scenarios/dashboard.ts index 9211b838d65..f477cabbb97 100644 --- a/mirage/scenarios/dashboard.ts +++ b/mirage/scenarios/dashboard.ts @@ -58,6 +58,7 @@ export function dashboardScenario(server: Server, currentUser: ModelInstance