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

Load Custom Profiles from URL #584

Open
11 tasks done
jwaspin opened this issue Aug 17, 2023 · 3 comments · May be fixed by #697
Open
11 tasks done

Load Custom Profiles from URL #584

jwaspin opened this issue Aug 17, 2023 · 3 comments · May be fixed by #697
Assignees
Labels
documentation Improvements or additions to documentation new feature Add new functionality not currently available profiles Update to mdEditor custom profile feature

Comments

@jwaspin
Copy link
Contributor

jwaspin commented Aug 17, 2023

Loading Dynamic Profiles

The current dynamic profile loading process includes the NGGDPP profiles by default. This is not desirable so we want to decouple those profiles from the core profiles.

Using an input box on the profiles' settings page, we can load a secondary set of profiles dynamically, which would allow for the use of anyone's custom profiles, so long as they are formatted as a proper manifest.json file.

Custom profiles loaded from the URL should be stored the same way other custom profiles are stored - noting that this is separate from how the core profiles are loaded.

Checklist:

  • mdProfiles ready
  • mdKeywords ready
  • environment variables updated to mdProfiles/mdKeywords master branches
    • keywordsBaseUrl
    • profilesBaseUrl
  • loading profiles from query parameter in url
  • profiles saved into persistent storage - same method as custom profiles are currently handled
  • prevent duplicates
  • Load custom thesauri from custom profiles
  • Thesaurus issue (# 1 below)
  • Hash URL issue (# 2 below)

Profile manifest file

A profile manifest file is a JSON file containing an array of one or more references to mdEditor profile definitions. The format is as follows:

[
  {
    "name": "definition name",
    "url": "url to profile definition"
  }
]

Example manifest file

[
  {
    "name": "AK Region Project Profile",
    "url": "https://usfws.github.io/ak-md-profiles/ak-proj-profile.json"
  },
  {
    "name": "AK Region Product Profile",
    "url": "https://usfws.github.io/ak-md-profiles/ak-proj-profile.json"
  }
]
@jwaspin jwaspin self-assigned this Aug 17, 2023
@jwaspin jwaspin linked a pull request Aug 28, 2023 that will close this issue
@jwaspin jwaspin added this to the v1.0.3 milestone Oct 26, 2023
@jwaspin
Copy link
Contributor Author

jwaspin commented Oct 30, 2023

This feature is complete but mdProfiles and mdKeywords need to be updated before merging this PR.

@hmaier-fws hmaier-fws added new feature Add new functionality not currently available profiles Update to mdEditor custom profile feature documentation Improvements or additions to documentation labels Dec 13, 2023
@hmaier-fws
Copy link
Contributor

@jwaspin I noticed two problems.

1) Thesaurus

I tried loading a manifest file from another location (https://raw.githubusercontent.com/hmaier-fws/ak-md-profiles/dev/ak-manifest.json) and received the following error:

TypeError: e.thesauri is not iterable (cannot read property undefined) at e.loadCustomProfilesFromUrl

It looks like it's trying to read thesauri. But not all custom profiles will have thesauri. I tried it with another manifest that pointed to profile definitions that had a null thesaurus array (https://raw.githubusercontent.com/hmaier-fws/ak-md-profiles/dev/ak-manifest2.json). That did work.

A check needs to be added that allows a definition without a thesaurus to be loaded. A profile definition file is not required to contain all sections.

2) URL hash

Loading the query parameter works fine from "/dashboard?loadProfilesFrom=" but it won't work from the hashed url "/#/dashboard?loadProfilesFrom=". The production version of the editor is served using a hashed url (https://go.mdeditor.org/#/).

@jwaspin
Copy link
Contributor Author

jwaspin commented Dec 15, 2023

@hmaier-fws Fixed both issues.

@jwaspin jwaspin removed this from the v1.3.0 milestone Feb 23, 2024
@jwaspin jwaspin changed the title Dynamic Load Custom Profiles from Query Param URL Load Custom Profiles from URL Oct 7, 2024
@jwaspin jwaspin linked a pull request Oct 7, 2024 that will close this issue
3 tasks
@jwaspin jwaspin linked a pull request Oct 7, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation new feature Add new functionality not currently available profiles Update to mdEditor custom profile feature
Projects
None yet
2 participants