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

Add catalog and extension views #2

Closed
jcfr opened this issue Jun 22, 2020 · 15 comments
Closed

Add catalog and extension views #2

jcfr opened this issue Jun 22, 2020 · 15 comments
Assignees

Comments

@jcfr
Copy link
Contributor

jcfr commented Jun 22, 2020

Catalog view

This view will display:

  • a list of extensions associated with a version of Slicer described using slicer revision (called application revision), operating system and architecture.
  • a list of categories on the left side for filtering down the list by extension category (more details below)

Proposed routes

<server_url>/#/catalog/:app_revision/:os
<server_url>/#/catalog/:app_revision/:os/:arch

Using <server_url>/#/catalog/:app_revision/:os should "redirect" to <server_url>/#/catalog/:app_revision/:os/:arch

Route parameters:

  • app_revision:
    • required
    • integer
    • This uniquely identify a version of the source used to build the application (it is monotonically increasing)
  • os:
    • required
    • accepted values ['macos', 'linux', 'macos']
  • arch:
    • optional: default value is amd64
    • accepted values ['i386', 'amd64']

Relevant API calls

List of extensions can directly be retrieved from the backend doing the following:

http://192.168.113.208:8080/api/v1/app/5aa3da37f3eb080001497b3d/extension?app_revision=27201&os=macosx&arch=amd64&sort=created&sortdir=-1

Initial design

image

image

Questions

How to generate the category list ?

In this first implementation, let's consider it is a flat list of categories associated with the set extension currently displayed in the catalog

If could be generated using code similar to this: https://github.com/Pierre-Assemat/Vuejs-Project/blob/77605bb2c4bf69128d1e381cd9dfbe871e45ec32/src/views/extensions-catalog/ExtensionsCatalogView.vue#L59-L83

In the second iteration, we will generate a tree (this is captured in #3)

How to integrate category in the router ?

  • If we wanted to expose the category in the router, may be we could do something like this:
<server_url>/#/catalog/:app_revision/:os/:arch/[:category]

Extension view

Proposed routes

<server_url>/#/view/:extension_name/:app_revision/:os
<server_url>/#/view/:extension_name/:app_revision/:os/:arch

Relevant API calls

Metadata specific to a given extension can directly be retrieved from the backend doing the following:

http://192.168.113.208:8080/api/v1/app/5aa3da37f3eb080001497b3d/extension?extension_id=5afff7a479e39e0001040ff0&sort=created&sortdir=-1

where the extension_id is _id (which corresponds to an idem id) returned in the API call used to generated the catalog view.

Initial design

image

Frontend configuration

  • app_id
  • backend_url currently http://192.168.113.208:8080 but ultimately it will be https://slicer-packages.kitware.com when deployed in production. When developing, it could also be a local URL

Notes

A revision can be associated with either a stable (also called release) version or a preview (also called draft) version of the application.

Since we could potentially deploy other instance of the frontend associated with different app_id (e.g a Slicer-based commercial application), let's keep app_revision in the code instead of slicer_revision

@subdavis
Copy link
Contributor

Thanks, JC. Getting started on this today. Your local girder instance is fine for getting started, but there should be docs for setting up https://github.com/girder/slicer_package_manager as a development server.

@jcfr
Copy link
Contributor Author

jcfr commented Jun 24, 2020

but there should be docs for setting up https://github.com/girder/slicer_package_manager as a development server.

Agreed. I will be working on updating https://slicer-package-manager.readthedocs.io/en/latest/developer_guide.html

extension.meta.category

Thanks for the report

I noticed when writing the issue and was initially thinking it would be there for newer packages but is it is not the case:

  • last night upload batch associated with revision 29173 is also missing it - see here
  • invocation of the python client used for uploading doesn't specify it either- see here
  • documentation of the client does not mention it - see here

Good news is that:

Todo for @jcfr :

@subdavis
Copy link
Contributor

subdavis commented Jun 24, 2020

Trivial first pass.

Right now, there's no info coming out of the backend about 1) extension author 2) thumbnail image 3) description so I can't really add that. Also need category info before I can do filtering.

I'll see about doing the slicer integration parts next, and adding a page for extension details.

Screenshot from 2020-06-24 14-38-22

@jcfr
Copy link
Contributor Author

jcfr commented Jun 26, 2020

Looks great !

Missing metadata have been added (description, icon_url, category, homepage, screenshots)

@subdavis
Copy link
Contributor

Dummy details page added

Screenshot from 2020-06-26 15-54-58

Extension list updated

Screenshot from 2020-06-26 15-55-47

  • No thought has been put into page transitions or category change transitions
  • Download button does nothing
  • The route for details looks different than you asked: /view/:name where name is an extension name. I like how this makes the URL human-readable rather than including some kind of girder BSON id that doesn't tell a human anything.
  • screenshots missing
  • Author info missing. IDK if I should try and look that up using the girder user ID or what.

Aside from those caveats, I think this issue is mostly done.

@jcfr
Copy link
Contributor Author

jcfr commented Jun 29, 2020

The route for details

With the updated route, how would the user select operating system, arch and app version ?

Author info missing. IDK if I should try and look that up using the girder user ID or what.

List of contributors is purely descriptive and not related to Girder users.

@subdavis
Copy link
Contributor

With the updated route, how would the user select operating system, arch and app version ?

This application appears to be organized such that every OS/arch/appversion has a different and unique extension.

http://192.168.113.208:8080/api/v1/app/5aa3da37f3eb080001497b3d/extension?extension_name=27201_quantitativereporting_macosx_amd64_2ef8580&sort=created&sortdir=-1

This follows from your example of how to get information on a specific example above. I don't see a way in https://github.com/girder/slicer_package_manager/blob/master/server/api/app.py#L424-L441 to query for an extension by name where the os, arch, and version are able to be specified separately.

In other words, I don't see a way to say "Show me ALL QuantitativeReporting extensions of any os, arch, version". I may be misreading the API.

List of contributors is purely descriptive and not related to Girder users.

Alright, I'll leave this information out of the app.

@subdavis
Copy link
Contributor

@jcfr
Copy link
Contributor Author

jcfr commented Jun 29, 2020

I'll fix routing.

🙏

Download button does nothing

See #6

@jcfr
Copy link
Contributor Author

jcfr commented Jun 29, 2020

After locally building the application:

export VUE_APP_APP_ID=5aa3da37f3eb080001497b3d
export VUE_APP_BASE_URL=http://192.168.113.208:8080/api/v1
yarn
yarn serve

Browsing to the following pages returns a blank page:

http://localhost:8080/#/catalog/All/29189/macos
http://localhost:8080/#/catalog/all/29189/macos

@subdavis
Copy link
Contributor

subdavis commented Jun 30, 2020

@jcfr There is no macos: https://github.com/girder/slicer_package_manager/blob/master/server/api/app.py#L435

It's macosx.

FWIW, macosx isn't a thing anymore, so the server should probably change to macos.

@jcfr
Copy link
Contributor Author

jcfr commented Jun 30, 2020

I tried these without success:

(Note that there are extensions for 29189 and macosx, see here)

Do you have an example of working URLs you could share ?

@subdavis
Copy link
Contributor

@jcfr Looks like the server is fixed. This app uses history mode, so the correct url is:

Note that all is case-insensitive, so either will work.

@jcfr
Copy link
Contributor Author

jcfr commented Jun 30, 2020

It works 🎉

@jcfr jcfr closed this as completed Jun 30, 2020
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

No branches or pull requests

2 participants