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

Handle 2 workflows for 1 contenttype #30658

Merged
merged 26 commits into from
Nov 22, 2024
Merged

Conversation

oidacra
Copy link
Member

@oidacra oidacra commented Nov 14, 2024

This pull request includes several changes to improve the handling of workflow actions, update the styling of messages, and enhance the edit content form component. The most important changes include modifications to the workflow actions service, updates to the message component styles, and adjustments to the edit content form component.

Workflow Actions Service Enhancements:

  • Added a new interface DotCMSWorkflowActions to include the first step of the workflow (core-web/libs/data-access/src/lib/dot-workflows-actions/dot-workflows-actions.service.ts).
  • Updated the getDefaultActions method to return DotCMSWorkflowActions[] instead of DotCMSWorkflowAction[] (core-web/libs/data-access/src/lib/dot-workflows-actions/dot-workflows-actions.service.ts).
  • Added a new method getWorkFlowActions to retrieve workflow actions by content type name (core-web/libs/data-access/src/lib/dot-workflows-actions/dot-workflows-actions.service.ts).
  • Updated the test cases to use the new MOCK_SINGLE_WORKFLOW_ACTIONS and verify the new method getWorkFlowActions (core-web/libs/data-access/src/lib/dot-workflows-actions/dot-workflows-actions.service.spec.ts). [1] [2] [3]

Message Component Styling Updates:

  • Adjusted the base styles for inline messages to use transparent backgrounds and solid borders (core-web/libs/dotcms-scss/angular/dotcms-theme/components/messages/_message.scss).
  • Updated the styles for different types of inline messages (info, success, warn, error) to use color palette variables (core-web/libs/dotcms-scss/angular/dotcms-theme/components/messages/_message.scss).
  • Enhanced the styles for regular messages with a wider left border and updated styles for the close button (core-web/libs/dotcms-scss/angular/dotcms-theme/components/messages/_message.scss).

Edit Content Form Component Enhancements:

  • Added new signals to manage workflow actions and show/hide workflow actions in the form component (core-web/libs/edit-content/src/lib/components/dot-edit-content-form/dot-edit-content-form.component.html). [1] [2] [3]
  • Updated the test cases to include the new workflow actions and verify the rendering of workflow actions and sidebar toggle button (core-web/libs/edit-content/src/lib/components/dot-edit-content-form/dot-edit-content-form.component.spec.ts). [1] [2] [3] [4] [5] [6]

Additional Changes:

  • Added new properties to the DotCMSWorkflowAction interface to support various actionlets (core-web/libs/dotcms-models/src/lib/dot-workflow-action.model.ts).
  • Added a firstStep property to the DotCMSWorkflowStatus interface (core-web/libs/dotcms-models/src/lib/dot-workflow.model.ts).
  • Updated the project.json file to include a new linting tag (core-web/libs/data-access/project.json).

Checklist

  • Tests
  • Translations
  • Security Implications Contemplated (add notes if applicable)

Additional Info

** any additional useful context or info **

Screenshots

2 Workflows

CleanShot.2024-11-15.at.11.12.01.mp4

1 Workflow

CleanShot.2024-11-15.at.11.14.35.mp4

This PR fixes: #30596

@oidacra oidacra force-pushed the 30596-multiple-workflow-contentype branch from d764ead to 18015ae Compare November 14, 2024 18:29
@oidacra oidacra linked an issue Nov 15, 2024 that may be closed by this pull request
@oidacra oidacra force-pushed the 30596-multiple-workflow-contentype branch 2 times, most recently from c71b82f to 92c41cf Compare November 18, 2024 18:29
@oidacra oidacra marked this pull request as ready for review November 18, 2024 18:36
@nicobytes nicobytes requested a review from Copilot November 18, 2024 20:37

Choose a reason for hiding this comment

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

Copilot reviewed 21 out of 36 changed files in this pull request and generated no suggestions.

Files not reviewed (15)
  • core-web/libs/data-access/project.json: Language not supported
  • core-web/libs/dotcms-scss/angular/dotcms-theme/components/messages/_message.scss: Language not supported
  • core-web/libs/edit-content/src/lib/components/dot-edit-content-form/dot-edit-content-form.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/components/dot-edit-content-sidebar/components/dot-edit-content-sidebar-information/dot-edit-content-sidebar-information.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/components/dot-edit-content-sidebar/components/dot-edit-content-sidebar-workflow/dot-edit-content-sidebar-workflow.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/components/dot-edit-content-sidebar/components/dot-edit-content-sidebar-workflow/dot-edit-content-sidebar-workflow.component.scss: Language not supported
  • core-web/libs/edit-content/src/lib/components/dot-edit-content-sidebar/dot-edit-content-sidebar.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/feature/edit-content/edit-content.layout.component.html: Language not supported
  • core-web/libs/edit-content/src/lib/feature/edit-content/edit-content.layout.component.scss: Language not supported
  • core-web/libs/data-access/src/lib/dot-workflows-actions/dot-workflows-actions.service.spec.ts: Evaluated as low risk
  • core-web/libs/data-access/src/lib/dot-workflows-actions/dot-workflows-actions.service.ts: Evaluated as low risk
  • core-web/libs/dotcms-models/src/lib/dot-workflow-action.model.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/components/dot-edit-content-form/dot-edit-content-form.component.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/components/dot-edit-content-sidebar/components/dot-edit-content-sidebar-information/dot-edit-content-sidebar-information.component.spec.ts: Evaluated as low risk
  • core-web/libs/edit-content/src/lib/components/dot-edit-content-sidebar/dot-edit-content-sidebar.component.ts: Evaluated as low risk
@oidacra oidacra requested a review from rjvelazco November 19, 2024 02:17
@oidacra oidacra force-pushed the 30596-multiple-workflow-contentype branch from 9c0821e to e5c71bf Compare November 19, 2024 02:25
@oidacra oidacra dismissed stale reviews from fmontes, zJaaal, and nicobytes November 21, 2024 22:02

fixed comments

@oidacra oidacra force-pushed the 30596-multiple-workflow-contentype branch from 2734590 to bc57c7e Compare November 21, 2024 22:03
@oidacra oidacra enabled auto-merge November 21, 2024 22:05
@oidacra oidacra added this pull request to the merge queue Nov 22, 2024
Merged via the queue into main with commit eaa0f2e Nov 22, 2024
36 checks passed
@oidacra oidacra deleted the 30596-multiple-workflow-contentype branch November 22, 2024 17:50
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.

Select Workflow When Content Type Has Multiple Workflows Assigned
6 participants