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

Ajouter un oeil dans la sélection multiple de layer list #714

Merged
merged 6 commits into from
Sep 9, 2020

Conversation

eric-darras
Copy link
Collaborator

Bonjour

Ma modification concerne la demande de maintenance 453.
infra-geo-ouverte/igo2#453

Please check if the PR fulfills these requirements

What is the current behavior? (You can also link to an open issue here)

What is the new behavior?

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications:

Other information:

@mbarbeau mbarbeau changed the base branch from master to next September 2, 2020 14:39
Copy link
Member

@mbarbeau mbarbeau left a comment

Choose a reason for hiding this comment

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

Si vous avez le temps, autres modifications en lien avec ce PR:

  1. En mode normal (pas seulement en mode sélection multiple), ajouter le même bouton qui servirait à ouvrir ou fermer toutes les couches du contexte.

  2. Changer le bouton du filtre (oeil en haut) pour mieux le différencier. Je propose un filtre avec un badge oeil dessus ou l'inverse.
    https://materialdesignicons.com/icon/filter-outline
    https://material.angular.io/components/badge/overview

@@ -47,6 +47,9 @@ export class LayerListComponent implements OnInit, OnDestroy {
showToolbar$: BehaviorSubject<boolean> = new BehaviorSubject(false);

public layerTool: boolean;

public hideSelectedLayers: boolean = false ;
Copy link
Member

Choose a reason for hiding this comment

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

Idéalement, faudrait que ce bouton soit dynamique.
Si on coche seulement des couches visibles = oeil non masqué
Si on coche seulement des couches cachées = oeil masqué
Si on coche un mélange = oeil masqué avec un tooltip significatif (et peut-être un badge avertissement)

Copy link
Collaborator Author

@eric-darras eric-darras Sep 3, 2020

Choose a reason for hiding this comment

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

En ce moment, je contrôle le bouton avec une variable booléene (true | false).
Pour contrôler l'affichage du bouton comme tu le demandes, je crois que je dois créer une énumération typescript
export enum LayerListiSelectVisibleEnum{
TOUT_VISIBLE = 'TOUT_VISIBLE',
TOUT_NONVISIBLE = 'TOUT_NONVISIBLE',
MELANGE = 'MELANGE',
NUL = 'NUL'
}
Je vais mettre mon enum dans layer-list.enum.ts
Une variable de type iconeStatutVisible servira à l'affichage. Cette variable et la variable booléenne seront modifiées par la fonction layersCheck(..) de layer-list.component.ts
Cette elles devraient être changées par la fonction toggleVisibility() de layer-item.component.ts

tooltip-position="below"
matTooltipShowDelay="500"
[disabled]="layersChecked.length === 0"
[matTooltip]="'igo.geo.layer.hideSelectedLayers' | translate"
Copy link
Member

Choose a reason for hiding this comment

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

le tooltip devrait varier comme pour l'icone

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 crois que j'ai compris comment faire varier le tool tip
[matTooltip]="hideSelectedLayers ? ('igo.geo.layer.hideSelectedLayers' | translate) : ('igo.geo.layer.showSelectedLayers' | translate)"

Je l'ajoute


}
this.hideSelectedLayers = ! this.hideSelectedLayers ;
return;
Copy link
Member

Choose a reason for hiding this comment

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

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 vais avoir besoin de plus de temps pour analyser et comprendre le lien en référence.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Bonjour

Je ne sais pas comment faire interagir le layer-list-tool avec le layerlistComponent.

SPÉCIFICATION
En mode normal (pas seulement en mode sélection multiple), ajouter le même bouton qui servirait à ouvrir ou fermer toutes les couches du contexte.

Je crois aussi que j'ai besoin d'aide pour la détection de changement.
En ce moment, le constructeur de layer-list.component.ts est le suivant :

constructor(
private elRef: ElementRef,
) {}

Donc j'ai essayé


private ref: ElementRef;

constructor(
private elRef: ElementRef,
) { this.ref = elRef;}


  this.ref.detectChanges();

Mais j'ai une erreur :

Property 'detectChanges' does not exist on type 'ElementRef'.

Donc, je suis à une impasse

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Bonjour

J'ai fait le maximum de modifications demandées. J'ai poussé les modifications dans ma brnache.

git push origin oeil-layer-list
La commande s'est terminée sans erreur.

Je n'ai pas tout réussi, mais je n'ai plus tellement de temps à consacrer à cette modification.
L'expérience a été très enrichissante. Je ne peux pas dire que je comprends tout le projet igo, mais je suis fier d'avoir ajouté ma modeste contribution à ce projet.

Cordialement,

Eric Darras

Copy link
Contributor

Choose a reason for hiding this comment

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

Merci pour ta contribution!

@mbarbeau mbarbeau merged commit 1248fd5 into next Sep 9, 2020
@mbarbeau mbarbeau deleted the oeil-layer-list branch September 9, 2020 17:12
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.

None yet

3 participants