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 changes in websiite #296

Merged
merged 26 commits into from
Sep 23, 2024
Merged

Conversation

nxtCoder19
Copy link
Contributor

@nxtCoder19 nxtCoder19 commented Sep 17, 2024

Summary by Sourcery

Update the website with new webinar UI components, enhance existing components with additional data handling, and improve documentation by adding onboarding content and removing outdated AI & ML workflows information.

New Features:

  • Introduce a new 'WebinarUI' component for handling webinar-related UI elements, including registration and joining functionalities.
  • Add a new 'Container' component to provide a consistent layout structure with a header for the webinar application.
  • Implement a new 'Header' component to display the brand logo and navigation options in the webinar application.

Enhancements:

  • Update various labels and descriptions in the constants file to improve clarity and user understanding.
  • Refactor the 'AppSelectItem' component to include additional information such as registry and repository details.
  • Enhance the 'AppGeneral' and 'AppDetail' components to handle optional registry and repository data more gracefully.

Documentation:

  • Add a new onboarding documentation page to guide users through the initial setup and usage of the platform.
  • Remove the outdated AI & ML workflows documentation page and replace it with updated onboarding content.

Chores:

  • Update the pnpm-lock.yaml file to reflect changes in dependencies, including version updates and new additions.

Copy link

sourcery-ai bot commented Sep 17, 2024

Reviewer's Guide by Sourcery

This pull request updates various components and configurations across the Kloudlite application. Key changes include updating dependencies, modifying UI components, refactoring code, and adjusting content in multiple files.

File-Level Changes

Change Details Files
Updated dependencies and configurations
  • Updated pnpm-lock.yaml with new package versions and dependencies
  • Modified base-url.cjs to include COOKIE_DOMAIN in client and server environments
  • Updated package.json with new dependencies and versions
src/apps/devdoc/pnpm-lock.yaml
lib/configs/base-url.cjs
src/design-system/pnpm-lock.yaml
Refactored and updated UI components
  • Modified AppGeneral component to use TextInput instead of Select for image name
  • Updated AppDetail component similarly to AppGeneral
  • Refactored WebinarUI component and added HandleRegisterForm
  • Created new components: Header, Container, and Wrapper for the webinar app
src/apps/console/page-components/app/general.tsx
src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-detail.tsx
src/apps/webinar/src/app/orgs/webinar-ui.tsx
src/apps/webinar/src/app/components/header.tsx
src/apps/webinar/src/app/components/container.tsx
src/apps/webinar/src/app/components/wrapper.tsx
Updated content and labels
  • Changed 'Integrated resources' to 'Managed resources' in multiple files
  • Updated FAQ section labels and content
  • Modified kloudliteDevelopmentData in const.tsx
  • Updated metadata title in webinar app layout
src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-config-mount.tsx
src/apps/console/routes/_main+/$account+/env+/$environment+/new-app/app-environment-variables.tsx
src/apps/devdoc/web/utils/const.tsx
src/apps/devdoc/pages/docs/faq/_meta.json
src/apps/webinar/src/app/layout.tsx
Removed and added files
  • Removed ai-ml-workflows.mdx
  • Added onboarding.mdx to replace ai-ml-workflows content
  • Added new components for the webinar app
src/apps/devdoc/pages/docs/faq/ai-ml-workflows.mdx
src/apps/devdoc/pages/docs/faq/onboarding.mdx
src/apps/webinar/src/app/orgs/webinar-ui.tsx
src/apps/webinar/src/app/components/header.tsx
src/apps/webinar/src/app/components/container.tsx
src/apps/webinar/src/app/components/wrapper.tsx

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

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 and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 2 issues found
  • 🟢 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 to tell me if it was helpful.

@@ -64,12 +63,25 @@ import { handleError } from '~/root/lib/utils/common';
// return <ResourceExtraAction options={options} />;
// };

