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

UVE: Update state management to @ngrx/signalStore #28947

Closed
fmontes opened this issue Jun 19, 2024 · 5 comments · Fixed by #29239, #29416 or #29490
Closed

UVE: Update state management to @ngrx/signalStore #28947

fmontes opened this issue Jun 19, 2024 · 5 comments · Fixed by #29239, #29416 or #29490

Comments

@fmontes
Copy link
Member

fmontes commented Jun 19, 2024

Task description

The UI state of the UVE is huge and changes a lot, is global, it affects layout, properties, and other sections. So far, we have been managing that state with, but that library is not made for that, which we already are causing problems and is difficult to scale.

We need to use a better state management library for the UVE before it is too late.

Acceptance Criteria

  • The global UVE state management should use @ngrx/signalStore.
  • Local state management remains with @ngrx/component-store
  • The updated UVE functions seamlessly without any errors or disruptions.

External Links

N/A

Assumptions & Initiation Needs

N/A

Quality Assurance Notes & Workarounds

N/A

Sub-Tasks & Estimates

N/A

@fmontes fmontes moved this from New to Future in dotCMS - Product Planning Jun 19, 2024
@fmontes fmontes moved this from Future to Next 1-3 Sprints in dotCMS - Product Planning Jul 8, 2024
@zJaaal zJaaal self-assigned this Jul 10, 2024
@nollymar nollymar moved this from Next 1-3 Sprints to Current Sprint Backlog in dotCMS - Product Planning Jul 11, 2024
@zJaaal zJaaal moved this from Current Sprint Backlog to In Progress in dotCMS - Product Planning Jul 15, 2024
@fmontes fmontes changed the title UVE: Update state management to @ngrx/store UVE: Update state management to @ngrx/signalStore Jul 15, 2024
@fmontes
Copy link
Member Author

fmontes commented Jul 15, 2024

After meeting this is a possible schema for the state:

const shellState = {
  section: 'content | layout | rules | experiments', // ng handles this
  params: {
    language: 1,
    persona: 'default',
    variant: 'default'
  },
  menu: [
    {
      name: 'Content',
      href: '/content',
      selected: true,
      enable: true,
      tooltip: null
    },
    {
      name: 'Layout',
      href: '/Layout',
      selected: false,
      enable: false,
      tooltip: 'You don\'t have a license'
    },
    {
      name: 'Rules',
      href: '/rules',
      selected: false,
      enable: false,
      tooltip: 'You don\'t have a license'
    }
  ]
}

const editorState = {
  toolbar: {
    enable: true,
    items: [
      {
        id: 'preview',
        label: 'Preview',
        enable: true
      },
      {
        id: 'copy-url',
        label: 'Copy URL',
        enable: true
      },
      {
        id: 'api',
        label: 'API',
        enable: true
      },
      {
        id: 'edit-content',
        label: 'Edit Content',
        enable: true
      }
    ],
    selectors: [
      {
        id: 'language',
        label: 'Language',
        enable: true,
      },
      {
        id: 'persona',
        label: 'persona',
        enable: true,
      }
    ],
    actions: [
      {
        id: 'workflow',
        label: 'Workflow',
        enable: true
      },
      {
        id: 'unlock',
        label: 'Unlock',
        enable: true
      }
    ]
  },
  iframe: {
    src: '{clientHost}/{path}',
    enable: true,
    width: '100%',
    height: '100%',
    pointerEvents: 'auto', // might be a bool
    opacity: 1
  },
  progressBar: {
    show: true,
  },
  contentletTools: {
    active: true,
    area: {
      x: 0,
      y: 0,
      width: 100,
      height: 100
    },
    contentlet: {
      title: 'Contentlet',
      inode: '1234',
      identifier: 'contentlet-1234',
    }
  },
  dropzone: {
    active: true,
    dragItem: {
      title: 'Contentlet',
      inode: '1234',
      identifier: 'contentlet-1234',
      // mini contentlet
    },
    bounds: [
      {
        x: 0,
        y: 0,
        width: 100,
        height: 100
      },
      {
        x: 0,
        y: 0,
        width: 100,
        height: 100
      }
    ]
  },
  palette: {
    variant: 'default',
    language: 1,
    containers: []
  },
  infoBox: {
    closable: true,
    message: {
      icon: 'info',
      text: 'This is a message'
    }
  }
}

github-merge-queue bot pushed a commit that referenced this issue Jul 27, 2024
# Proposed Changes

- Rewrite and apply new architecture to the Old Store to make it work
with the new Signal Store and Custom Features. Use Computed Signals as a
Reflection of the UI and State and Methods as source of information.
- Centralize reusable code
- Minimize the logic responsibility of the components to make them more
simple and more readable
- Replace all `ngFor` `ngIf` and `ngSwitch` for the new angular syntax
- Add missing `themeId` on layout payload
- Add missing functionality to fetch personas on page navigation
- Add validation to replace urls from `/` to `index` to maintain
consistency
- Remove not natural reloads, extra calls to functions and anti-patterns
- Fix inconsistencies across shared logic 
- Remove logic from the templates 
- Overall cleaning of the code to minimize tech debt 
- Fix out of place message for No Contentlets in Palette 
- Enhance overall perfomance of the tool
- Fix internal navigation for Traditional Pages (VTL)
- Enhance and minimize logic for Inline Editing (It was colliding with
the navigation for Traditional Pages)
- Add `SCROLLING` state to the Editor
- Remove not necessary `MODE` from the editor, since now our store is a
reflection of the UI
- Separate `status` of the UVE from `state` of the editor to enhance
reloads and the natural cycle of the tool
- Remove all calls to `queryParams` from the router, since params now
live in the store and are in sync with the url
- Remove all references of old `EmaStore`
- Remove not needed `Enums`, `Types`, `Interfaces` and `Mocks`
@github-project-automation github-project-automation bot moved this from In Progress to Internal QA in dotCMS - Product Planning Jul 27, 2024
@fmontes
Copy link
Member Author

fmontes commented Jul 30, 2024

Image

@nollymar
Copy link
Contributor

nollymar commented Aug 5, 2024

Internal QA: Failed

@fmontes found a related error. More details on this thread

@nollymar nollymar moved this from Internal QA to Current Sprint Backlog in dotCMS - Product Planning Aug 5, 2024
@valentinogiardino valentinogiardino moved this from Current Sprint Backlog to In Progress in dotCMS - Product Planning Aug 7, 2024
@valentinogiardino valentinogiardino moved this from In Progress to In Review in dotCMS - Product Planning Aug 7, 2024
@github-project-automation github-project-automation bot moved this from In Review to Internal QA in dotCMS - Product Planning Aug 7, 2024
@github-project-automation github-project-automation bot moved this from Internal QA to Current Sprint Backlog in dotCMS - Product Planning Aug 8, 2024
@valentinogiardino valentinogiardino moved this from Current Sprint Backlog to Internal QA in dotCMS - Product Planning Aug 8, 2024
@valentinogiardino valentinogiardino removed their assignment Aug 8, 2024
@KevinDavilaDotCMS
Copy link
Contributor

Passed IQA

Tested in master
We have some issues:
#29569
#29570
#29572
#29590

that will be resolved in other tickets, and the mainly functionallity of UVE in this ticket is working

Screen.Recording.2024-08-14.at.2.37.20.PM.mov

@KevinDavilaDotCMS KevinDavilaDotCMS moved this from Internal QA to QA - Backlog in dotCMS - Product Planning Aug 14, 2024
@bryanboza
Copy link
Member

Fixed, we can close this for now and handle all the new issues in individual cards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment