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

WEB: Update ui related changes of console #306

Merged
merged 4 commits into from
Oct 1, 2024
Merged

Conversation

nxtCoder19
Copy link
Contributor

@nxtCoder19 nxtCoder19 commented Oct 1, 2024

Summary by Sourcery

Update the console UI by adding new GraphQL mutations for environment setup and user authentication with CAPTCHA support. Enhance the environment creation process with new radio types and improve avatar components for better UI representation. Refactor build tasks to support new Docker image configurations.

New Features:

  • Introduce a new mutation consoleSetupDefaultEnvironment to set up a default environment in the GraphQL queries.
  • Add support for CAPTCHA token in the authRequestResetPassword and authSignUpWithEmail mutations to enhance security.
  • Implement a new TemplateAvatar component for displaying template avatars with specific styling.

Enhancements:

  • Refactor the environment handling logic to support both 'compute' and 'template' radio types, allowing for more flexible environment creation.
  • Improve the ClusterSelectItem component by adding a disabled state to handle non-selectable clusters.
  • Update the Avatar component to support a new isTemplate prop for distinguishing template avatars.

Build:

  • Modify the Taskfile.yaml to include a new task container-push-dashboard for building and pushing Docker images with specific build arguments.

Copy link

sourcery-ai bot commented Oct 1, 2024

Reviewer's Guide by Sourcery

This pull request updates the UI-related changes for the console application. The changes include modifications to environment handling, account creation, authentication, and various UI components. Key updates involve the introduction of environment templates, changes to cluster selection, and adjustments to the signup and password reset processes.

Sequence Diagrams

Environment Creation Process

sequenceDiagram
    participant U as User
    participant UI as Console UI
    participant API as API Server
    U->>UI: Initiates environment creation
    UI->>U: Presents option for Environment or Template
    U->>UI: Selects option and provides details
    UI->>API: Sends creation request
    alt Environment selected
        API->>API: Creates new environment
    else Template selected
        API->>API: Creates new environment template
    end
    API->>UI: Returns creation result
    UI->>U: Displays confirmation
Loading

Signup Process with Captcha

sequenceDiagram
    participant U as User
    participant UI as Auth UI
    participant API as Auth API
    participant C as Captcha Service
    U->>UI: Enters signup details
    UI->>C: Requests captcha token
    C->>UI: Returns captcha token
    U->>UI: Submits signup form
    UI->>API: Sends signup request with captcha token
    API->>API: Validates captcha and creates account
    API->>UI: Returns signup result
    UI->>U: Displays confirmation or error
Loading

File-Level Changes

Change Details Files
Introduction of environment templates
  • Added a new radio button to choose between 'Environment' and 'Environment Template' when creating a new environment
  • Updated the environment list view to handle template environments differently
  • Modified the avatar component to support a template-specific style
src/apps/console/page-components/handle-environment.tsx
src/apps/console/routes/_main+/$account+/environments/environment-resources-v2.tsx
src/design-system/components/atoms/avatar.tsx
Updates to cluster selection and display
  • Modified the cluster selection process in environment creation
  • Updated the cluster list filtering to include all clusters, not just ready ones
  • Added a 'disabled' property to cluster select items
src/apps/console/page-components/handle-environment.tsx
src/apps/console/routes/_main+/$account+/environments/clone-environment.tsx
src/apps/console/routes/_main+/$account+/new-managed-service/_index.tsx
Enhancements to authentication processes
  • Added captcha token requirement for signup and password reset
  • Updated the signup mutation to include captcha token
  • Modified the password reset request to include captcha token
src/apps/auth/routes/_providers+/signup.tsx
src/apps/auth/routes/_main+/forgot-password.tsx
src/apps/auth/server/gql/saved-queries.ts
UI component updates
  • Added a 'direction' property to the Radio component to support horizontal layout
  • Updated the MultiStepProgress component to optionally hide step numbers
  • Modified the Avatar component to support a template-specific style
src/design-system/components/atoms/radio.tsx
src/apps/console/components/multi-step-progress.tsx
src/design-system/components/atoms/avatar.tsx
Updates to account and team creation process
  • Modified the new team creation process to navigate directly to environments after creation
  • Added a setup for default environment creation
  • Updated the cookie domain for development environment
src/apps/console/routes/_a+/new-team.tsx
src/apps/console/server/gql/queries/environment-queries.ts
Taskfile.yaml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @nxtCoder19 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The addition of environment templates is a great feature. However, could you please clarify the reason for removing the large chunk of IoT-related code? Was this intentional?
  • The changes to the authentication flow, particularly the CAPTCHA integration, are good security improvements. Nice work on that.
  • The UI improvements, such as the new TemplateAvatar component and changes to MultiStepProgress, should enhance the user experience. Consider adding some documentation for these new features to help other developers understand and use them effectively.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@@ -30,24 +30,24 @@ export const loader = async (ctx: IRemixCtx) => {
search: getSearch(ctx),
});

const { data: clusterData, errors: clusterErrors } = await GQLServerHandler(
Copy link

Choose a reason for hiding this comment

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

question: Commented out code for fetching cluster data

The code for fetching cluster data has been commented out. Is this intentional? If so, consider removing it entirely instead of leaving it commented out. If it's temporary, add a TODO comment explaining why it's commented out and when it should be re-enabled.

<ListItemV2 data={i.isArchived ? '' : i.clusterName} />
),
render: () => {
if (i.clusterName === '') {
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider using a constant for empty cluster name check

Instead of directly comparing with an empty string, consider using a constant like 'TEMPLATE_CLUSTER_NAME' set to an empty string. This would make the code more readable and easier to maintain if the representation of a template environment changes in the future.

const TEMPLATE_CLUSTER_NAME = '';

// ... (earlier in the file)

if (i.clusterName === TEMPLATE_CLUSTER_NAME) {

@nxtCoder19 nxtCoder19 merged commit e5c94c0 into release-v1.0.8 Oct 1, 2024
5 checks passed
@nxtCoder19 nxtCoder19 deleted the update/console branch October 2, 2024 06:03
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.

1 participant