SolidOS / SolidOS/solid-ui

Only first Option is displayed if form depends on custom attribute

Offen
#248 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
TypeScript
Sterne
153
Forks
46
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
7

Beschreibung

Consider the following code:

const container = document.getElementById('div-optionsFieldDependingOn')
      const already = {}
      const subject = UI.rdf.namedNode('http://example.com/#this')
      const exampleOptionsField = UI.rdf.namedNode('http://example.com/#exampleOptionsField')
      const store = UI.rdf.namedNode('http://example.com/#store')
      const callbackFunction = (ok, errorMessage) => {
        console.log(ok, errorMessage, document.getElementById('div-optionsFieldDependingOn').innerHTML);
      }

      // This form depends on colour:
      UI.store.add(exampleOptionsField, UI.ns.ui('dependingOn'), UI.rdf.namedNode('http://example.com/#persona'), UI.rdf.namedNode('http://example.com/'))
      
      // UI to display in case subject is blue:
      UI.store.add(exampleOptionsField, UI.ns.ui('case'), UI.rdf.namedNode('http://example.com/#if-subject-is-developer'), UI.rdf.namedNode('http://example.com/'))
      UI.store.add(UI.rdf.namedNode('http://example.com/#if-subject-is-developer'), UI.ns.ui('for'), UI.rdf.namedNode('http://example.com/#developer'), UI.rdf.namedNode('http://example.com/'))
      UI.store.add(UI.rdf.namedNode('http://example.com/#if-subject-is-developer'), UI.ns.ui('use'), UI.rdf.namedNode('http://example.com/#ui-for-developers'), UI.rdf.namedNode('http://example.com/'))
      UI.store.add(UI.rdf.namedNode('http://example.com/#ui-for-developers'), UI.ns.rdf('type'), UI.ns.ui('Comment'))
      UI.store.add(UI.rdf.namedNode('http://example.com/#ui-for-developers'), UI.ns.ui('contents'), '[UI for developers]')
      
      // UI to display in case subject is red:
      UI.store.add(exampleOptionsField, UI.ns.ui('case'), UI.rdf.namedNode('http://example.com/#if-subject-is-power-user'), UI.rdf.namedNode('http://example.com/'))
      UI.store.add(UI.rdf.namedNode('http://example.com/#if-subject-is-power-user'), UI.ns.ui('for'), UI.rdf.namedNode('http://example.com/#power-user'), UI.rdf.namedNode('http://example.com/'))
      UI.store.add(UI.rdf.namedNode('http://example.com/#if-subject-is-power-user'), UI.ns.ui('use'), UI.rdf.namedNode('http://example.com/#ui-for-power-users'), UI.rdf.namedNode('http://example.com/'))
      UI.store.add(UI.rdf.namedNode('http://example.com/#ui-for-power-users'), UI.ns.rdf('type'), UI.ns.ui('Comment'))
      UI.store.add(UI.rdf.namedNode('http://example.com/#ui-for-power-users'), UI.ns.ui('contents'), '[UI for power users]')

      // Subject is both a developer and a power user, so it should display both [UI for developers] and [UI for power users]
      // but see 
      UI.store.add(subject, UI.rdf.namedNode('http://example.com/#persona'), UI.rdf.namedNode('http://example.com/#developer'), UI.rdf.namedNode('http://example.com/'))
      UI.store.add(subject, UI.rdf.namedNode('http://example.com/#persona'), UI.rdf.namedNode('http://example.com/#power-user'), UI.rdf.namedNode('http://example.com/'))
      
      // FIXME: https://github.com/solid/solid-ui/issues/239
      document.outlineManager = {
        appendPropertyTRs: () => {}
      }
      const result = UI.widgets.field[UI.ns.ui('Options').uri](
        document,
        container,
        already,
        subject,
        exampleOptionsField,
        store,
        callbackFunction
      )

You would expect it to display both the developer and the power user UI but it only displays one of them, at random.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie am Einstiegspunkt des Options-Widgets, UI.widgets.field[UI.ns.ui('Options').uri], und führen Sie die Reproduktion aus dem Issue mit einem subject durch, das sowohl Entwickler- als auch Power-User-Werte besitzt. Verfolgen Sie, wie die dependingOn-Fälle ausgewählt werden; abgeschlossen ist die Aufgabe, wenn sowohl [UI for developers] als auch [UI for power users] konsistent angezeigt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.