SolidOS / SolidOS/solid-ui

Only first Option is displayed if form depends on custom attribute

Aperta
#248 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug
Lingua principale
TypeScript
Stelle
153
Fork
46
Merge medio
1g 8h
PR unite (30g)
7

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Parti dal punto di ingresso del widget Options, UI.widgets.field[UI.ns.ui('Options').uri], ed esegui la riproduzione dell’issue con un subject che abbia sia valori da sviluppatore sia da power user. Traccia il modo in cui vengono selezionati i casi di dependingOn; il lavoro è completato quando sia [UI for developers] sia [UI for power users] vengono visualizzati in modo coerente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.