-
Notifications
You must be signed in to change notification settings - Fork 92
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
ETQ admin : je peux ordonner les labels #11237
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
515f3d8
nouvel attribut position dans Labels
Benoit-MINT 02718bc
ordonnancement par défaut des labels selon position
Benoit-MINT 36359e7
vue admin : nouvelle page pour ordonner les labels
Benoit-MINT d1a95a9
refacto controller TS
Benoit-MINT 4ce4465
update des positions des labels
Benoit-MINT 307b333
test
Benoit-MINT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rs/move_procedures_position_controller.ts → ...rollers/move_cards_position_controller.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
app/views/administrateurs/labels/order_positions.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.fr-container.fr-mt-6w.fr-mb-15w | ||
= link_to " Liste des labels", admin_procedure_labels_path, class: 'fr-link fr-icon-arrow-left-line fr-link--icon--left fr-icon--sm' | ||
%h3.fr-my-3w | ||
Personnaliser l'ordre des #{@labels.size} labels | ||
%p Déplacez les labels dans la liste pour définir leur ordre d'affichage pour les instructeurs : | ||
|
||
%fr-container{ data: { controller: 'move-cards-position' } } | ||
= form_tag update_order_positions_admin_procedure_labels_path, method: :patch, id: 'order-admin-procedure-labels-form' do | ||
- @labels.each do |label| | ||
.fr-card.fr-mb-1w.fr-py-1w.fr-px-2w | ||
.flex.align-center | ||
%button.fr-btn.fr-btn--sm.fr-icon-arrow-up-line.fr-btn--secondary.fr-col-1{ data: { action: "move-cards-position#moveUp" } } | ||
%button.fr-btn.fr-btn--sm.fr-icon-arrow-down-line.fr-btn--secondary.fr-col-1.fr-ml-2w.fr-mr-4w{ data: { action: "move-cards-position#moveDown" } } | ||
= tag_label(label.name, label.color) | ||
= hidden_field_tag "ordered_label_ids[]", label.id | ||
|
||
.fixed-footer.fr-py-1w | ||
.fr-btns-group.fr-btns-group--center.fr-btns-group--inline.fr-btns-group--inline-lg | ||
= link_to "Annuler", admin_procedure_labels_path, class: 'fr-btn fr-btn--secondary fr-my-1w' | ||
%button.fr-btn.fr-my-1w{ type: "submit", form: 'order-admin-procedure-labels-form' } Valider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddPositionToLabels < ActiveRecord::Migration[7.0] | ||
def change | ||
add_column :labels, :position, :integer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'arrive après la bataille mais c'est dommage de retirer la caption en faveur d'un titre ! (on devrait en avoir sur toutes nos tables, en tout cas dès qu'on a une exigence en accessibilité, ce qui certes est un peu plus discutable côté admin)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep ... j'ai eu la discussion avec Marlène et Lisa.
En fait, la contrainte d'avoir le bouton "personnaliser" aligné horizontalement avec le titre initialement dans caption n'était pas compatible (j'ai tenté plusieurs astuces en vain) sur l'idée de disposer en justify-between. Il y a un comportement JS propre à caption qui ramène à gauche tout ce qui se trouve dans cette balise, malgré les class qui vont bien.
Et en effet toutes les autres tables qui ont dans l'esprit plusieurs éléments là où l'on a le titre du tableau, n'ont pas/plus de balise caption.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dans le cas ici, et d'autres tableaux "simples", sous couvert de Marlène, on pourrait avoir un équilibre access/UX en acceptant de décaler verticalement. En revanche pour des tableaux plus complexes, comme le suivi instructeur des dossiers, ça paraît plus complexe