-
Notifications
You must be signed in to change notification settings - Fork 52
Fix SchedulePane not rendering in folder-view #576
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
504ed5c
d3cffaf
e6ddf2c
cea7ff8
b353794
a56d4a8
0b1b7c9
022d123
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -557,9 +557,53 @@ export const schedulePane = { | |
| const showForms = function () { | ||
| clearElement(naviCenter) // Remove refresh button if nec | ||
| const div = naviMain | ||
|
|
||
| // form2 depends on sched:allDay; seed a local default for new polls | ||
| if (!kb.any(subject, ns.sched('allDay'))) { | ||
| kb.add( | ||
| subject, | ||
| ns.sched('allDay'), | ||
| $rdf.literal( | ||
| 'true', | ||
| undefined, | ||
| $rdf.sym('http://www.w3.org/2001/XMLSchema#boolean') | ||
| ), | ||
| detailsDoc | ||
| ) | ||
| } | ||
|
|
||
| const wizard = true | ||
| let currentSlide = 0 | ||
| let gotDoneButton = false | ||
|
|
||
| const hasFormControls = function (container) { | ||
| return !!container.querySelector('input, select, textarea, button') | ||
| } | ||
|
|
||
| const asBoolean = function (term, fallback) { | ||
| if (!term) return fallback | ||
| const value = (term.value || '').toLowerCase() | ||
| if (value === 'true' || value === '1') return true | ||
| if (value === 'false' || value === '0') return false | ||
| return fallback | ||
| } | ||
|
|
||
| const renderTimeProposalFallback = function (slide) { | ||
| const allDayValue = asBoolean(kb.any(subject, ns.sched('allDay')), true) | ||
| const fallbackForm = kb.sym( | ||
| formsURI + (allDayValue ? '#AllDayForm2' : '#NotAllDayForm2') | ||
| ) | ||
| UI.widgets.appendForm( | ||
| document, | ||
| slide, | ||
| {}, | ||
| subject, | ||
| fallbackForm, | ||
| detailsDoc, | ||
| complainIfBad | ||
| ) | ||
| } | ||
|
Comment on lines
+628
to
+642
|
||
|
|
||
| if (wizard) { | ||
| const forms = [form1, form2, form3] | ||
| const slides = [] | ||
|
|
@@ -575,6 +619,12 @@ export const schedulePane = { | |
| detailsDoc, | ||
| complainIfBad | ||
|
Comment on lines
648
to
657
|
||
| ) | ||
|
|
||
| // Some stores end up with form2's ui:Options unresolved; force a usable input form. | ||
| if (f === 1 && !hasFormControls(slide)) { | ||
| renderTimeProposalFallback(slide) | ||
| } | ||
|
|
||
| slides.push(slide) | ||
| } | ||
|
|
||
|
|
@@ -882,7 +932,7 @@ export const schedulePane = { | |
|
|
||
| // Read or create empty results file | ||
| function getResults () { | ||
| fetcher.nowOrWhenFetched(resultsDoc.uri, (ok, body, response) => { | ||
| fetcher.nowOrWhenFetched(resultsDoc.uri, undefined, (ok, body, response) => { | ||
| if (!ok) { | ||
| if (response.status === 404) { | ||
| // / Check explicitly for 404 error | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
showForms, the newdetailsDocis derived from the resolvedinvitation(details.ttl#event), but this block seedssched:allDayon the originalsubject. When the pane is invoked from folder-view,subjectcan beindex.ttl#this, which would write triples about the index subject intodetails.ttl, and the later UI (which reads title/comment/etc frominvitation) won’t see the values. Pick a single canonical poll subject (likelyinvitation/thisInstance) and use it consistently for all reads/writes in the form flow.