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

Feature/image select #268

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tessadm
Copy link

@tessadm tessadm commented Jan 10, 2022

PR Checklist

This PR fulfills the following requirements:

  • The commit message follows our guidelines: Contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A changelog entry was added

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Adds an image select component, comparable to the selectable list and search-filter components.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Resolved issues

Copy link
Contributor

@TriangleJuice TriangleJuice left a comment

Choose a reason for hiding this comment

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

Zoals @jsebrech al vermeldde in zijn comment lijkt het ons beter om deze code in een aparte component te steken. Ik heb ondertussen wel al een review gedaan op de code. Laat gerust weten als er iets niet helemaal duidelijk is.

.grid-container {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 10px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ons grid werkt in veelvouden van 12 en wij hebben enkele spacers voorzien. Ik zou deze regel vervangen door grid-gap: $spacer-xs;

Choose a reason for hiding this comment

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

Heel de grid-container verwijderd en gebruik gemaakt van antwerp flexboxgrid.


.grid-container {
display: grid;
grid-template-columns: 1fr 1fr;
Copy link
Contributor

Choose a reason for hiding this comment

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

Dit werkt goed op mobile, maar ziet er nogal 'bulky' uit vanaf tablet, en zeker op desktop.

Choose a reason for hiding this comment

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

Met behulp van antwerp flexboxgrid ervoor gezorgd dat afhankelijk van de device grootte meer of minder kolommen getoond worden zodat het er minder bulky uit ziet op grote devices.

border: 3px solid $brand-primary;

.selectable-image {
opacity: 0.3;
Copy link
Contributor

Choose a reason for hiding this comment

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

Wij werken liever niet met opacity in de huisstijl. Kan dit op een andere manier?

Choose a reason for hiding this comment

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

Opacity weg gedaan. Een geselecteerde afbeelding wordt nu aangeduid met blauwe rand en het label krijgt een lichtblauwe achtergrond. De afbeelding zelf wordt niet meer voorzien van een lichtblauwe overlay

grid-gap: 10px;
}

.choice {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ik mis hier nog een definitie van een kleine transitie. Zie ook de $animation-normal variable.

Choose a reason for hiding this comment

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

Transitie is toegevoegd

toggleSelected(keyOfChoice: string) {
if (!this.isDisabled) {
const selected = this.selectedImageKeys.indexOf(keyOfChoice);
if (selected < 0 && this.selectedImageKeys.length < this.maxSelectable) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wil dit zeggen dat je ze nooit allemaal kan selecteren?

Choose a reason for hiding this comment

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

Heb de code klein beetje herschreven zodat duidelijk is wat hier bedoelt wordt. Je kan de keuzes allemaal selecteren.
Deze if clause leest als: als de keuze geslecteerd is EN bij het selecteren van de huidige keuze is er nog niet het maximum aantal items geselecteerd dan ...

@@ -0,0 +1,10 @@
<div class="grid-container">
Copy link
Contributor

Choose a reason for hiding this comment

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

Voor CSS classes graag de guidelines lezen. In het kort: wij hanteren atomic BEM classes. Voor deze component zou een goede benaming bv. zijn: .o-image-select. Andere classes zijn dan bv. .o-image-select__container en .o-image-select__choice is-selected.

Choose a reason for hiding this comment

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

Door gebruik te maken van een checkbox input element zijn deze custom classes niet meer nodig. Css is nu getarget op de standaard input selectors en events.

@@ -0,0 +1,10 @@
<div class="grid-container">
<div class="choice"
Copy link
Contributor

Choose a reason for hiding this comment

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

Om volledig toegankelijk te zijn, vermoed ik dat je hier beter werkt met checkboxes als achterliggende syntax.

Choose a reason for hiding this comment

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

Aangepast

}

public setDisabledState(isDisabled: boolean): void {
this.isDisabled = isDisabled;
Copy link
Contributor

Choose a reason for hiding this comment

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

Ik zie hier nergens styling voor, dus er is nu volgens mij geen onderscheid met een enabled optie.

Choose a reason for hiding this comment

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

Css toegevoegd zodat bij disabled state een standaard cursor wordt getoond en geen 'pointer'.

}

toggleSelected(keyOfChoice: string) {
if (!this.isDisabled) {
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: deze regel zou niet nodig zijn als je de checkbox syntax gebruikt.

Choose a reason for hiding this comment

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

Is nu inderdaad niet meer nodig :-D

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.

3 participants