const AppSelectItem = ({ label, value }: { label: string; value: string }) => {
const AppSelectItem = ({
Copy link

Choose a reason for hiding this comment

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

issue (complexity): Consider simplifying the AppSelectItem component and reintroducing the Select component for image selection.

The changes introduce unnecessary complexity in the AppSelectItem component and remove useful functionality in the AppGeneral component. Here are suggestions to simplify the code while maintaining the intended functionality:

  1. Simplify AppSelectItem:
const AppSelectItem = ({
  label,
  value,
  registry,
  repository,
}: {
  label: string;
  value: string;
  registry?: string;
  repository?: string;
}) => {
  const registryInfo = registry && repository ? `${registry}/${repository}` : value;
  return (
    <div>
      <div className="flex flex-col">
        <div>{label}</div>
        <div className="bodySm text-text-soft">{registryInfo}</div>
      </div>
    </div>
  );
};

This simplification removes the conditional rendering and always displays either the registry/repository information or the value, making the component more straightforward.

  1. Reintroduce the Select component for image selection in AppGeneral:
<Select
  label="Select Images"
  size="lg"
  value={values.imageUrl}
  placeholder="Select an image"
  creatable
  options={async () => imageList}
  onChange={({ value }) => {
    handleChange('imageUrl')(dummyEvent(value));
  }}
  showclear
  noOptionMessage={
    <div className="p-2xl bodyMd text-center">
      Search for image or enter image name
    </div>
  }
  error={!!errors.imageUrl}
  message={errors.imageUrl}
  loading={imageLoaded}
  createLabel="Select"
/>

This change brings back the Select component, which provides better UX for image selection while maintaining the ability to enter custom image names.

These modifications simplify the code, improve maintainability, and preserve the intended functionality without unnecessary complexity.




export const WebinarUI = ({ userDetails, meetingStatus }: { userDetails: any, meetingStatus: string }) => {
Copy link

Choose a reason for hiding this comment

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

issue (complexity): Consider simplifying the component structure and removing unused code.

The current implementation introduces unnecessary complexity. Consider the following improvements:

  1. Remove unused imports and commented-out code:
"use client";

import { Button } from 'kl-design-system/atoms/button';
import { TextInput } from 'kl-design-system/atoms/input';
import Popup from 'kl-design-system/molecule/popup';
import { cn } from 'kl-design-system/utils';
import { useState } from 'react';
import Container from '../components/container';
import { JoinWebinar } from '../components/join-webinar';

// Rest of the code...
  1. Simplify the HandleRegisterForm component:
const HandleRegisterForm = ({ visible, setVisible }: { visible: boolean, setVisible: (v: boolean) => void }) => {
    const handleSubmit = (e: React.FormEvent) => {
        e.preventDefault();
        // Add form submission logic here
        setVisible(false);
    };

    return (
        <Popup.Form onSubmit={handleSubmit}>
            <Popup.Content>
                <div className="flex flex-col gap-2xl">
                    <TextInput
                        label="Full name"
                        size="lg"
                        placeholder="Enter your full name"
                        // Add necessary props like value and onChange
                    />
                    {/* Add other form fields as needed */}
                </div>
            </Popup.Content>
            <Popup.Footer>
                <Popup.Button closable content="Cancel" variant="basic" onClick={() => setVisible(false)} />
                <Popup.Button
                    type="submit"
                    content="Register"
                    variant="primary"
                />
            </Popup.Footer>
        </Popup.Form>
    );
};
  1. If you need placeholders for future functionality, consider using TODO comments instead of large blocks of commented-out code. For example:
// TODO: Add validation schema
// TODO: Implement form submission logic

These changes will significantly reduce the complexity of the code while maintaining its core functionality. Remember to implement only the features that are currently needed, and use version control and documentation for future plans rather than keeping large blocks of commented-out code.

@nxtCoder19 nxtCoder19 merged commit e3574b3 into release-v1.0.5 Sep 23, 2024
3 of 5 checks passed
@nxtCoder19 nxtCoder19 deleted the webinar/registration branch September 23, 2024 07:29
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.

2 participants