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

[DO NOT MERGE] - PR Just as a review base, to collect practical reviews #15

Open
wants to merge 72 commits into
base: review
Choose a base branch
from

Conversation

sylvanr
Copy link
Member

@sylvanr sylvanr commented Dec 3, 2024

No description provided.

FAUSTMANNSTEF and others added 30 commits October 10, 2024 13:27
AIDA Explorer , AIDA Header,AIDA Sign In Google/LinkedIn/Facebook
Open Aid addfilter Button , Open AID Year Display Graph Button, Aida Log Out Button
Open Aid Share Button , Open Aid Download Button , Open Aid Select Language Button , Open Aid MenuButton, Data explorer Search button
Data file, Stories,Component itself and Index file
Table Component file, Table Stories file , index file and data file
DataGrid Component, Datagrid Stories , index file, data file for the datagrid
Sizes, Error, Success
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link

sonarcloud bot commented Dec 4, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
6.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Member

@stephanoshadjipetrou stephanoshadjipetrou left a comment

Choose a reason for hiding this comment

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

ZDS general review notes

  • remove unused imports
  • organise assets in sub-directories as per project
  • move interfaces from actual component file to data.ts file
  • story file names must be relevant to the component it showcases
  • theme files look similar; also avoid using .js or .jsx files; instead use .ts or .tsx
  • the inline SVG better to be put in actual SVG files and import them to use in other components
  • generic components instead of using "My" convention, let's use something like "ZDS"
  • try to use absolute imports instead of relative imports - https://medium.com/geekculture/making-life-easier-with-absolute-imports-react-in-javascript-and-typescript-bbdab8a8a3a1
  • also wherever possible import single component default imports from packages
    • e.g. import { Box } from "@mui/material"; to import Box from "@mui/material/Box";

Choose a reason for hiding this comment

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

Let's not use package-lock.json & yarn.lock files. Let's all use yarn to stick to yarn.lock
@sylvanr @okorie2 @Psami-wondah @FAUSTMANNSTEF

Choose a reason for hiding this comment

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

Noted

package.json Show resolved Hide resolved
aria-label={props.ariaLabel}
style={{ textAlign: textAlign }}
data-cy={props.datacy}
children={props.children}

Choose a reason for hiding this comment

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

Pass props.children into the component's tag element:

<IconButton>{props.children}</IconButton>

import colors from "../../theme/colors";
import React, { useState } from "react";
import LogoutIcon from "@mui/icons-material/Logout";
import {

Choose a reason for hiding this comment

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

Import them separately as the LogoutIcon above

const BORDER_STYLES = {
RED: "2px solid red",
BLUE: "2px solid blue",
} as const;

Choose a reason for hiding this comment

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

is this needed?

Copy link
Collaborator

@okorie2 okorie2 left a comment

Choose a reason for hiding this comment

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

Remove unused imports

ArrowForward,
Share,
LinkedIn,
Microsoft,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove unused imports

import type { Meta, StoryObj } from "@storybook/react";
import { fn } from "@storybook/test";
import Button from "./myButton";
import { ReactComponent as GoogleIcon } from "../../assets/vectors/jsx/HeaderSignInViewGoogle.svg";
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should use absolute imports for components being imported from a different directory. Or for every import if possible

IconComponent={props.IconComponent}
labelId={`${id}-label`}
onChange={props.onChange}
renderValue={(selected: string | string[]) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

declare this as a function at the top instead, and call the function here. Let's avoid inline function declarations

Copy link

@Psami-wondah Psami-wondah left a comment

Choose a reason for hiding this comment

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

  • Move interfaces and types to a seperate file.
  • Stop Redefinition of types that already exists
  • Multiple themes folders - I think one can be sufficient
  • Svgs should be exported to files
  • Storybook argtypes can be inferred from the component type

layout: "centered",
},
tags: ["autodocs"],
argTypes: {

Choose a reason for hiding this comment

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

These arg types can be inferred from the component props type yh?

display?: string;
borderRadius?: string;
textTransform?: string;
opacity?: string;

Choose a reason for hiding this comment

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

Most of these styles are already defined in SxProps I think.

Choose a reason for hiding this comment

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

Noted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants