From aa9b18a855ab61fef908e02f9772726c4e9bb59e Mon Sep 17 00:00:00 2001 From: Drish-xD Date: Wed, 4 Sep 2024 02:03:41 +0530 Subject: [PATCH 1/3] chore: formatted the code using prettier --- .github/ISSUE_TEMPLATE/c4gt_community.yml | 486 +++++++++--------- jest.setup.ts | 3 +- src/app/(home)/QuizColumns.tsx | 6 +- src/app/(home)/Table/Actions.tsx | 36 +- src/app/(home)/Table/Filters.tsx | 36 +- src/app/(home)/Table/Pagination.tsx | 12 +- src/app/(home)/Table/Row.tsx | 24 +- src/app/(home)/Table/index.tsx | 2 +- src/app/(home)/live/LiveColumns.tsx | 6 +- src/app/(home)/loading.tsx | 4 +- src/app/layout.tsx | 6 +- src/app/loading.tsx | 4 +- src/app/not-found.tsx | 2 +- .../session/[type]/Steps/Timeline/index.tsx | 4 +- src/app/session/[type]/Steps/index.tsx | 4 +- src/app/session/page.tsx | 2 +- src/components/FormBuilder.tsx | 14 +- src/components/Navbar.tsx | 18 +- src/components/ui/calendar.tsx | 8 +- src/components/ui/checkbox.tsx | 6 +- src/components/ui/command.tsx | 10 +- src/components/ui/date-time.tsx | 22 +- src/components/ui/dialog.tsx | 6 +- src/components/ui/dropdown-menu.tsx | 10 +- src/components/ui/multi-select.tsx | 18 +- src/components/ui/select.tsx | 16 +- src/components/ui/sheet.tsx | 6 +- src/components/ui/stepper.tsx | 6 +- src/components/ui/switch.tsx | 2 +- src/components/ui/table.tsx | 2 +- src/components/ui/time-picker.tsx | 26 +- src/hooks/usePolling.tsx | 84 +-- 32 files changed, 445 insertions(+), 446 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/c4gt_community.yml b/.github/ISSUE_TEMPLATE/c4gt_community.yml index 5bb83d3..6864fb8 100644 --- a/.github/ISSUE_TEMPLATE/c4gt_community.yml +++ b/.github/ISSUE_TEMPLATE/c4gt_community.yml @@ -1,243 +1,243 @@ -name: C4GT Community Template -description: Create a new Ticket for C4GT Community -title: '[C4GT Community]: ' -labels: ['C4GT Community'] -body: - - type: textarea - id: ticket-description - validations: - required: true - attributes: - label: Ticket Contents - value: | - ## Description - [Provide a brief project description, outlining the need and measurable goals of the feature to be developed. Kindly, specify the number of users or scale of the product and feature, articulating its anticipated impact and intended use.] - - - type: textarea - id: ticket-goals - validations: - required: true - attributes: - label: Goals - description: List the goals of the feature. - value: | - ## Goals - - [ ] [Goal 1] - - [ ] [Goal 2] - - [ ] [Goal 3] - - [ ] [Goal 4] - - [ ] [Goal 5] - - [ ] [Midpoint Milestone] - [Please also specify the Mid-point milestones- goals that must be achieved by 1.5 months into the coding period. Kindly, state and link installation guide/ set-up steps (if any) in this section] - - - type: textarea - id: ticket-expected-outcome - validations: - required: true - attributes: - label: Expected Outcome - description: Describe in detail what the final product or result should look like and how it should behave. - - - type: textarea - id: ticket-acceptance-criteria - attributes: - label: Acceptance Criteria - description: List the acceptance criteria for this feature. - - - type: textarea - id: ticket-implementation-details - validations: - required: true - attributes: - label: Implementation Details - description: List any technical details about the proposed implementation, including any specific technologies that will be used. - - - type: textarea - id: ticket-mockups - attributes: - label: Mockups/Wireframes - description: Include links to any visual aids, mockups, wireframes, or diagrams that help illustrate what the final product should look like. This is not always necessary, but can be very helpful in many cases. - - - type: input - id: ticket-product - attributes: - label: Product Name - placeholder: Enter Product Name - validations: - required: true - - - type: dropdown - id: ticket-organisation - attributes: - label: Organisation Name - description: Enter Organisation Name - multiple: false - options: - - C4GT - - Dhiway - - FIDE - - SamagraX - - ShikshaLokam - - Tech4Dev - - Tibil - - Avanti Fellows - validations: - required: true - - - type: input - id: ticket-governance-domain - attributes: - label: Domain - placeholder: Enter Area of Governance - - - type: dropdown - id: ticket-technical-skills-required - attributes: - label: Tech Skills Needed - description: Select the technologies needed for this ticket (use Ctrl or Command to select multiple) - multiple: true - options: - - .NET - - Agile - - Angular - - Artificial Intelligence - - ASP.NET - - AWS - - Babel - - Bootstrap - - C# - - Chart.js - - CI/CD - - Computer Vision - - CORS - - cURL - - Cypress - - D3.js - - Database - - Debugging - - Design - - DevOps - - Django - - Docker - - Electron - - ESLint - - Express.js - - Feature - - Flask - - Go - - GraphQL - - HTML - - Ionic - - Jest - - Java - - JavaScript - - Jenkins - - JWT - - Kubernetes - - Laravel - - Machine Learning - - Maintenance - - Markdown - - Material-UI - - Microservices - - MongoDB - - Mobile - - Mockups - - Mocha - - Natural Language Processing - - NestJS - - Node.js - - NUnit - - OAuth - - Performance Improvement - - Prettier - - Python - - Question - - React - - React Native - - Redux - - RESTful APIs - - Ruby - - Ruby on Rails - - Rust - - Scala - - Security - - Selenium - - SEO - - Serverless - - Solidity - - Spring Boot - - SQL - - Swagger - - Tailwind CSS - - Test - - Testing Library - - Three.js - - TypeScript - - UI/UX/Design - - Virtual Reality - - Vue.js - - WebSockets - - Webpack - - Other - validations: - required: true - - - type: textarea - id: ticket-mentors - attributes: - label: Mentor(s) - description: Please tag relevant mentors for the ticket - validations: - required: true - - - type: dropdown - id: ticket-complexity - attributes: - label: Complexity - description: Choose a complexity describing the complexity of your ticket - multiple: false - options: - - Low - - Medium - - High - validations: - required: true - - - type: dropdown - id: ticket-category - attributes: - label: Category - description: Choose the categories that best describe your ticket - multiple: true - options: - - API - - Analytics - - Accessibility - - Backend - - Breaking Change - - Beginner Friendly - - Configuration - - CI/CD - - Database - - Data Science - - Deprecation - - Documentation - - Delpoyment - - Frontend - - Internationalization - - Localization - - Machine Learning - - Maintenance - - Mobile - - Performance Improvement - - Question - - Refactoring - - Research - - Needs Reproduction - - SEO - - Security - - Testing - - Other - validations: - required: true +name: C4GT Community Template +description: Create a new Ticket for C4GT Community +title: '[C4GT Community]: ' +labels: ['C4GT Community'] +body: + - type: textarea + id: ticket-description + validations: + required: true + attributes: + label: Ticket Contents + value: | + ## Description + [Provide a brief project description, outlining the need and measurable goals of the feature to be developed. Kindly, specify the number of users or scale of the product and feature, articulating its anticipated impact and intended use.] + + - type: textarea + id: ticket-goals + validations: + required: true + attributes: + label: Goals + description: List the goals of the feature. + value: | + ## Goals + - [ ] [Goal 1] + - [ ] [Goal 2] + - [ ] [Goal 3] + - [ ] [Goal 4] + - [ ] [Goal 5] + - [ ] [Midpoint Milestone] + [Please also specify the Mid-point milestones- goals that must be achieved by 1.5 months into the coding period. Kindly, state and link installation guide/ set-up steps (if any) in this section] + + - type: textarea + id: ticket-expected-outcome + validations: + required: true + attributes: + label: Expected Outcome + description: Describe in detail what the final product or result should look like and how it should behave. + + - type: textarea + id: ticket-acceptance-criteria + attributes: + label: Acceptance Criteria + description: List the acceptance criteria for this feature. + + - type: textarea + id: ticket-implementation-details + validations: + required: true + attributes: + label: Implementation Details + description: List any technical details about the proposed implementation, including any specific technologies that will be used. + + - type: textarea + id: ticket-mockups + attributes: + label: Mockups/Wireframes + description: Include links to any visual aids, mockups, wireframes, or diagrams that help illustrate what the final product should look like. This is not always necessary, but can be very helpful in many cases. + + - type: input + id: ticket-product + attributes: + label: Product Name + placeholder: Enter Product Name + validations: + required: true + + - type: dropdown + id: ticket-organisation + attributes: + label: Organisation Name + description: Enter Organisation Name + multiple: false + options: + - C4GT + - Dhiway + - FIDE + - SamagraX + - ShikshaLokam + - Tech4Dev + - Tibil + - Avanti Fellows + validations: + required: true + + - type: input + id: ticket-governance-domain + attributes: + label: Domain + placeholder: Enter Area of Governance + + - type: dropdown + id: ticket-technical-skills-required + attributes: + label: Tech Skills Needed + description: Select the technologies needed for this ticket (use Ctrl or Command to select multiple) + multiple: true + options: + - .NET + - Agile + - Angular + - Artificial Intelligence + - ASP.NET + - AWS + - Babel + - Bootstrap + - C# + - Chart.js + - CI/CD + - Computer Vision + - CORS + - cURL + - Cypress + - D3.js + - Database + - Debugging + - Design + - DevOps + - Django + - Docker + - Electron + - ESLint + - Express.js + - Feature + - Flask + - Go + - GraphQL + - HTML + - Ionic + - Jest + - Java + - JavaScript + - Jenkins + - JWT + - Kubernetes + - Laravel + - Machine Learning + - Maintenance + - Markdown + - Material-UI + - Microservices + - MongoDB + - Mobile + - Mockups + - Mocha + - Natural Language Processing + - NestJS + - Node.js + - NUnit + - OAuth + - Performance Improvement + - Prettier + - Python + - Question + - React + - React Native + - Redux + - RESTful APIs + - Ruby + - Ruby on Rails + - Rust + - Scala + - Security + - Selenium + - SEO + - Serverless + - Solidity + - Spring Boot + - SQL + - Swagger + - Tailwind CSS + - Test + - Testing Library + - Three.js + - TypeScript + - UI/UX/Design + - Virtual Reality + - Vue.js + - WebSockets + - Webpack + - Other + validations: + required: true + + - type: textarea + id: ticket-mentors + attributes: + label: Mentor(s) + description: Please tag relevant mentors for the ticket + validations: + required: true + + - type: dropdown + id: ticket-complexity + attributes: + label: Complexity + description: Choose a complexity describing the complexity of your ticket + multiple: false + options: + - Low + - Medium + - High + validations: + required: true + + - type: dropdown + id: ticket-category + attributes: + label: Category + description: Choose the categories that best describe your ticket + multiple: true + options: + - API + - Analytics + - Accessibility + - Backend + - Breaking Change + - Beginner Friendly + - Configuration + - CI/CD + - Database + - Data Science + - Deprecation + - Documentation + - Delpoyment + - Frontend + - Internationalization + - Localization + - Machine Learning + - Maintenance + - Mobile + - Performance Improvement + - Question + - Refactoring + - Research + - Needs Reproduction + - SEO + - Security + - Testing + - Other + validations: + required: true diff --git a/jest.setup.ts b/jest.setup.ts index 4112642..7b0828b 100644 --- a/jest.setup.ts +++ b/jest.setup.ts @@ -1,2 +1 @@ -import '@testing-library/jest-dom'; - +import '@testing-library/jest-dom'; diff --git a/src/app/(home)/QuizColumns.tsx b/src/app/(home)/QuizColumns.tsx index da5cca4..a08fd39 100644 --- a/src/app/(home)/QuizColumns.tsx +++ b/src/app/(home)/QuizColumns.tsx @@ -21,7 +21,7 @@ export const columns: ColumnDef[] = [ { accessorKey: 'platform', header: 'Platform', - cell: ({ row }) =>
{row.getValue('platform')}
, + cell: ({ row }) =>
{row.getValue('platform')}
, }, { id: 'group', @@ -84,9 +84,9 @@ export const columns: ColumnDef[] = [ header: 'Enabled', cell: ({ row }) => row.getValue('isEnabled') ? ( - + ) : ( - + ), }, { diff --git a/src/app/(home)/Table/Actions.tsx b/src/app/(home)/Table/Actions.tsx index 1517473..92b7557 100644 --- a/src/app/(home)/Table/Actions.tsx +++ b/src/app/(home)/Table/Actions.tsx @@ -17,34 +17,34 @@ const TableActions = ({ session }: { session: Session }) => { return ( - e.stopPropagation()}> Edit - + Duplicate ); }; diff --git a/src/app/(home)/Table/Filters.tsx b/src/app/(home)/Table/Filters.tsx index a8001f9..d2c7bed 100644 --- a/src/app/(home)/Table/Filters.tsx +++ b/src/app/(home)/Table/Filters.tsx @@ -79,19 +79,19 @@ const Filters = ({ table, apiOptions }: { table: Table; apiOptions: Api }, [table.getState().columnFilters]); return ( -
-
+
+
{filterColumns.map((column) => { return ( - - - + + Filter By {column.label} @@ -99,10 +99,10 @@ const Filters = ({ table, apiOptions }: { table: Table; apiOptions: Api value={(table.getColumn(column.name)?.getFilterValue() as string) ?? ''} onValueChange={column.onChange} > - All + All {(column.options ?? []).map((option) => ( @@ -116,26 +116,26 @@ const Filters = ({ table, apiOptions }: { table: Table; apiOptions: Api })} {isFiltered && ( )}
-
+
- - + {table .getAllColumns() .filter((column) => column.getCanHide()) @@ -143,7 +143,7 @@ const Filters = ({ table, apiOptions }: { table: Table; apiOptions: Api return ( column.toggleVisibility(!!value)} > diff --git a/src/app/(home)/Table/Pagination.tsx b/src/app/(home)/Table/Pagination.tsx index 2a91dad..62dac6b 100644 --- a/src/app/(home)/Table/Pagination.tsx +++ b/src/app/(home)/Table/Pagination.tsx @@ -13,17 +13,17 @@ import { type Table } from '@tanstack/react-table'; const Pagination = ({ table }: { table: Table }) => { return ( -
-
-

Rows per page

+
+
+

Rows per page

-
+
diff --git a/src/app/(home)/Table/Row.tsx b/src/app/(home)/Table/Row.tsx index 55e0d35..dcd901d 100644 --- a/src/app/(home)/Table/Row.tsx +++ b/src/app/(home)/Table/Row.tsx @@ -27,14 +27,14 @@ export const SheetTableRow = ({ )} > {row.getVisibleCells().map((cell) => ( - + {flexRender(cell.column.columnDef.cell, cell.getContext())} ))} - - + + Session Details {displayData(row.original, formOptions).map((section, index) => ( -
-

{section.title}

-
    +
    +

    {section.title}

    +
      {section.data.map((item) => ( -
    • -

      +
    • +

      {item.label} {item.isLink ? : null}

      {item.isLink ? ( {item.value} ) : ( -

      {item.value || 'N/A'}

      +

      {item.value || 'N/A'}

      )}
    • ))} diff --git a/src/app/(home)/Table/index.tsx b/src/app/(home)/Table/index.tsx index cc678ad..9dc1ffe 100644 --- a/src/app/(home)/Table/index.tsx +++ b/src/app/(home)/Table/index.tsx @@ -130,7 +130,7 @@ export default function DataTable({ /> ) : ( - + No results. diff --git a/src/app/(home)/live/LiveColumns.tsx b/src/app/(home)/live/LiveColumns.tsx index bc89e1f..822afc4 100644 --- a/src/app/(home)/live/LiveColumns.tsx +++ b/src/app/(home)/live/LiveColumns.tsx @@ -22,7 +22,7 @@ export const columns: ColumnDef[] = [ { accessorKey: 'platform', header: 'Platform', - cell: ({ row }) =>
      {row.getValue('platform') || 'N/A'}
      , + cell: ({ row }) =>
      {row.getValue('platform') || 'N/A'}
      , }, { id: 'group', @@ -82,9 +82,9 @@ export const columns: ColumnDef[] = [ header: 'Enabled', cell: ({ row }) => row.getValue('isEnabled') ? ( - + ) : ( - + ), }, { diff --git a/src/app/(home)/loading.tsx b/src/app/(home)/loading.tsx index 58ede72..916cb26 100644 --- a/src/app/(home)/loading.tsx +++ b/src/app/(home)/loading.tsx @@ -2,8 +2,8 @@ import { Loader2 } from 'lucide-react'; export default function Loading() { return ( -
      -

      Loading...

      +
      +

      Loading...

      ); } diff --git a/src/app/layout.tsx b/src/app/layout.tsx index b3c6cf0..01134a4 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -6,10 +6,10 @@ import type { ReactNode } from 'react'; export default function RootLayout({ children }: { children: ReactNode }) { return ( - - + + -
      {children}
      +
      {children}
      diff --git a/src/app/loading.tsx b/src/app/loading.tsx index 58ede72..916cb26 100644 --- a/src/app/loading.tsx +++ b/src/app/loading.tsx @@ -2,8 +2,8 @@ import { Loader2 } from 'lucide-react'; export default function Loading() { return ( -
      -

      Loading...

      +
      +

      Loading...

      ); } diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index bc68c92..d4ed0be 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -7,7 +7,7 @@ export default function NotFound() {

      404

      Page not found

      - + GO BACK diff --git a/src/app/session/[type]/Steps/Timeline/index.tsx b/src/app/session/[type]/Steps/Timeline/index.tsx index 3814750..2d234ca 100644 --- a/src/app/session/[type]/Steps/Timeline/index.tsx +++ b/src/app/session/[type]/Steps/Timeline/index.tsx @@ -83,8 +83,8 @@ const TimelineForm: FC = () => { return ( <> -

      - +

      + Select the time period for this session to be active for each day.

      { const DynamicForm = useMemo(() => StepForms[activeStep].component ?? null, [activeStep]); return ( -
      +
      - + diff --git a/src/app/session/page.tsx b/src/app/session/page.tsx index b65bf38..4fb804c 100644 --- a/src/app/session/page.tsx +++ b/src/app/session/page.tsx @@ -14,7 +14,7 @@ export default async function ViewSession({ searchParams: { id } }: Props) { const sessionData = await getASession(Number(id) || null); return ( -
      +

      TO BE IMPLEMENTED {(sessionData as Session)?.name}

      ); diff --git a/src/components/FormBuilder.tsx b/src/components/FormBuilder.tsx index 9f55c58..d3bd0d4 100644 --- a/src/components/FormBuilder.tsx +++ b/src/components/FormBuilder.tsx @@ -59,7 +59,7 @@ const RenderFields = ( control={form.control} name={name as Path} render={({ field }) => ( - + {helperText ? {helperText} : null} @@ -102,22 +102,22 @@ export const FormBuilder = ({
      handleSubmit(data))} - className="flex flex-col gap-4" + className='flex flex-col gap-4' > {Object.entries(formSchema).map(([name, fieldSchema]) => RenderFields(name, fieldSchema, form) )} -
      +
      {buttons?.submit?.hidden ? null : ( - )} {buttons?.reset?.hidden ? null : ( - + handleSelect(d)} onMonthChange={handleSelect} @@ -77,8 +77,8 @@ const DateTimePicker = forwardRef<
      -
      - {label?.time} +
      + {label?.time}
      diff --git a/src/components/ui/dialog.tsx b/src/components/ui/dialog.tsx index 1213047..144d88a 100644 --- a/src/components/ui/dialog.tsx +++ b/src/components/ui/dialog.tsx @@ -44,9 +44,9 @@ const DialogContent = React.forwardRef< {...props} > {children} - - - Close + + + Close diff --git a/src/components/ui/dropdown-menu.tsx b/src/components/ui/dropdown-menu.tsx index ab7d1e7..ba512a1 100644 --- a/src/components/ui/dropdown-menu.tsx +++ b/src/components/ui/dropdown-menu.tsx @@ -34,7 +34,7 @@ const DropdownMenuSubTrigger = React.forwardRef< {...props} > {children} - + )); DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName; @@ -103,9 +103,9 @@ const DropdownMenuCheckboxItem = React.forwardRef< checked={checked} {...props} > - + - + {children} @@ -125,9 +125,9 @@ const DropdownMenuRadioItem = React.forwardRef< )} {...props} > - + - + {children} diff --git a/src/components/ui/multi-select.tsx b/src/components/ui/multi-select.tsx index fd0722a..a4faccd 100644 --- a/src/components/ui/multi-select.tsx +++ b/src/components/ui/multi-select.tsx @@ -176,23 +176,23 @@ const MultiSelectorTrigger = forwardRef - {item} + {item} ))} {children} - +
      ); } @@ -232,7 +232,7 @@ const MultiSelectorContent = forwardRef { const { open } = useMultiSelect(); return ( -
      +
      {open && children}
      ); @@ -254,7 +254,7 @@ const MultiSelectorList = forwardRef< )} > {children} - No options + No options ); }); @@ -290,7 +290,7 @@ const MultiSelectorItem = forwardRef< onMouseDown={mousePreventDefault} > {children} - {isIncluded && } + {isIncluded && } ); }); diff --git a/src/components/ui/select.tsx b/src/components/ui/select.tsx index bf7231d..c90cab8 100644 --- a/src/components/ui/select.tsx +++ b/src/components/ui/select.tsx @@ -30,7 +30,7 @@ const SelectTrigger = React.forwardRef< > {children} - + )); @@ -45,7 +45,7 @@ const SelectScrollUpButton = React.forwardRef< className={cn('flex cursor-default items-center justify-center py-1', className)} {...props} > - + )); SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName; @@ -59,7 +59,7 @@ const SelectScrollDownButton = React.forwardRef< className={cn('flex cursor-default items-center justify-center py-1', className)} {...props} > - + )); SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName; @@ -120,9 +120,9 @@ const SelectItem = React.forwardRef< )} {...props} > - + - + @@ -189,8 +189,8 @@ const ControlledSelectField = React.forwardRef<