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

[Task] Add version sorting, category filtering, and semantic versioning to Layout Templates #966

Open
maxcao13 opened this issue Apr 18, 2023 · 0 comments
Labels
chore Refactor, rename, cleanup, etc. feat New feature or request good first issue Good for newcomers

Comments

@maxcao13
Copy link
Member

maxcao13 commented Apr 18, 2023

Describe the feature

Since cryostat 2.3 is the first release where Layout Templates have been introduced, there was no need for version sorting or categorization. Next version 2.4 will probably need this new feature in case card configurations change over time.

Every release, this also requires the versioning for user-submitted templates to increase according to the semantic versioning of Cryostat itself.

in dashboard-utils.tsx

export enum LayoutTemplateVersion {
  'v2.3' = 'v2.3',
}

Next release we will need to update this to

export enum LayoutTemplateVersion {
  'v2.3' = 'v2.3',
  'v2.4' = 'v2.4',
}

and templatize will need to be changed so that transformation can be done to user-submitted templates:

export const templatize = (layout: DashboardLayout, name: string, desc?: string): LayoutTemplate => {
  return {
    name: name,
    description: desc || `Custom layout template.`,
    cards: layout.cards.map((card) => {
      const { id: _id, ...cardWithoutId } = card;
      return { ...cardWithoutId };
    }) as SerialCardConfig[],
    vendor: LayoutTemplateVendor.USER,
    version: LayoutTemplateVersion['v2.4'], // change to 2.4!
  } as LayoutTemplate;
};

The cryostat-dashboard-templates versions should also probably be changed even if there are no changes for next release.

@maxcao13 maxcao13 added chore Refactor, rename, cleanup, etc. feat New feature or request labels Apr 18, 2023
@tthvo tthvo added the good first issue Good for newcomers label Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Refactor, rename, cleanup, etc. feat New feature or request good first issue Good for newcomers
Projects
No open projects
Status: Stretch Goals
Development

No branches or pull requests

2 participants