-
Notifications
You must be signed in to change notification settings - Fork 56
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
[ENG-4671] Implement submit-to-boa flow for file list and file detail page #2034
[ENG-4671] Implement submit-to-boa flow for file list and file detail page #2034
Conversation
822c9a3
to
3bc882d
Compare
Pull Request Test Coverage Report for Build 6747699034
💛 - Coveralls |
2f8aa7b
to
a05145b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving a quick review. Just some small embery notations/quirks that I see that could be implemented
lib/osf-components/addon/components/file-actions-menu/submit-to-boa-modal/component.ts
Outdated
Show resolved
Hide resolved
lib/osf-components/addon/components/file-actions-menu/submit-to-boa-modal/template.hbs
Outdated
Show resolved
Hide resolved
lib/osf-components/addon/components/file-actions-menu/submit-to-boa-modal/component.ts
Outdated
Show resolved
Hide resolved
lib/osf-components/addon/components/file-actions-menu/submit-to-boa-modal/component.ts
Outdated
Show resolved
Hide resolved
lib/osf-components/addon/components/file-actions-menu/submit-to-boa-modal/component.ts
Outdated
Show resolved
Hide resolved
* make boa modal findable * save WIP on dataset select * futa wisdom attained/accepted * add action; fetch parents properly * enabled addons enabled * cleanups; fix closemodal
8ed34ec
to
f5d1b93
Compare
datasets?: string[]; | ||
@tracked selectedDataset?: string; | ||
|
||
datasets = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will hard-code this list for now, and if/when Boa adds anything to this list, we will update it or fetch it from somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of comments and a couple of small things, mostly around an unnecessary mirage trait.
datasets = [ | ||
'2022 Jan/Java', | ||
'2022 Feb/Python', | ||
'2021 Method Chains', | ||
'2021 Aug/Python', | ||
'2021 Aug/Kotlin (small)', | ||
'2021 Aug/Kotlin', | ||
'2021 Jan/ML-Verse', | ||
'2020 August/Python-DS', | ||
'2019 October/GitHub (small)', | ||
'2019 October/GitHub (medium)', | ||
'2019 October/GitHub', | ||
'2015 September/GitHub', | ||
'2013 September/SF (small)', | ||
'2013 September/SF (medium)', | ||
'2013 September/SF', | ||
'2013 May/SF', | ||
'2013 February/SF', | ||
'2012 July/SF', | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is less than ideal, but I see it's been discussed already as part of the scope. Let's never update this list, and if it ever needs to change, we should use an endpoint to get the current list of datasets.
const fileModel = file.fileModel; | ||
const parentFolder = await fileModel.get('parentFolder'); | ||
const grandparentFolder = await parentFolder.get('parentFolder'); | ||
const endpoint = config.OSF.url + 'api/v1/project/' + fileModel.target.get('id') + '/boa/submit-job/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/api/v1
url? Yuck!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sadly true, it uses the existing add-on routes, might be something that will be totally refactored in the new add-on service?
{{#if @item.currentUserCanDelete}} | ||
{{#if @item.providerIsOsfstorage}} | ||
{{#if @item.isBoaFile}} | ||
{{#if this.isBoaEnabled}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a lot of nested ifs. Probably fine, though might be better as a getter in the component ts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I will distill this down to a getter on the component
mirage/factories/node.ts
Outdated
hasBoaEnabled: trait<MirageNode>({ | ||
boaEnabled: true, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be a trait, or could we just set boaEnabled
to true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, I was going to have this trait do a bit more (e.g. add a .boa
file to the node's OsfStorage), but maybe having a trait do all of that is a bit much. Will remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're going to add a file, that does make sense for a trait. Either way.
mirage/scenarios/dashboard.ts
Outdated
@@ -49,7 +50,17 @@ export function dashboardScenario(server: Server, currentUser: ModelInstance<Use | |||
id: 'file5', | |||
title: 'With some files', | |||
currentUserPermissions: [Permission.Read, Permission.Write, Permission.Admin], | |||
}, 'withFiles', 'withStorage', 'withContributors', 'withAffiliatedInstitutions', 'withDoi', 'withLinkedByNodes'); | |||
}, 'hasBoaEnabled', 'withFiles', 'withStorage', 'withContributors', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, should just be able to do boaEnabled: true
above.
|
||
// This is the handler for the unofficial node/addons endpoint | ||
// It is only being used by the file-action-menu component to determine if a node has the BoA addon enabled | ||
// It is not being used by the official OSF API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside: this is probably going to change very soon with the addons project.
61cd658
into
CenterForOpenScience:feature/boa-addon
To be filled out.
Purpose
Add "Submit to Boa" action to file pages for .boa files
Summary of Changes
Screenshot(s)
Side Effects
QA Notes