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/create json files from baserows #821

Open
wants to merge 1 commit into
base: release/project
Choose a base branch
from

Conversation

ttdm
Copy link
Collaborator

@ttdm ttdm commented Jun 10, 2024

Feature principale : Génération des fichier projets pour le front (json + images)

Features secondaire / détails d'implem :

  • récupération des données projets via baserow
  • création d'un script typescript indépendant qui génère les données via la commande "npm run build-projects"
  • fichiers stockés dans data/static/ (et non dans generated puisqu'on souhaite des fichiers qui, comme les yaml des programmes, sont versionnés et ne sont pas automatiquement mis à jours)

Autre notes : les mocks data n'étaient pour l'instant pas dans la feature branche. Je les ai donc ajoutées.

  • Dans cet ajout des mocks data, le traitement des "Color" pose question.

close #796
close #803
close #804
close #805

@ttdm ttdm self-assigned this Jun 10, 2024
@ttdm ttdm changed the base branch from main to release/project June 10, 2024 21:32
@ttdm ttdm requested a review from yvalentin June 10, 2024 22:17
@ttdm ttdm marked this pull request as ready for review June 10, 2024 22:17
@yvalentin yvalentin added this to the Intégration des projets milestone Jun 17, 2024
Copy link
Collaborator

@yvalentin yvalentin left a comment

Choose a reason for hiding this comment

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

Praise: Gros boulot ! Bravo !

Je t'ai fait pas mal de retour... Mais beaucoup de mineur ;-) Et c'est propre ! Merci

packages/common/src/project/types.ts Outdated Show resolved Hide resolved
packages/common/src/theme/color.ts Outdated Show resolved Hide resolved
packages/common/src/theme/theme.ts Outdated Show resolved Hide resolved
packages/data/package.json Outdated Show resolved Hide resolved
packages/data/src/projects/project.ts Outdated Show resolved Hide resolved
packages/data/src/projects/baserows.ts Outdated Show resolved Hide resolved
packages/data/src/projects/project.ts Outdated Show resolved Hide resolved
console.log(`Baserow Data sucessfully downloaded.\nStarting to validate the project data and generating the project JSON.`)
this._validateData(projects)
this._writeJson(projects)
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

note: je vais ajouter une règle de saut de ligne avant return

Copy link
Collaborator Author

@ttdm ttdm Jul 1, 2024

Choose a reason for hiding this comment

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

j'ai ajouté des sauts de ligne mais je ne suis pas sur de la où il faut en mettre exactement.
Ex :

private async _delay(ms: number): Promise<void> {
    return new Promise((resolve) => setTimeout(resolve, ms))
  }

vs

  private async _delay(ms: number): Promise<void> {
    console.log(xxx)
    return new Promise((resolve) => setTimeout(resolve, ms))
  }

ou

  private async _delay(ms: number): Promise<void> {
    console.log(xxx)
    
    return new Promise((resolve) => setTimeout(resolve, ms))
  }

}

private _validateThemes(project: RawProject) {
project.themes.forEach((themeId) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion: sur les trois méthodes _validateThemes, _validateLinkedProjects et _validatePrograms, on pourrait passer directement les valeurs utiliser dans le foreach

ex:

this._validateThemes(project.themes)
...
private _validateThemes(themes: string[]) {
...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Je pensais aussi mais comme on fait d'abord tous les téléchargements puis toutes les validations, il y a besoin de donner tout le projet en paramètre pour pouvoir afficher son titre et son id en cas de problème.

packages/data/src/projects/project.ts Outdated Show resolved Hide resolved
…ould be discussed; contains a circular dependency warning !
@ttdm ttdm force-pushed the feat/create_JSON_files_from_baserows branch from be00180 to 46b4768 Compare July 1, 2024 17:54
@ttdm ttdm requested a review from yvalentin July 1, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants