Browse Source

docs(iot-hub): cite what a reader can find

Two comments explaining why relevance is the default in both states pointed at an
internal ticket, one of them at three numbered sections of it that are being rewritten
precisely because the code no longer matches them. Neither pointer is reachable from
this repository, and the numbering is due to move.

The reasoning stays inline, with the accepted cost named: the menu reads "Most
relevant" over an install-ordered list until the user types.
pull/16148/head
dshvaika 2 months ago
parent
commit
6aae7899bf
  1. 4
      ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.ts
  2. 9
      ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts

4
ui-ngx/src/app/modules/home/pages/iot-hub/iot-hub-home.component.ts

@ -165,8 +165,8 @@ export class TbIotHubHomeComponent implements OnInit, OnDestroy {
this.searchLoading = true;
const trimmed = text.trim();
// Relevance in both states, the same value every other IoT Hub surface sends: with an
// empty field the backend substitutes the install count, so this panel opens on
// popularity without having to say so. See TBIOH-33 for the decision.
// empty field the backend serves the install count under this key, so the panel opens on
// popularity without this component having to know it.
const query = new MpItemVersionGroupedQuery({}, trimmed, RELEVANCE_SORT_PROPERTY);
// A failed request must not end the subscription: the interceptor reports it, and the
// panel goes back to an empty answer the next keystroke can replace.

9
ui-ngx/src/app/shared/models/iot-hub/iot-hub-item.models.ts

@ -83,10 +83,11 @@ export interface SortOption {
* The sort menu every IoT Hub surface carrying a search field offers, and the order it offers
* them in: the first entry is the default each surface opens on.
*
* Relevance is that default in both states. With text it ranks the answer; with none the backend
* substitutes the install count, so a surface opens on the order it opened on before and nothing
* switches on the field state. Agreed with the product owner and recorded on TBIOH-33, which
* supersedes that ticket's SCOPE-IN 2, SCOPE-IN 4 and AC-4.
* Relevance is that default with or without text. With text it ranks the answer; with none the
* backend serves the install count under the same key, so a surface opens on the order it opened
* on before and nothing here switches on the field state. The cost is a menu reading "Most
* relevant" over an install-ordered list until the user types; the alternative - flipping the
* selector once text appears - moves a control the user did not touch and reorders nothing.
*
* One list rather than one per surface: a new key must reach all of them, and the surface that
* missed it would keep a different default without failing.

Loading…
Cancel
Save