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

[ENG-4671] Implement submit-to-boa flow for file list and file detail page #2034

Merged

Conversation

felliott
Copy link
Member

@felliott felliott commented Oct 19, 2023

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

@felliott felliott changed the title [WIP] first stab at Boa addon ux [WIP][ENG-4671] first stab at Boa addon ux Oct 19, 2023
@coveralls
Copy link

coveralls commented Oct 23, 2023

Pull Request Test Coverage Report for Build 6747699034

  • 12 of 31 (38.71%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.08%) to 70.575%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/packages/files/file.ts 0 2 0.0%
lib/osf-components/addon/components/file-actions-menu/component.ts 1 4 25.0%
lib/osf-components/addon/components/file-actions-menu/submit-to-boa-modal/component.ts 1 15 6.67%
Totals Coverage Status
Change from base Build 6642409593: -0.08%
Covered Lines: 5965
Relevant Lines: 8225

💛 - Coveralls

@felliott felliott force-pushed the feature/boa-addon branch 2 times, most recently from 2f8aa7b to a05145b Compare October 27, 2023 16:38
Copy link
Contributor

@futa-ikeda futa-ikeda left a 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

 * make boa modal findable
 * save WIP on dataset select
 * futa wisdom attained/accepted
 * add action; fetch parents properly
 * enabled addons enabled
 * cleanups; fix closemodal
@cslzchen cslzchen changed the title [WIP][ENG-4671] first stab at Boa addon ux [ENG-4642] [ENG-4671] Boa Add-on Project PR - Ember Part Nov 3, 2023
@cslzchen cslzchen changed the base branch from develop to feature/boa-addon November 3, 2023 19:52
@cslzchen cslzchen changed the title [ENG-4642] [ENG-4671] Boa Add-on Project PR - Ember Part [ENG-4671] Implement submit-to-boa flow for file list and file detail page Nov 3, 2023
datasets?: string[];
@tracked selectedDataset?: string;

datasets = [
Copy link
Contributor

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.

Copy link
Contributor

@brianjgeiger brianjgeiger left a 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.

Comment on lines +24 to +43
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',
];
Copy link
Contributor

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/';
Copy link
Contributor

Choose a reason for hiding this comment

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

/api/v1 url? Yuck!

Copy link
Collaborator

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?

Comment on lines 113 to 116
{{#if @item.currentUserCanDelete}}
{{#if @item.providerIsOsfstorage}}
{{#if @item.isBoaFile}}
{{#if this.isBoaEnabled}}
Copy link
Contributor

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.

Copy link
Contributor

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

Comment on lines 192 to 194
hasBoaEnabled: trait<MirageNode>({
boaEnabled: true,
}),
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor

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.

@@ -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',
Copy link
Contributor

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
Copy link
Contributor

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.

@cslzchen cslzchen merged commit 61cd658 into CenterForOpenScience:feature/boa-addon Nov 8, 2023
9 checks passed
@futa-ikeda futa-ikeda added this to the 23.14.0 milestone Nov 8, 2023
@felliott felliott deleted the feature/boa-addon branch November 11, 2023 03:38
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.

5 participants