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

Feature: Setup "Default Palette Modules" in a template #2295

Merged
merged 10 commits into from
Jun 20, 2023

Conversation

Steve-Mcl
Copy link
Contributor

@Steve-Mcl Steve-Mcl commented Jun 16, 2023

Description

Permit platform admin to setup templates with Default Palette Modules ready for new instance creation.

  • Some refactoring to reduce code duplication
    • Re-use the PaletteModules.vue section in a new page packages/flowforge/frontend/src/pages/admin/Template/Palette.vue
    • Move the logic for comparing editable vs original palette modules to packages/flowforge/frontend/src/pages/admin/Template/utils.js and export it as comparePaletteModules
  • Update server side logic in forge/db/controllers/ProjectTemplate.js validateSettings to also check palette.modules for duplicate names, invalid names, invalid versions (using same regex as frontend checks)
  • Add tests for all of the above
Project controller
    getRuntimeSettings
      ✔ does not merge template palette modules into runtime settings

  Project Template controller
    Validate Settings
      palette.modules
        ✔ accepts valid values
        ✔ rejects invalid name
        ✔ rejects invalid version
        ✔ rejects duplicate name

  Project API
    Create project
      ✔ Create a project // (modified to check palette modules are duplicated from template)
      ✔ Should not merge template modules into existing instance runtime settings

As far as I can see, adding modules are already mentioned in the docs

Related Issue(s)

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated NO see above
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on flowforge/helm to update ConfigMap Template
    • Issue/PR raised on flowforge/CloudProject to update values for Staging/Production

Labels

  • Backport needed? -> add the backport label
  • Includes a DB migration? -> add the area:migration label

@Steve-Mcl Steve-Mcl linked an issue Jun 16, 2023 that may be closed by this pull request
5 tasks
@Steve-Mcl Steve-Mcl requested a review from knolleary June 16, 2023 12:45
@Steve-Mcl Steve-Mcl marked this pull request as ready for review June 16, 2023 12:45
Copy link
Member

@knolleary knolleary left a comment

Choose a reason for hiding this comment

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

Looks good except for all the linting warnings to tidy up.

@Steve-Mcl
Copy link
Contributor Author

Looks good except for all the linting warnings to tidy up.

Urggg - Didn't even spot them 😄

Done now.

@Steve-Mcl Steve-Mcl requested a review from knolleary June 20, 2023 09:43
@Steve-Mcl
Copy link
Contributor Author

@knolleary all linting issues resolved and all tests passing now.

Re-review requested. Ta.

@knolleary knolleary merged commit 66a54df into main Jun 20, 2023
4 checks passed
@knolleary knolleary deleted the 2002-template-palette-modules branch June 20, 2023 14:53
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.

Allow setting preinstalled modules in templates
2 participants