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 grommet text input with cunningham text input #2374

Merged
merged 9 commits into from
Sep 7, 2023

Conversation

AntoLC
Copy link
Contributor

@AntoLC AntoLC commented Aug 10, 2023

Purpose

Replace grommet text input with cunningham text input.

It is more critical than we thought I guess, we often need to refactor the code to make it work with the new input:

  • the grommet Form component is not working with the new input
  • the way the errors are managed change as well (not from the Form component anymore)

Proposal

  • replace every grommet TextInput by cunningham Input
  • improve fetch error
  • tests

@AntoLC AntoLC force-pushed the feature/anthony/cunningham-text-input branch from 4cbcae2 to 1886e74 Compare August 11, 2023 14:08
@AntoLC AntoLC self-assigned this Aug 11, 2023
@AntoLC AntoLC force-pushed the feature/anthony/cunningham-text-input branch 13 times, most recently from c8547fc to 6d4f0c0 Compare September 1, 2023 14:29
@AntoLC AntoLC marked this pull request as ready for review September 1, 2023 14:47
@AntoLC AntoLC requested review from lunika and kernicPanel September 1, 2023 14:47
Copy link
Member

@lunika lunika left a comment

Choose a reason for hiding this comment

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

  • the font weight is not the same with master branch. 400 on the master branch, 300 on this one.

Copy link
Member

Choose a reason for hiding this comment

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

The render is not the same at all. Is it normal ? If yes, is it needed to keep it ?

Copy link
Contributor Author

@AntoLC AntoLC Sep 5, 2023

Choose a reason for hiding this comment

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

I don't know what is the best to do:

  • either let it like that (it will still check some changes)
  • Or remove this test
  • Or try to add the lib-common css to try to get the real render

The last solution is a bit complicated though, in order to have the css interpreted by jest, we need to install jest-transform-css, and couple it with the snapshot libraries.
Let me know if it deserves that we pass time on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AntoLC AntoLC force-pushed the feature/anthony/cunningham-text-input branch from 6d4f0c0 to 3f29815 Compare September 5, 2023 09:37
@AntoLC
Copy link
Contributor Author

AntoLC commented Sep 5, 2023

  • the font weight is not the same with master branch. 400 on the master branch, 300 on this one.

The font weight is not the same but visually it should be the same, the weight change visually from 600.

On the top is the grommet input and the bottom the cunningham, the only visual diff on the label is that cunningham add a small opacity on the label, so the color become slightly lighter on the cunningham one.
Capture d'écran 2023-09-05 113644

@AntoLC AntoLC requested a review from lunika September 5, 2023 09:53
@lunika
Copy link
Member

lunika commented Sep 5, 2023

On the left grommet, on the right cunningham.

You can see that the weight on the value is not the same and if you inspect and watch the computed styles you will that the weight is not the same.

image

@lunika
Copy link
Member

lunika commented Sep 5, 2023

Oh and I just notice that the font family used is not the same

...inputProps
}: PrivateTextInputFieldProps) => {
const intl = useIntl();
const [isHidden, setIsHidden] = useState(true);
Copy link
Member

Choose a reason for hiding this comment

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

I find hidden a bit misleading, what about obscured ?
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/password

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AntoLC
Copy link
Contributor Author

AntoLC commented Sep 5, 2023

Oh and I just notice that the font family used is not the same

You're right, incredible eyes.
f383dc0

Copy link
Member

@kernicPanel kernicPanel left a comment

Choose a reason for hiding this comment

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

Sorry for being relou

@AntoLC
Copy link
Contributor Author

AntoLC commented Sep 5, 2023

I added this commit (♻️(frontend) update way to load correct front), before to have a bold Roboto, we had to change the font-family (example). With the new way, we don't have to change the font-family anymore, just changing the weight will load the correct font (works only with the exact font name Roboto, so only with cunningham for the moment).

@AntoLC AntoLC force-pushed the feature/anthony/cunningham-text-input branch from dacb41d to a4c09d3 Compare September 5, 2023 14:14
@AntoLC AntoLC requested a review from kernicPanel September 5, 2023 14:20
@AntoLC AntoLC force-pushed the feature/anthony/cunningham-text-input branch from a4c09d3 to 8ebdbb7 Compare September 5, 2023 14:32
Copy link
Member

@kernicPanel kernicPanel left a comment

Choose a reason for hiding this comment

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

@AntoLC AntoLC force-pushed the feature/anthony/cunningham-text-input branch from 90d8cee to 41b53cd Compare September 5, 2023 16:05
</Box>
<Select
Copy link
Member

Choose a reason for hiding this comment

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

On master branch, this select starts at 8AM. We should keep this behaviour

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed, I removed the dev about the SchedulingFields (💄(lib_component) replace grommet input by cunningham input).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AntoLC AntoLC force-pushed the feature/anthony/cunningham-text-input branch from 41b53cd to ae0fbba Compare September 6, 2023 10:09
@AntoLC AntoLC requested a review from lunika September 6, 2023 10:23
The backend can return different body response when an error occurs,
to access it we needed to cast the error prop, this commit adds a
body prop to have an easy access to the error body.
CunninghamProvider is necessary in multiple cunningham components,
so it is easier to maintain a single provider per app.
- replace grommet input by cunningham input
- move PrivateTextInputField to root/components/Text
- refacto forms to fit new cunningham input text
- replace grommet input by cunningham input
- VideoCreateForm is not used anymore so remove it
- replace grommet input by cunningham input
- replace grommet input by cunningham input
- replace grommet input by cunningham input
- replace grommet input by cunningham input
Until now when we wanted to change the font weight with Roboto, we
had to change the font-family name, this is not a good practice.
Now just by changing the font-weight, the correct font is loaded,
if your css use `font-weight:900`, the font will be Roboto Black.
@AntoLC AntoLC force-pushed the feature/anthony/cunningham-text-input branch from ae0fbba to 1709ed1 Compare September 7, 2023 08:48
@AntoLC AntoLC enabled auto-merge (rebase) September 7, 2023 08:49
@AntoLC AntoLC merged commit 3810c8f into master Sep 7, 2023
@AntoLC AntoLC deleted the feature/anthony/cunningham-text-input branch September 7, 2023 09:03
lunika added a commit that referenced this pull request Sep 8, 2023
Added

- Add playlist is_claimable attribute
- Add the Accept-Language header to most of the http request (#2394)

Changed

- Replace grommet TextInput by Cunningham Input (#2374)
- Save classroom recording urls in a cache and remove access from db column
lunika added a commit that referenced this pull request Sep 8, 2023
Added

- Add playlist is_claimable attribute
- Add the Accept-Language header to most of the http request (#2394)

Changed

- Replace grommet TextInput by Cunningham Input (#2374)
- Save classroom recording urls in a cache and remove access from db column
lunika added a commit that referenced this pull request Sep 8, 2023
Added

- Add playlist is_claimable attribute
- Add the Accept-Language header to most of the http request (#2394)

Changed

- Replace grommet TextInput by Cunningham Input (#2374)
- Save classroom recording urls in a cache and remove access from db column
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.

3 participants