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

♻️(frontend) replace Text grommet #2427

Merged
merged 4 commits into from
Oct 4, 2023

Conversation

AntoLC
Copy link
Contributor

@AntoLC AntoLC commented Sep 19, 2023

Purpose

Replace the grommet Text component by our custom component Text component base on the Cunningham design system.

Proposal

  • create Typo component - A generic component grouping common element feature
  • refacto Heading component to use Typo component
  • create Text component based on Typo component
  • replace occurences of Grommet Text with custom Text
  • better conf cunningham (utility-classes)
  • tests

@AntoLC AntoLC self-assigned this Sep 19, 2023
@AntoLC AntoLC force-pushed the feature/anthony/replace-text-grommet branch 12 times, most recently from 98cf7eb to f951fae Compare September 26, 2023 10:01
@AntoLC AntoLC marked this pull request as ready for review September 26, 2023 10:28
@AntoLC AntoLC force-pushed the feature/anthony/replace-text-grommet branch 3 times, most recently from 1193a74 to 1065af9 Compare September 27, 2023 12:56
@AntoLC AntoLC changed the title ✨(frontend) replace Text grommet ♻️(frontend) replace Text grommet Sep 27, 2023
Comment on lines 8 to 40
type Values<T> = T[keyof T];
export type ObtainHTMLProps<T extends Values<ReactHTML>> =
T extends DetailedHTMLFactory<infer Props, HTMLElement> ? Props : never;

export interface TypoPropsOnly<T> {
textAlign?: CSSProperties['textAlign'];
color?: CSSProperties['color'];
fontSize?: CSSProperties['fontSize'];
truncate?: boolean | number;
type?: keyof T;
}

export type TypoProps<T extends keyof ReactHTML> = TypoPropsOnly<ReactHTML> &
ObtainHTMLProps<ReactHTML[T]>;
Copy link
Member

Choose a reason for hiding this comment

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

Can you add comment on this type please. They are not trivial.

Copy link
Contributor Author

@AntoLC AntoLC Oct 3, 2023

Choose a reason for hiding this comment

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

In some cases the type didn't infer correctly, these fix it, comments are added:

@AntoLC AntoLC force-pushed the feature/anthony/replace-text-grommet branch 5 times, most recently from c0d1563 to 5fe6b0a Compare October 3, 2023 16:43
@AntoLC AntoLC requested a review from lunika October 3, 2023 16:43
@AntoLC AntoLC force-pushed the feature/anthony/replace-text-grommet branch from 5fe6b0a to f14cfc0 Compare October 3, 2023 18:28
The way to override the cunningham tokens was not the recommended way,
we changed it to a more recommended way, it will help to get
inner functionnalities bring by the cunningham design system like
css class generation.
Typo is a generic component that can be used to render any HTML tag,
it includes a set of predefined methods and styles adapted with the
Cunningham design system. It will make it easier to create new
specific html components and to maintain the consistency of the
design system.
We refacto Headings component to use Typo component.
Text component is based from the Typo component, it uses the
Cunningham classname system.
This component replace the Grommet Text component.
We replace the Grommet Text component with our own Text component
based on the Cunnigham design system.
@AntoLC AntoLC force-pushed the feature/anthony/replace-text-grommet branch from f14cfc0 to ade02f7 Compare October 4, 2023 09:06
@AntoLC AntoLC enabled auto-merge (rebase) October 4, 2023 09:06
@AntoLC AntoLC merged commit f993b68 into master Oct 4, 2023
33 of 34 checks passed
@AntoLC AntoLC deleted the feature/anthony/replace-text-grommet branch October 4, 2023 09:22
lunika added a commit that referenced this pull request Oct 19, 2023
Added

- Generic video LTI url
- Display complete error message in frontend
- Generic classroom LTI url
- Generic LTI cartridge (xml configuration)
- Display LTI warning message for generic urls regarding course copy
- configure homepage banner using SiteConfig model
- setting BBB_INVITE_TOKEN_BANNED_LIST
- Add transcode_pipeline property to video model

Changed

- Replace ngrok with localtunnel to serve marsha on a public domain with
  stable urls and allow to run multiple tunnels at the same time
- Replace all the loaders by Cunningham Loader (#2436)
- Replace grommet Text (#2427)
- Replace grommet Paragraph (#2435)
- Remove cross on login image (#2451)
- Replace grommet Checkbox and Pagination (#2437)

Fixed

- Markdown save sent previously saved content
- Force to end BBB meeting when creation fail
lunika added a commit that referenced this pull request Oct 19, 2023
Added

- Generic video LTI url
- Display complete error message in frontend
- Generic classroom LTI url
- Generic LTI cartridge (xml configuration)
- Display LTI warning message for generic urls regarding course copy
- configure homepage banner using SiteConfig model
- setting BBB_INVITE_TOKEN_BANNED_LIST
- Add transcode_pipeline property to video model

Changed

- Replace ngrok with localtunnel to serve marsha on a public domain with
  stable urls and allow to run multiple tunnels at the same time
- Replace all the loaders by Cunningham Loader (#2436)
- Replace grommet Text (#2427)
- Replace grommet Paragraph (#2435)
- Remove cross on login image (#2451)
- Replace grommet Checkbox and Pagination (#2437)

Fixed

- Markdown save sent previously saved content
- Force to end BBB meeting when creation fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants