solid-panes 4.2.4-test.6 → 4.2.4-test.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schedule/schedulePane.js +39 -4
- package/dist/solid-panes.js +1815 -751
- package/dist/solid-panes.js.map +1 -1
- package/dist/solid-panes.min.js +38 -39
- package/dist/solid-panes.min.js.map +1 -1
- package/dist/versionInfo.js +15 -15
- package/package.json +6 -6
|
@@ -423,9 +423,29 @@ const schedulePane = exports.schedulePane = {
|
|
|
423
423
|
const showForms = function () {
|
|
424
424
|
clearElement(naviCenter); // Remove refresh button if nec
|
|
425
425
|
const div = naviMain;
|
|
426
|
+
|
|
427
|
+
// form2 depends on sched:allDay; seed a local default for new polls
|
|
428
|
+
if (!kb.any(subject, ns.sched('allDay'))) {
|
|
429
|
+
kb.add(subject, ns.sched('allDay'), $rdf.literal('true', undefined, $rdf.sym('http://www.w3.org/2001/XMLSchema#boolean')), detailsDoc);
|
|
430
|
+
}
|
|
426
431
|
const wizard = true;
|
|
427
432
|
let currentSlide = 0;
|
|
428
433
|
let gotDoneButton = false;
|
|
434
|
+
const hasFormControls = function (container) {
|
|
435
|
+
return !!container.querySelector('input, select, textarea, button');
|
|
436
|
+
};
|
|
437
|
+
const asBoolean = function (term, fallback) {
|
|
438
|
+
if (!term) return fallback;
|
|
439
|
+
const value = (term.value || '').toLowerCase();
|
|
440
|
+
if (value === 'true' || value === '1') return true;
|
|
441
|
+
if (value === 'false' || value === '0') return false;
|
|
442
|
+
return fallback;
|
|
443
|
+
};
|
|
444
|
+
const renderTimeProposalFallback = function (slide) {
|
|
445
|
+
const allDayValue = asBoolean(kb.any(subject, ns.sched('allDay')), true);
|
|
446
|
+
const fallbackForm = kb.sym(formsURI + (allDayValue ? '#AllDayForm2' : '#NotAllDayForm2'));
|
|
447
|
+
UI.widgets.appendForm(document, slide, {}, subject, fallbackForm, detailsDoc, complainIfBad);
|
|
448
|
+
};
|
|
429
449
|
if (wizard) {
|
|
430
450
|
const forms = [form1, form2, form3];
|
|
431
451
|
const slides = [];
|
|
@@ -433,6 +453,11 @@ const schedulePane = exports.schedulePane = {
|
|
|
433
453
|
for (let f = 0; f < forms.length; f++) {
|
|
434
454
|
const slide = dom.createElement('div');
|
|
435
455
|
UI.widgets.appendForm(document, slide, {}, subject, forms[f], detailsDoc, complainIfBad);
|
|
456
|
+
|
|
457
|
+
// Some stores end up with form2's ui:Options unresolved; force a usable input form.
|
|
458
|
+
if (f === 1 && !hasFormControls(slide)) {
|
|
459
|
+
renderTimeProposalFallback(slide);
|
|
460
|
+
}
|
|
436
461
|
slides.push(slide);
|
|
437
462
|
}
|
|
438
463
|
const refresh = function () {
|
|
@@ -649,7 +674,7 @@ const schedulePane = exports.schedulePane = {
|
|
|
649
674
|
|
|
650
675
|
// Read or create empty results file
|
|
651
676
|
function getResults() {
|
|
652
|
-
fetcher.nowOrWhenFetched(resultsDoc.uri, (ok, body, response) => {
|
|
677
|
+
fetcher.nowOrWhenFetched(resultsDoc.uri, undefined, (ok, body, response) => {
|
|
653
678
|
if (!ok) {
|
|
654
679
|
if (response.status === 404) {
|
|
655
680
|
// / Check explicitly for 404 error
|
|
@@ -717,13 +742,19 @@ const schedulePane = exports.schedulePane = {
|
|
|
717
742
|
options.set_x = kb.each(subject, ns.sched('option')); // @@@@@ option -> dtstart in future
|
|
718
743
|
options.set_x = options.set_x.map(function (opt) {
|
|
719
744
|
return kb.any(opt, ns.cal('dtstart'));
|
|
745
|
+
}).filter(function (time) {
|
|
746
|
+
return !!time;
|
|
720
747
|
});
|
|
721
748
|
options.set_y = kb.each(subject, ns.sched('response'));
|
|
722
749
|
options.set_y = options.set_y.map(function (resp) {
|
|
723
750
|
return kb.any(resp, ns.dc('author'));
|
|
751
|
+
}).filter(function (author) {
|
|
752
|
+
return !!author;
|
|
724
753
|
});
|
|
725
754
|
const possibleTimes = kb.each(invitation, ns.sched('option')).map(function (opt) {
|
|
726
755
|
return kb.any(opt, ns.cal('dtstart'));
|
|
756
|
+
}).filter(function (time) {
|
|
757
|
+
return !!time;
|
|
727
758
|
});
|
|
728
759
|
const displayTheMatrix = function () {
|
|
729
760
|
const matrix = div.appendChild(UI.matrix.matrixForQuery(dom, query, v.time, v.author, v.value, options, function () {}));
|
|
@@ -780,6 +811,7 @@ const schedulePane = exports.schedulePane = {
|
|
|
780
811
|
}; // @@ may need that
|
|
781
812
|
const selectOptions = {};
|
|
782
813
|
const predicate = ns.sched('availabilty');
|
|
814
|
+
if (!x) return;
|
|
783
815
|
const cellSubject = dataPointForNT[x.toNT()];
|
|
784
816
|
const selector = UI.widgets.makeSelectForOptions(dom, kb, cellSubject, predicate, possibleAvailabilities, selectOptions, resultsDoc, callbackFunction);
|
|
785
817
|
cell.appendChild(selector);
|
|
@@ -805,15 +837,18 @@ const schedulePane = exports.schedulePane = {
|
|
|
805
837
|
const dps = kb.each(myResponse, ns.sched('cell'));
|
|
806
838
|
dps.forEach(function (dataPoint) {
|
|
807
839
|
const time = kb.any(dataPoint, ns.cal('dtstart'));
|
|
840
|
+
if (!time) return;
|
|
808
841
|
dataPointForNT[time.toNT()] = dataPoint;
|
|
809
842
|
});
|
|
810
843
|
}
|
|
811
844
|
for (let j = 0; j < possibleTimes.length; j++) {
|
|
812
|
-
|
|
845
|
+
const possibleTime = possibleTimes[j];
|
|
846
|
+
if (!possibleTime) continue;
|
|
847
|
+
if (dataPointForNT[possibleTime.toNT()]) continue;
|
|
813
848
|
const dataPoint = $rdf.sym(id + '_' + j);
|
|
814
849
|
insertables.push($rdf.st(myResponse, ns.sched('cell'), dataPoint, doc));
|
|
815
|
-
insertables.push($rdf.st(dataPoint, ns.cal('dtstart'),
|
|
816
|
-
dataPointForNT[
|
|
850
|
+
insertables.push($rdf.st(dataPoint, ns.cal('dtstart'), possibleTime, doc)); // @@
|
|
851
|
+
dataPointForNT[possibleTime.toNT()] = dataPoint;
|
|
817
852
|
}
|
|
818
853
|
if (insertables.length) {
|
|
819
854
|
kb.updater.update([], insertables, function (uri, success, errorBody) {
|