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

584 dynamic load custom profiles from query param url #593

Closed

Conversation

jwaspin
Copy link
Contributor

@jwaspin jwaspin commented Aug 28, 2023

Closes
#584

Testing

http://23.23.4.125:8002/ [DOWN FOR MAINTENANCE]

Query Parameter Usage

http://23.23.4.125:8002/dashboard?loadProfilesFrom=https://raw.githubusercontent.com/USGS-NGGDPP/mdEditor-profiles/main/manifest.json
OR for hashed URLs
http://23.23.4.125:8002/#/dashboard?loadProfilesFrom=https://raw.githubusercontent.com/USGS-NGGDPP/mdEditor-profiles/main/manifest.json

Changes

Increase minor version number

  • Remove NGGDPP profiles from core profiles
  • New feature: load profiles using query parameter
  • Refactored
    • environment variables for manifest file urls
    • keyword service
    • profile service
    • custom-profile model & service
    • thesaurus route & dropdown menu component

Breaking Changes

By removing the functionality to automatically load NGGDPP profiles, anyone using those profiles will need to re-load them using the query parameter. The profiles in the NGGDPP repository have a slightly different format because of other changes being made, but if the user re-selects a profile after loading them from the query parameter, that should, in theory, fix the record. This should also be a limited impact because the profiles have not existed as core profiles for very long.

This change is temporary and needs to be overwritten
once mdProfiles changes are available in the master branch.
NGGDPP profiles have been isolated from the core profiles in
mdProfiles (not yet in master branch).
Using the query parameter "loadProfilesFrom" with a URL to
the profiles list file, this change will load those profiles in the
same way as the core profiles are loaded.
@jwaspin jwaspin linked an issue Aug 28, 2023 that may be closed by this pull request
11 tasks
@jwaspin jwaspin marked this pull request as draft August 28, 2023 18:39
jwaspin added 24 commits August 28, 2023 12:39
Loading the custom profile into the store needed
to be wrapped in a config object.
Change URLs to base URLs.
Add manifestPath variable.
Update loadVocabularies to use async/await.
Not done yet, but major improvements here.
Profiles is now just loading core profiles.
Custom-profiles is loading profiles from the query paramter.
Convert Ember functions to native JavaScript
and change yield to async/await.
Saving progress in loadCustomProfilesFromUrl.
When adding custom profiles from a url query parameter,
the store is checked for existing records before adding new profiles.
@jwaspin jwaspin marked this pull request as draft December 6, 2023 18:22
@jwaspin jwaspin marked this pull request as ready for review December 11, 2023 21:53
@jwaspin jwaspin requested a review from hmaier-fws December 11, 2023 21:55
@hmaier-fws
Copy link
Contributor

@jwaspin I'm going to change this PR to draft pending the thesaurus issue described in #584

@hmaier-fws hmaier-fws marked this pull request as draft December 13, 2023 20:54
Code formatting.
Fix bug related to profiles without thesauri object.
@jwaspin
Copy link
Contributor Author

jwaspin commented Dec 15, 2023

@hmaier-fws Fixed the bugs and redeployed the test container on :8002 so that's good to go for testing.

@jwaspin jwaspin marked this pull request as ready for review December 15, 2023 18:23
@hmaier-fws
Copy link
Contributor

@jwaspin There is a problem reading the name and description of existing custom profiles.

Steps to recreate:

  1. import existing custom profiles via "Import mdJSON from Online URL" using this example file: https://raw.githubusercontent.com/hmaier-fws/ak-md-profiles/dev/ak-profile-pkg-test-20231218.json
  2. Select "Preview JSON" for a custom profile and note that a "title" and "description" are present.
  3. Create a new metadata record.
  4. Change profile from "Full".
  5. The Profile picklist displays three blank entries.
  6. The "Manage Profiles" screen does not display the titles.
  7. Selecting a profile's "Edit" button shows that neither a title nor description are present.

The title and definitions should be obtained from the mdEditor JSON object of type "type": "custom-profiles". The current information seems to be coming from the "profile definition" file (mdEditor JSON object "type": "profiles").

A Custom profile is a combination of a profile definition and schema. If a schema is not provided (as in the case of the test query parameter) then the default schema is applied. A single profile definition can be used in combination with multiple schemas, resulting in multiple custom profiles.

@hmaier-fws hmaier-fws marked this pull request as draft December 18, 2023 23:23
@jwaspin
Copy link
Contributor Author

jwaspin commented Mar 18, 2024

@hmaier-fws I went all the way back to v0.11.0-dev.2 and found that this issue has existed for a while and is not being introduced by this commit.

@jwaspin
Copy link
Contributor Author

jwaspin commented Oct 4, 2024

@hmaier-fws I'm closing this PR because the PR from branch feature/load-profiles-from-url is replacing it and the feature is no longer loading from a query parameter, I added an input box and a button instead.

Importantly, I did more than just fix the issue you mentioned here, the bug was deeper so I fixed it completely.

@jwaspin jwaspin closed this Oct 4, 2024
@jwaspin
Copy link
Contributor Author

jwaspin commented Oct 7, 2024

Replaced by #697

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.

Load Custom Profiles from URL
2 participants