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

feat: handle shortcuts in appsections VO-777 #2680

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

acezard
Copy link
Contributor

@acezard acezard commented Aug 7, 2024

Allow shortcuts doctype to be used in AppsSections in cozy-store (previously only konnectors and apps were set up).

image

@acezard acezard force-pushed the feat--handle-shortcuts-in-appsections branch 2 times, most recently from 1dd88e5 to 9acf0dc Compare August 7, 2024 13:03
@acezard acezard marked this pull request as ready for review August 7, 2024 13:03
@JF-Cozy JF-Cozy force-pushed the feat--handle-shortcuts-in-appsections branch from fcfb607 to 566eae9 Compare August 7, 2024 14:45
@acezard acezard requested a review from cballevre August 8, 2024 07:36
react/AppSections/Sections.jsx Outdated Show resolved Hide resolved
react/AppSections/locales/en.json Outdated Show resolved Hide resolved
react/AppTile/index.jsx Outdated Show resolved Hide resolved
@@ -91,8 +115,10 @@ export const AppTile = ({
<TileTitle isMultiline={!statusLabel}>
{namePrefix ? `${namePrefix} ${name}` : name}
</TileTitle>
{developer.name && showDeveloper && (
<TileSubtitle>{`${t('app_item.by')} ${developer.name}`}</TileSubtitle>
{(developer.name || app.metadata.source) && showDeveloper && (
Copy link
Contributor

Choose a reason for hiding this comment

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

I would extract developer.name || app.metadata.source in a const and use isShortcut to determine which version I should display. Even if I don't have developer.name on my app I don't want that he search for a source on the file

import styles from '../AppTile/styles.styl'

interface ShortcutTileProps {
file: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you could use the IOCozyFile from cozy-client with partial ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: perso je sortirai les interface dans des fichiers séparés

Copy link
Contributor

Choose a reason for hiding this comment

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

Pour les interfaces de props je serais plutôt pour les garder dans le même fichier tous comme on garde les propTypes dans le même fichier

Copy link
Collaborator

Choose a reason for hiding this comment

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

alerte sujet sensible vision personnelle 🤣 faudrait qu'on regarde ce qui se fait majoritairement dans l'ecosystème et chez "les grands"...

Copy link
Contributor

@cballevre cballevre Aug 14, 2024

Choose a reason for hiding this comment

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

C'est sur que c'est opiniated et qu'on trouve ce que l'on cherche :

Je pense que la discussion des React.FC vs ({ user }: AvatarProps): JSX.Element se pose aussi histoire d'augmenter la cohérence de la base de code mais c'est hors scope de la PR

react/ShortcutTile/index.tsx Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
import styles from '../AppTile/styles.styl'

interface ShortcutTileProps {
file: {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: perso je sortirai les interface dans des fichiers séparés

react/ShortcutTile/index.tsx Show resolved Hide resolved
react/types.d.ts Outdated Show resolved Hide resolved
react/AppTile/AppTile.spec.jsx Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: dans ce commit on apporte plusieurs correctif, idéalement on devrait les merger avec les autres commits pour les faire disparaître de celui-ci, ce qui rendrait son intitulé plus juste. Sinon changer l'intituler... on peut laisser comme ça ici, c'était juste pour la remarque.

@acezard acezard force-pushed the feat--handle-shortcuts-in-appsections branch from 6be1d6e to 5388b63 Compare August 13, 2024 08:18
@acezard acezard changed the base branch from master to feat--update-lint-config August 13, 2024 08:18
@acezard acezard force-pushed the feat--handle-shortcuts-in-appsections branch 6 times, most recently from ec930c7 to 393b373 Compare August 13, 2024 12:55
@acezard acezard requested review from JF-Cozy and cballevre August 13, 2024 13:19
@acezard acezard force-pushed the feat--update-lint-config branch 2 times, most recently from 59a8994 to 24d5571 Compare August 14, 2024 12:56
@@ -230,6 +277,6 @@ Sections.defaultProps = {
})
}

export const Untranslated = withBreakpoints()(Sections)
export const Untranslated = withBreakpoints()(SectionsWrapper)
Copy link
Collaborator

Choose a reason for hiding this comment

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

on pourrait remplacer withBreakpoints par useBreakpoints au passage ?

Pourquoi utiliser useExtendI18n en plus de withLocales ? Quel problème on résout grâce à generateI18nConfig ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

on reçoit les localisations au runtime, on ne les a pas au moment du build dans cette feature

Copy link
Collaborator

Choose a reason for hiding this comment

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

Vu ensemble, les locales sont dans les flags. Ici on récupère la technique employée sur Store. Il serait plus judicieux de faire un getI18nFromFlag ou un useI18nFromFlag (qui utiliserait useExtendI18n) pour gérer ça plus globalement. Vu l'échéance, on décale ce refacto à une autre PR @acezard

@@ -0,0 +1,8 @@
declare module 'cozy-ui/react/Typography' {
const component: (props: Record<string, unknown>) => JSX.Element
Copy link
Collaborator

Choose a reason for hiding this comment

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

est-ce qu'on ne pourrait pas lister les vrais props ?

package.json Outdated
@@ -101,6 +102,7 @@
"cozy-logger": "^1.9.0",
"cozy-sharing": "^14.1.0",
"cozy-stack-client": "^47.4.0",
"cpx": "1.5.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

question naïve, est-ce qu'on ne peut pas utiliser les mécaniques en place plutôt que d'utiliser une nouvelle approche ? Je te transmets le paper sur le sujet...

@acezard acezard force-pushed the feat--handle-shortcuts-in-appsections branch 2 times, most recently from 60b6a82 to cdf8681 Compare August 14, 2024 13:10
Copy link
Collaborator

@JF-Cozy JF-Cozy left a comment

Choose a reason for hiding this comment

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

On sort également de cette PR les sujets d.ts, à faire dans une autre

@acezard acezard force-pushed the feat--handle-shortcuts-in-appsections branch from cdf8681 to 754bdf6 Compare August 14, 2024 13:16
Base automatically changed from feat--update-lint-config to master August 14, 2024 13:17
@acezard acezard force-pushed the feat--handle-shortcuts-in-appsections branch from 754bdf6 to d655aa7 Compare August 14, 2024 13:17
@acezard acezard force-pushed the feat--handle-shortcuts-in-appsections branch 2 times, most recently from 9eda84f to 2e92b27 Compare August 14, 2024 13:39
@acezard acezard force-pushed the feat--handle-shortcuts-in-appsections branch from 2e92b27 to fa3a753 Compare August 14, 2024 13:40
@acezard acezard merged commit e5ff800 into master Aug 14, 2024
5 checks passed
@acezard acezard deleted the feat--handle-shortcuts-in-appsections branch August 14, 2024 14:04
@cozy-bot
Copy link

🎉 This PR is included in version 111.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

cballevre added a commit that referenced this pull request Sep 23, 2024
The properties are adapted only once in the app that consumes the component, to be less specific.

This is a revert of a part of the PR : #2680
cballevre added a commit that referenced this pull request Sep 25, 2024
The properties are adapted only once in the app that consumes the component, to be less specific.

This is a revert of a part of the PR : #2680
cballevre added a commit that referenced this pull request Sep 25, 2024
The properties are adapted only once in the app that consumes the component, to be less specific.

This is a revert of a part of the PR : #2680
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.

4 participants