-
Notifications
You must be signed in to change notification settings - Fork 26
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
Button default options #1246
base: next
Are you sure you want to change the base?
Button default options #1246
Conversation
…into button_DefaultOptions
…into button_DefaultOptions
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.
- Pour le UI, je trouve que le bouton n'a pas sa place dans un menu ou il n'y a aucune sélection de disponible ou de visible.
- Est-ce que ce serait intéressant d'utiliser un master checkbox qui permet de tout cocher/décocher et indique un état intermédiaire lorsque ce n'est pas le cas?
Par exemple:
- On pourrait p-t améliorer l'intégration du bouton "Sélection par défaut" en utilisant un bouton icone?
packages/geo/src/lib/search/search-settings/search-settings.component.scss
Outdated
Show resolved
Hide resolved
// This component is projected, the style need to be apply outside is scope | ||
.checkDefaultButton { | ||
text-align: center; | ||
padding: 0 5px; |
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.
En général avec Material design, on essaie de respecter les multiples de 4 ou au moins en nombre paires pour nos espacements (padding/margin).
Voir le Material measurements
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.
Je me base sur des éléments déjà existants comme le bouton de tout sélectionner qui utilise ce multiple
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.
Je crois qu'il faut se conformer ici
packages/geo/src/lib/search/search-settings/search-settings.component.ts
Show resolved
Hide resolved
setting: SearchSourceSettings | ||
) { | ||
event.stopPropagation(); | ||
setting.allEnabled = true; |
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.
Pourquoi mettre le allEnabled à vrai?
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.
Sinon, ça crée un état où le bouton de sélection par défaut sélectionnait tout lorsque tout était désélectionné.
const limit = | ||
this.options.params && this.options.params.limit | ||
? Number(this.options.params.limit) | ||
!forceReset && this.options.params && this.options.params.limit |
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.
Pourquoi le forceReset, dans quel scénario on pourrait avoir des résultats par défaut qui sont différent?
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.
C'est pour le bouton qui remet tous les dépendances par défaut. Ce bouton n'a pas les settings dans son container. Sans le forceReset, les valeurs par défaut des radio button changeaient selon l'option sélectionnée.
) { | ||
event.stopPropagation(); | ||
setting.allEnabled = true; | ||
this.checkUncheckAll(event, source, setting); |
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.
Pourquoi faire un uncheck si on repasse tous les settings ci-dessous. Surtout qu'on va générer deux searchSourceChange.emit()
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.
Dépendamment de la valeur du bouton de tout sélectionner, un état faisait que le bouton de sélection par défaut ne fonctionnait pas. Ça "reset" en quelque sorte.
packages/geo/src/lib/search/search-settings/search-settings.component.ts
Show resolved
Hide resolved
source.getDefaultOptions().settings.map((defaultSetting) => { | ||
if (defaultSetting.title === setting.title) { | ||
setting.values.map((value, index) => { | ||
value.enabled = defaultSetting.values[index].enabled; | ||
}); | ||
} | ||
}); |
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'ai l'impression qu'on pourrait optimiser et améliorer la lisibilité? Je n'ai pas testé!
source.getDefaultOptions().settings.map((defaultSetting) => { | |
if (defaultSetting.title === setting.title) { | |
setting.values.map((value, index) => { | |
value.enabled = defaultSetting.values[index].enabled; | |
}); | |
} | |
}); | |
const defaultSetting = source.getDefaultOptions().settings.find(category => category.title === setting.title); | |
setting.values = defaultSetting.values; |
Pour le 1, ca reste intéressant de tout resetter sans avoir a faire le tour de chaque search source. |
…into button_DefaultOptions
@@ -50,7 +50,7 @@ export class CadastreSearchSource extends SearchSource implements TextSearch { | |||
/* | |||
* Source : https://wiki.openstreetmap.org/wiki/Key:amenity | |||
*/ | |||
protected getDefaultOptions(): SearchSourceOptions { | |||
getDefaultOptions(): SearchSourceOptions { |
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.
Pourquoi enlever le protected?
// This component is projected, the style need to be apply outside is scope | ||
.checkDefaultButton { | ||
text-align: center; | ||
padding: 0 5px; |
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.
Je crois qu'il faut se conformer ici
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.
Faudrait faire le tour des commentaire et on a des erreurs de typage
@@ -118,16 +118,15 @@ export class IChercheSearchSource extends SearchSource implements TextSearch { | |||
return IChercheSearchSource.type; | |||
} | |||
|
|||
protected getDefaultOptions(): SearchSourceOptions { | |||
getDefaultOptions(forceReset?: Boolean): SearchSourceOptions { |
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.
Erreur de typage
New button used to select the default options for the search results.
Can revert all options back to default or only revert specified group.
Button next to Select All button.