Skip to content

Conversation

@Manas-Kenge
Copy link
Collaborator

No description provided.

@Manas-Kenge Manas-Kenge requested a review from Copilot August 25, 2025 14:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an "Assign Workflow" dialog functionality that allows users to assign workflows to content types. The implementation includes a complete workflow assignment interface with proper form handling, validation, and feedback mechanisms.

  • Adds a new AssignWorkflow dialog component with content type selection and assignment logic
  • Updates the workflow data structure to include assignable content types
  • Implements backend support for retrieving assignable content types (those not already assigned to the workflow)

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
workflow.ts Adds TypeScript interfaces for assignable types and dialog props
AssignWorkflow.tsx New React component implementing the assignment dialog with form handling
ActionsToolbar.tsx Integrates the assign dialog into the workflow toolbar
workflow.ts (actions) Updates API endpoint path for workflow assignment
workflow.py Adds assignable_types to workflow serialization
base.py Implements backend logic to get assignable content types

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +86 to +91
} catch (error: any) {
toast.error(
<Toast
error
title={intl.formatMessage(messages.error)}
content={error.message || 'An unknown error occurred.'}
Copy link

Copilot AI Aug 25, 2025

Choose a reason for hiding this comment

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

Using 'any' type for error handling is not recommended. Consider using a more specific error type or 'unknown' type for better type safety.

Suggested change
} catch (error: any) {
toast.error(
<Toast
error
title={intl.formatMessage(messages.error)}
content={error.message || 'An unknown error occurred.'}
} catch (error: unknown) {
let errorMessage = 'An unknown error occurred.';
if (
error &&
typeof error === 'object' &&
'message' in error &&
typeof (error as { message?: unknown }).message === 'string'
) {
errorMessage = (error as { message: string }).message;
}
toast.error(
<Toast
error
title={intl.formatMessage(messages.error)}
content={errorMessage}

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Tishasoumya-02
Copy link
Collaborator

Tishasoumya-02 commented Aug 28, 2025

Screenshot 2025-08-28 at 11 02 25 AM

@Manas-Kenge Did you make any changes for the sidebar tabs here?

Also please remove the icon you are using for assign - it's misleading

@Manas-Kenge
Copy link
Collaborator Author

Screenshot 2025-08-28 at 11 02 25 AM @Manas-Kenge Did you make any changes for the sidebar tabs here?

Also please remove the icon you are using for assign - it's misleading

This PR was opened before working on the sidebar, that's why you can't see it. As for the icon which one should I use?

@Manas-Kenge Manas-Kenge merged commit b12a568 into test-1 Aug 28, 2025
6 of 9 checks passed
@Tishasoumya-02
Copy link
Collaborator

If it was working before than why you did have to use spectrum?

@Manas-Kenge
Copy link
Collaborator Author

What do you mean when you say use spectrum?

@Tishasoumya-02
Copy link
Collaborator

Tishasoumya-02 commented Aug 29, 2025

If the sidebar was working with volto components and styling before, why did you change it? ( I think you mentioned it to me earlier the reason but please re-iterate , maybe it has slipped from my mind)

@Manas-Kenge
Copy link
Collaborator Author

When this PR was opened, I hadn't started working on the sidebar yet. Since these changes are in different git branches, you can't see the updates from one branch in the other. That's why you're seeing the volto sidebar here instead of the spectrum sidebar.

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.

3 participants