From 97678dd49b9dde545b35d5ce715a59160ada0ac9 Mon Sep 17 00:00:00 2001 From: Thijs Louisse Date: Wed, 26 Feb 2020 14:32:52 +0100 Subject: [PATCH] chore: cleanup todos --- packages/ajax/src/interceptors.js | 1 - packages/button/src/LionButton.js | 1 - packages/choice-input/src/ChoiceGroupMixin.js | 5 --- packages/fieldset/src/FormGroupMixin.js | 5 --- packages/fieldset/test/lion-fieldset.test.js | 1 - packages/input-amount/src/LionInputAmount.js | 4 +-- .../src/LionCalendarOverlayFrame.js | 1 - .../src/LionInputDatepicker.js | 5 ++- .../test-helpers/DatepickerInputObject.js | 1 - .../test/lion-input-datepicker.test.js | 9 ------ packages/localize/src/LocalizeManager.js | 1 - packages/localize/src/date/getWeekdayNames.js | 4 --- packages/overlays/src/OverlayController.js | 8 ++--- packages/overlays/src/OverlayMixin.js | 3 +- .../overlays/test/OverlayController.test.js | 2 +- .../overlays/test/global-positioning.test.js | 12 ------- .../overlays/test/local-positioning.test.js | 31 ++----------------- 17 files changed, 11 insertions(+), 83 deletions(-) diff --git a/packages/ajax/src/interceptors.js b/packages/ajax/src/interceptors.js index 05b177999..6bd785f66 100644 --- a/packages/ajax/src/interceptors.js +++ b/packages/ajax/src/interceptors.js @@ -1,6 +1,5 @@ import { axios } from '@bundled-es-modules/axios'; -// FIXME: lang must be dynamic, fallback to html tag lang attribute or use the user-provided one export function addAcceptLanguageHeaderInterceptorFactory(lang) { return config => { const result = config; diff --git a/packages/button/src/LionButton.js b/packages/button/src/LionButton.js index c49cf2807..3fb3df61e 100644 --- a/packages/button/src/LionButton.js +++ b/packages/button/src/LionButton.js @@ -239,7 +239,6 @@ export class LionButton extends DisabledWithTabIndexMixin(SlotMixin(LitElement)) e.preventDefault(); } - // FIXME: In Edge & IE11, this toggling the active state to prevent bounce, does not work. this.active = true; const keyupHandler = keyupEvent => { if (isKeyboardClickEvent(keyupEvent)) { diff --git a/packages/choice-input/src/ChoiceGroupMixin.js b/packages/choice-input/src/ChoiceGroupMixin.js index 6bc3d93be..f7543c626 100644 --- a/packages/choice-input/src/ChoiceGroupMixin.js +++ b/packages/choice-input/src/ChoiceGroupMixin.js @@ -23,9 +23,6 @@ export const ChoiceGroupMixin = dedupeMixin( get modelValue() { const elems = this._getCheckedElements(); if (this.multipleChoice) { - // TODO: holds for both modelValue and serializedValue of choiceInput: - // consider only allowing strings as values, in which case 'el.value' would suffice - // and choice-input could be simplified return elems.map(el => el.modelValue.value); } return elems[0] ? elems[0].modelValue.value : ''; @@ -79,8 +76,6 @@ export const ChoiceGroupMixin = dedupeMixin( */ addFormElement(child, indexToInsertAt) { this._throwWhenInvalidChildModelValue(child); - // TODO: nice to have or does it have a function (since names are meant as keys for - // formElements)? this.__delegateNameAttribute(child); super.addFormElement(child, indexToInsertAt); } diff --git a/packages/fieldset/src/FormGroupMixin.js b/packages/fieldset/src/FormGroupMixin.js index 1b3b771ba..7d967abd9 100644 --- a/packages/fieldset/src/FormGroupMixin.js +++ b/packages/fieldset/src/FormGroupMixin.js @@ -95,11 +95,6 @@ export const FormGroupMixin = dedupeMixin( this._setValueMapForAllFormElements('formattedValue', values); } - // TODO: should it be any or every? Should we maybe keep track of both, - // so we can configure feedback visibility depending on scenario? - // Should we allow configuring feedback visibility on validator instances - // for maximal flexibility? - // Document this... get prefilled() { return this._everyFormElementHas('prefilled'); } diff --git a/packages/fieldset/test/lion-fieldset.test.js b/packages/fieldset/test/lion-fieldset.test.js index a5b66ca93..3690bbeb6 100644 --- a/packages/fieldset/test/lion-fieldset.test.js +++ b/packages/fieldset/test/lion-fieldset.test.js @@ -64,7 +64,6 @@ describe('', () => { }); // TODO: Tests below belong to FormRegistrarMixin. Preferably run suite integration test - it(`${tagString} has an up to date list of every form element in .formElements`, async () => { const el = await fixture(html`<${tag}>${inputSlots}`); await nextFrame(); diff --git a/packages/input-amount/src/LionInputAmount.js b/packages/input-amount/src/LionInputAmount.js index 7f9ebcbdc..6cf95df27 100644 --- a/packages/input-amount/src/LionInputAmount.js +++ b/packages/input-amount/src/LionInputAmount.js @@ -98,7 +98,7 @@ export class LionInputAmount extends LocalizeMixin(LionInput) { * @override of FormatMixin */ __callParser(value = this.formattedValue) { - // TODO: input and change events both trigger parsing therefore we need to handle the second parse + // TODO: (@daKmor) input and change events both trigger parsing therefore we need to handle the second parse this.__parserCallcountSincePaste += 1; this.__isPasting = this.__parserCallcountSincePaste === 2; this.formatOptions.mode = this.__isPasting === true ? 'pasted' : 'auto'; @@ -122,7 +122,7 @@ export class LionInputAmount extends LocalizeMixin(LionInput) { } __setCurrencyDisplayLabel() { - // TODO: for optimal a11y, abbreviations should be part of aria-label + // TODO: (@erikkroes) for optimal a11y, abbreviations should be part of aria-label // example, for a language switch with text 'en', an aria-label of 'english' is not // sufficient, it should also contain the abbreviation. this._currencyDisplayNode.setAttribute('aria-label', getCurrencyName(this.currency)); diff --git a/packages/input-datepicker/src/LionCalendarOverlayFrame.js b/packages/input-datepicker/src/LionCalendarOverlayFrame.js index 3325ccdc1..54e23e527 100644 --- a/packages/input-datepicker/src/LionCalendarOverlayFrame.js +++ b/packages/input-datepicker/src/LionCalendarOverlayFrame.js @@ -38,7 +38,6 @@ export class LionCalendarOverlayFrame extends LocalizeMixin(LitElement) { static get localizeNamespaces() { return [ { - /* FIXME: This awful switch statement is used to make sure it works with polymer build.. */ 'lion-calendar-overlay-frame': locale => { switch (locale) { case 'bg-BG': diff --git a/packages/input-datepicker/src/LionInputDatepicker.js b/packages/input-datepicker/src/LionInputDatepicker.js index 48dbd12a3..c2f2e965d 100644 --- a/packages/input-datepicker/src/LionInputDatepicker.js +++ b/packages/input-datepicker/src/LionInputDatepicker.js @@ -57,7 +57,6 @@ export class LionInputDatepicker extends OverlayMixin(LionInputDate) { static get localizeNamespaces() { return [ { - /* FIXME: This awful switch statement is used to make sure it works with polymer build.. */ 'lion-input-datepicker': locale => { switch (locale) { case 'bg-BG': @@ -206,6 +205,8 @@ export class LionInputDatepicker extends OverlayMixin(LionInputDate) { */ _overlayTemplate() { // TODO: add performance optimization to only render the calendar if needed + // When not opened (usually on init), it does not need to be rendered. + // This would make first paint quicker return html` ${this.calendarHeading} @@ -245,8 +246,6 @@ export class LionInputDatepicker extends OverlayMixin(LionInputDate) { */ // eslint-disable-next-line class-methods-use-this _invokerTemplate() { - // TODO: aria-expanded should be toggled by Overlay system, to allow local overlays - // (a.k.a. dropdowns) as well. Important: will be breaking for subclassers return html`