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

Administrateurs/Instructeurs/Experts : lien vers la page des nouveautés et refactorise les barres de navigation principale #9655

Merged
merged 8 commits into from
Nov 20, 2023

Conversation

colinux
Copy link
Member

@colinux colinux commented Oct 30, 2023

2è partie de la PR des annonces #9638 qui :

  • intègre le lien vers la nouvelle page depuis la barre de navigation principale contextuelles par profile (sauf usager). Les catégories visibles par défaut correspondent à celles concernées profil
  • réorganise toute la logique de génération de la navigation principale dans le header et le markup est maintenant conforme au dsfr (sauf erreur)
  • fix un bug d'affichage des images intégrées
  • fix un bug des liens intégrés aux annonces

Exemples

Capture d’écran 2023-11-02 à 10 50 10
Capture d’écran 2023-11-02 à 10 49 51

Capture d’écran 2023-10-31 à 17 49 58

@colinux colinux force-pushed the refactor-main-navigation branch 2 times, most recently from 217966d to 3064187 Compare October 31, 2023 16:49
@colinux colinux force-pushed the poc-release-notes branch 2 times, most recently from 19708bf to 0eb2a7f Compare October 31, 2023 17:13
@colinux colinux force-pushed the refactor-main-navigation branch from 3064187 to 283adf6 Compare October 31, 2023 17:17
@colinux colinux force-pushed the refactor-main-navigation branch 2 times, most recently from 2228d52 to 7fec10d Compare November 2, 2023 10:18
@colinux colinux force-pushed the poc-release-notes branch 3 times, most recently from 1f489f4 to 166fe0d Compare November 6, 2023 13:21
@colinux colinux force-pushed the refactor-main-navigation branch from 7fec10d to 4b07783 Compare November 6, 2023 13:22
@colinux colinux force-pushed the refactor-main-navigation branch from 4b07783 to 7aa5534 Compare November 6, 2023 13:34
@colinux colinux force-pushed the refactor-main-navigation branch from 7aa5534 to 7f194a9 Compare November 6, 2023 14:53
@colinux colinux force-pushed the refactor-main-navigation branch 2 times, most recently from b1f3af3 to a88c647 Compare November 13, 2023 09:17
@colinux colinux changed the base branch from poc-release-notes to main November 13, 2023 09:17
@colinux colinux marked this pull request as ready for review November 13, 2023 09:21
@colinux colinux changed the title Tech: refactorise les barres de navigation principale Administrateurs/Instructeurs/Experts : lien vers la page des nouveautés et refactorise les barres de navigation principale Nov 14, 2023
@colinux colinux force-pushed the refactor-main-navigation branch 7 times, most recently from 5f37bee to b67083f Compare November 15, 2023 16:00
Comment on lines +18 to +29
def self.default_categories_for_role(role, instance = nil)
case role
when :administrateur
['administrateur', 'usager', instance.api_tokens.exists? ? 'api' : nil]
when :instructeur
['instructeur', instance.user.expert? ? 'expert' : nil]
when :expert
['expert', instance.user.instructeur? ? 'instructeur' : nil]
else
['usager']
end
end
Copy link
Contributor

@mfo mfo Nov 20, 2023

Choose a reason for hiding this comment

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

je dois rater un point. mais pourquoi ne pas donner l'instance, et retourner la liste des catégories facon pseudo code (limite mettre ça sur user):

class User
  def default_categories_for_role
    categories = []
    categories << 'administrateur' if administrateur?
    categories << 'instructeur' if instructeur?
    categories << 'expert' if expert?
    categories
  end
end

en gros, connecté ETQ admin/instructeur/expert, ca ne me semble pas devoir changer les annonces. Si j'ai les 3 profils, j'ai l'impression que les 3 catégories devraient etre remontées.

Copy link
Member Author

Choose a reason for hiding this comment

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

J'ai plus tout à fait le truc en tête car ça beaucoup évolué dans le temps, t'as ptet bien raison . Je me le regarde dans un coin de la tête pour plus tard, ça pourrait simplifier des choses

@mfo mfo enabled auto-merge November 20, 2023 13:58
@colinux colinux force-pushed the refactor-main-navigation branch from de0d49e to 3dd25c1 Compare November 20, 2023 14:07
@mfo mfo disabled auto-merge November 20, 2023 14:09
@mfo mfo merged commit 9a5e4d4 into demarches-simplifiees:main Nov 20, 2023
14 checks passed
@colinux colinux deleted the refactor-main-navigation branch November 20, 2023 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants