issue-pane 2.4.10-e234bb2d → 2.4.10-e9bc48a6
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/.github/workflows/ci.yml +0 -1
- package/.nvmrc +1 -1
- package/issue.js +83 -75
- package/issuePane.js +25 -19
- package/newIssue.js +15 -19
- package/newTracker.js +14 -13
- package/package.json +1 -1
package/.github/workflows/ci.yml
CHANGED
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v16.14.0
|
package/issue.js
CHANGED
|
@@ -8,11 +8,23 @@ const $rdf = rdf
|
|
|
8
8
|
|
|
9
9
|
const SET_MODIFIED_DATES = false
|
|
10
10
|
|
|
11
|
+
export const TASK_ICON = icons.iconBase + 'noun_17020_gray-tick.svg'
|
|
12
|
+
export const OPEN_TASK_ICON = icons.iconBase + 'noun_17020_sans-tick.svg'
|
|
13
|
+
export const CLOSED_TASK_ICON = icons.iconBase + 'noun_17020.svg'
|
|
14
|
+
|
|
11
15
|
function complain (message, context) {
|
|
12
16
|
console.warn(message)
|
|
13
17
|
context.paneDiv.appendChild(widgets.errorMessageBlock(context.dom, message))
|
|
14
18
|
}
|
|
15
19
|
|
|
20
|
+
export function isOpen (issue) {
|
|
21
|
+
const types = store.findTypeURIs(issue)
|
|
22
|
+
return !!types[ns.wf('Open').uri]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function iconForIssue (issue) {
|
|
26
|
+
return isOpen(issue) ? TASK_ICON : CLOSED_TASK_ICON
|
|
27
|
+
}
|
|
16
28
|
export function getState (issue, classification) {
|
|
17
29
|
const tracker = store.the(issue, ns.wf('tracker'), null, issue.doc())
|
|
18
30
|
const states = store.any(tracker, ns.wf('issueClass'))
|
|
@@ -20,33 +32,34 @@ export function getState (issue, classification) {
|
|
|
20
32
|
const types = store.each(issue, ns.rdf('type'))
|
|
21
33
|
.filter(ty => store.holds(ty, ns.rdfs('subClassOf'), classification))
|
|
22
34
|
if (types.length !== 1) {
|
|
23
|
-
// const initialState =
|
|
35
|
+
// const initialState = store.any(tracker, ns.wf('initialState')) No do NOT default
|
|
24
36
|
// if (initialState) return initialState
|
|
25
37
|
throw new Error('Issue must have one type as state: ' + types.length)
|
|
26
38
|
}
|
|
27
39
|
return types[0]
|
|
28
40
|
}
|
|
29
41
|
|
|
30
|
-
export function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const catColors = classes.map(cat => store.any(cat, ns.ui('backgroundColor'))).filter(c => !!c)
|
|
42
|
+
export function getBackgroundColorFromTypes (issue) {
|
|
43
|
+
const classes = store.each(issue, ns.rdf('type')) // @@ pick cats in order then state
|
|
44
|
+
const catColors = classes.map(cat => store.any(cat, ns.ui('backgroundColor'))).filter(c => !!c)
|
|
34
45
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
if (catColors.length) return catColors[0].value // pick first one
|
|
47
|
+
return null
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function renderIssueCard (issue, context) {
|
|
38
51
|
function refresh () {
|
|
39
|
-
const backgroundColor =
|
|
52
|
+
const backgroundColor = getBackgroundColorFromTypes(issue) || 'white'
|
|
40
53
|
card.style.backgroundColor = backgroundColor
|
|
41
54
|
editButton.style.backgroundColor = backgroundColor // Override white from style sheet
|
|
42
55
|
}
|
|
43
56
|
const dom = context.dom
|
|
44
|
-
const uncategorized = !
|
|
57
|
+
const uncategorized = !getBackgroundColorFromTypes(issue) // This is a suspect issue. Prompt to delete it
|
|
45
58
|
|
|
46
59
|
const card = dom.createElement('div')
|
|
47
60
|
const table = card.appendChild(dom.createElement('table'))
|
|
48
61
|
table.style.width = '100%'
|
|
49
|
-
const options = { draggable: false } // Let the
|
|
62
|
+
const options = { draggable: false } // Let the board make the whole card draggable
|
|
50
63
|
table.appendChild(widgets.personTR(dom, null, issue, options))
|
|
51
64
|
table.subject = issue
|
|
52
65
|
card.style = 'border-radius: 0.4em; border: 0.05em solid grey; margin: 0.3em;'
|
|
@@ -100,15 +113,21 @@ export function exposeOverlay (subject, context) {
|
|
|
100
113
|
overlay.firstChild.style.overflow = 'auto' // was scroll
|
|
101
114
|
}
|
|
102
115
|
|
|
116
|
+
function renderSpacer (dom, backgroundColor) {
|
|
117
|
+
const spacer = dom.createElement('div')
|
|
118
|
+
spacer.setAttribute('style', 'height: 1em; margin: 0.5em;') // spacer and placeHolder
|
|
119
|
+
spacer.style.backgroundColor = backgroundColor // try that
|
|
120
|
+
return spacer
|
|
121
|
+
}
|
|
122
|
+
|
|
103
123
|
export function renderIssue (issue, context) {
|
|
104
124
|
// Don't bother changing the last modified dates of things: save time
|
|
105
125
|
function setModifiedDate (subj, store, doc) {
|
|
106
126
|
if (SET_MODIFIED_DATES) {
|
|
107
127
|
if (!getOption(tracker, 'trackLastModified')) return
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
)
|
|
128
|
+
const deletions = store.statementsMatching(issue, ns.dct('modified'))
|
|
129
|
+
.concat(store.statementsMatching(issue, ns.wf('modifiedBy'))
|
|
130
|
+
)
|
|
112
131
|
const insertions = [$rdf.st(issue, ns.dct('modified'), new Date(), doc)]
|
|
113
132
|
if (me) insertions.push($rdf.st(issue, ns.wf('modifiedBy'), me, doc))
|
|
114
133
|
store.updater.update(deletions, insertions, function (_uri, _ok, _body) {})
|
|
@@ -123,7 +142,7 @@ export function renderIssue (issue, context) {
|
|
|
123
142
|
return pre
|
|
124
143
|
}
|
|
125
144
|
|
|
126
|
-
|
|
145
|
+
function timestring () {
|
|
127
146
|
const now = new Date()
|
|
128
147
|
return '' + now.getTime()
|
|
129
148
|
// http://www.w3schools.com/jsref/jsref_obj_date.asp
|
|
@@ -149,21 +168,15 @@ export function renderIssue (issue, context) {
|
|
|
149
168
|
}
|
|
150
169
|
|
|
151
170
|
function setPaneStyle () {
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
for (const uri in types) {
|
|
156
|
-
backgroundColor = store.any(
|
|
157
|
-
store.sym(uri),
|
|
158
|
-
store.sym('http://www.w3.org/ns/ui#backgroundColor')
|
|
159
|
-
)
|
|
160
|
-
if (backgroundColor) break
|
|
161
|
-
}
|
|
162
|
-
backgroundColor = backgroundColor ? backgroundColor.value : '#eee' // default grey
|
|
163
|
-
mystyle += 'background-color: ' + backgroundColor + '; '
|
|
171
|
+
const backgroundColor = getBackgroundColorFromTypes(issue) || '#eee' // default grey
|
|
172
|
+
const mystyle0 = 'padding: 0.5em 1.5em 1em 1.5em; border: 0.7em;'
|
|
173
|
+
const mystyle = mystyle0 + 'border-color: ' + backgroundColor + '; '
|
|
164
174
|
issueDiv.setAttribute('style', mystyle)
|
|
175
|
+
issueDiv.style.backgroundColor = 'white'
|
|
165
176
|
}
|
|
166
177
|
|
|
178
|
+
/// ////////////// Body of renderIssue
|
|
179
|
+
|
|
167
180
|
const dom = context.dom
|
|
168
181
|
// eslint-disable-next-line no-use-before-define
|
|
169
182
|
const tracker = store.the(issue, ns.wf('tracker'), null, issue.doc())
|
|
@@ -174,11 +187,15 @@ export function renderIssue (issue, context) {
|
|
|
174
187
|
|
|
175
188
|
const issueDiv = dom.createElement('div')
|
|
176
189
|
const me = authn.currentUser()
|
|
190
|
+
const backgroundColor = getBackgroundColorFromTypes(issue) || 'white'
|
|
177
191
|
|
|
178
192
|
setPaneStyle()
|
|
179
193
|
|
|
180
194
|
authn.checkUser() // kick off async operation
|
|
181
195
|
|
|
196
|
+
const iconButton = issueDiv.appendChild(widgets.button(dom, iconForIssue(issue)))
|
|
197
|
+
widgets.makeDraggable(iconButton, issue) // Drag me wherever you need to do stuff with this issue
|
|
198
|
+
|
|
182
199
|
const states = store.any(tracker, ns.wf('issueClass'))
|
|
183
200
|
if (!states) { throw new Error('This tracker ' + tracker + ' has no issueClass') }
|
|
184
201
|
const select = widgets.makeSelectForCategory(
|
|
@@ -199,13 +216,13 @@ export function renderIssue (issue, context) {
|
|
|
199
216
|
issueDiv.appendChild(select)
|
|
200
217
|
|
|
201
218
|
const cats = store.each(tracker, ns.wf('issueCategory')) // zero or more
|
|
202
|
-
for (
|
|
219
|
+
for (const cat of cats) {
|
|
203
220
|
issueDiv.appendChild(
|
|
204
221
|
widgets.makeSelectForCategory(
|
|
205
222
|
dom,
|
|
206
223
|
store,
|
|
207
224
|
issue,
|
|
208
|
-
|
|
225
|
+
cat,
|
|
209
226
|
stateStore,
|
|
210
227
|
function (ok, body) {
|
|
211
228
|
if (ok) {
|
|
@@ -254,31 +271,17 @@ export function renderIssue (issue, context) {
|
|
|
254
271
|
`
|
|
255
272
|
const CORE_ISSUE_FORM = ns.wf('coreIsueForm')
|
|
256
273
|
$rdf.parse(coreIssueFormText, store, CORE_ISSUE_FORM.doc().uri, 'text/turtle')
|
|
257
|
-
widgets.appendForm(
|
|
274
|
+
const form = widgets.appendForm(
|
|
258
275
|
dom,
|
|
259
|
-
|
|
276
|
+
null, // was: container
|
|
260
277
|
{},
|
|
261
278
|
issue,
|
|
262
279
|
CORE_ISSUE_FORM,
|
|
263
280
|
stateStore,
|
|
264
281
|
complainIfBad
|
|
265
282
|
)
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
/*
|
|
269
|
-
issueDiv.appendChild(
|
|
270
|
-
widgets.makeDescription(
|
|
271
|
-
dom,
|
|
272
|
-
kb,
|
|
273
|
-
issue,
|
|
274
|
-
ns.wf('description'),
|
|
275
|
-
store,
|
|
276
|
-
function (ok, body) {
|
|
277
|
-
if (ok) setModifiedDate(store, kb, store)
|
|
278
|
-
else console.log('Failed to change description:\n' + body)
|
|
279
|
-
}
|
|
280
|
-
)
|
|
281
|
-
) */
|
|
283
|
+
issueDiv.appendChild(form)
|
|
284
|
+
form.style.backgroundColor = backgroundColor
|
|
282
285
|
|
|
283
286
|
// Assigned to whom?
|
|
284
287
|
|
|
@@ -299,20 +302,16 @@ export function renderIssue (issue, context) {
|
|
|
299
302
|
// Anyone assigned to any issue we know about
|
|
300
303
|
|
|
301
304
|
async function getPossibleAssignees () {
|
|
302
|
-
let devs = []
|
|
303
305
|
const devGroups = store.each(issue, ns.wf('assigneeGroup'))
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
await store.fetcher.load()
|
|
307
|
-
devs = devs.concat(store.each(group, ns.vcard('member')))
|
|
308
|
-
}
|
|
306
|
+
await store.fetcher.load(devGroups) // Load them all
|
|
307
|
+
const groupDevs = devGroups.map(group => store.each(group, ns.vcard('member'), null, group.doc())).flat()
|
|
309
308
|
// Anyone who is a developer of any project which uses this tracker
|
|
310
309
|
const proj = store.any(null, ns.doap('bug-database'), tracker) // What project?
|
|
311
310
|
if (proj) {
|
|
312
311
|
await store.fetcher.load(proj)
|
|
313
|
-
devs = devs.concat(store.each(proj, ns.doap('developer')))
|
|
314
312
|
}
|
|
315
|
-
|
|
313
|
+
const projectDevs = proj ? store.each(proj, ns.doap('developer')) : []
|
|
314
|
+
return groupDevs.concat(projectDevs)
|
|
316
315
|
}
|
|
317
316
|
|
|
318
317
|
// Super issues first - like parent directories .. maybe use breadcrums from?? @@
|
|
@@ -354,27 +353,36 @@ export function renderIssue (issue, context) {
|
|
|
354
353
|
}
|
|
355
354
|
})
|
|
356
355
|
|
|
357
|
-
/* The trees of super
|
|
356
|
+
/* The trees of super-issues and sub-issues
|
|
358
357
|
*/
|
|
359
|
-
|
|
358
|
+
function supersOver (issue, stack) {
|
|
359
|
+
stack = stack || []
|
|
360
|
+
const sup = store.any(null, ns.wf('dependent'), issue, issue.doc())
|
|
361
|
+
if (sup) return supersOver(sup, [sup].concat(stack))
|
|
362
|
+
return stack
|
|
363
|
+
}
|
|
360
364
|
if (getOption(tracker, 'allowSubIssues')) {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
subIssuePanel.style = 'margin: 1em; padding: 1em;'
|
|
364
|
-
}
|
|
365
|
+
const subIssuePanel = issueDiv.appendChild(dom.createElement('div'))
|
|
366
|
+
subIssuePanel.style = 'margin: 1em; padding: 1em;'
|
|
365
367
|
|
|
366
368
|
subIssuePanel.appendChild(dom.createElement('h4')).textContent = 'Super Issues'
|
|
367
369
|
const listOfSupers = subIssuePanel.appendChild(dom.createElement('div'))
|
|
370
|
+
listOfSupers.style.display = 'flex'
|
|
368
371
|
listOfSupers.refresh = function () {
|
|
369
|
-
|
|
372
|
+
// const supers = store.each(null, ns.wf('dependent'), issue, issue.doc())
|
|
373
|
+
const supers = supersOver(issue)
|
|
374
|
+
utils.syncTableToArrayReOrdered(listOfSupers, supers, renderSubIssue)
|
|
370
375
|
}
|
|
371
376
|
listOfSupers.refresh()
|
|
372
377
|
|
|
373
378
|
// Sub issues
|
|
374
379
|
subIssuePanel.appendChild(dom.createElement('h4')).textContent = 'Sub Issues'
|
|
375
380
|
const listOfSubs = subIssuePanel.appendChild(dom.createElement('div'))
|
|
381
|
+
listOfSubs.style.display = 'flex'
|
|
382
|
+
listOfSubs.style.flexDirection = 'reverse' // Or center
|
|
376
383
|
listOfSubs.refresh = function () {
|
|
377
|
-
|
|
384
|
+
const subs = store.each(issue, ns.wf('dependent'), null, issue.doc())
|
|
385
|
+
utils.syncTableToArrayReOrdered(listOfSubs, subs, renderSubIssue)
|
|
378
386
|
}
|
|
379
387
|
listOfSubs.refresh()
|
|
380
388
|
|
|
@@ -407,20 +415,20 @@ export function renderIssue (issue, context) {
|
|
|
407
415
|
stateStore,
|
|
408
416
|
complainIfBad
|
|
409
417
|
)
|
|
418
|
+
// issueDiv.appendChild(renderSpacer(backgroundColor))
|
|
410
419
|
}
|
|
411
420
|
|
|
412
421
|
// Comment/discussion area
|
|
413
422
|
|
|
414
|
-
const spacer = issueDiv.appendChild(dom
|
|
415
|
-
spacer.setAttribute('style', 'height: 1em') // spacer and placeHolder
|
|
423
|
+
const spacer = issueDiv.appendChild(renderSpacer(dom, backgroundColor))
|
|
416
424
|
|
|
417
425
|
const template = store.anyValue(tracker, ns.wf('issueURITemplate'))
|
|
418
426
|
/*
|
|
419
|
-
var chatDocURITemplate =
|
|
427
|
+
var chatDocURITemplate = store.anyValue(tracker, ns.wf('chatDocURITemplate')) // relaive to issue
|
|
420
428
|
var chat
|
|
421
429
|
if (chatDocURITemplate) {
|
|
422
430
|
let template = $rdf.uri.join(chatDocURITemplate, issue.uri) // Template is relative to issue
|
|
423
|
-
chat =
|
|
431
|
+
chat = store.sym(expandTemplate(template))
|
|
424
432
|
} else
|
|
425
433
|
*/
|
|
426
434
|
let messageStore
|
|
@@ -440,7 +448,8 @@ export function renderIssue (issue, context) {
|
|
|
440
448
|
} else {
|
|
441
449
|
const discussion = messageArea(dom, store, issue, messageStore)
|
|
442
450
|
issueDiv.insertBefore(discussion, spacer)
|
|
443
|
-
|
|
451
|
+
issueDiv.insertBefore(renderSpacer(dom, backgroundColor), discussion)
|
|
452
|
+
} // Not sure why e stuck this in upwards rather than downwards
|
|
444
453
|
})
|
|
445
454
|
|
|
446
455
|
// Draggable attachment list
|
|
@@ -448,12 +457,11 @@ export function renderIssue (issue, context) {
|
|
|
448
457
|
attachmentHint.innerHTML = `<h4>Attachments</h4>
|
|
449
458
|
<p>Drag files, emails,
|
|
450
459
|
web pages onto the paper clip, or click the file upload button.</p>`
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
}
|
|
460
|
+
const uploadFolderURI =
|
|
461
|
+
issue.uri.endsWith('/index.ttl#this') // This has a whole folder to itself
|
|
462
|
+
? issue.uri.slice(0, 14) + 'Files/' // back to slash
|
|
463
|
+
: issue.dir().uri + 'Files/' + issue.uri.split('#')[1] + '/' // New folder for issue in file with others
|
|
464
|
+
|
|
457
465
|
widgets.attachmentList(dom, issue, issueDiv, {
|
|
458
466
|
doc: stateStore,
|
|
459
467
|
promptIcon: icons.iconBase + 'noun_25830.svg',
|
package/issuePane.js
CHANGED
|
@@ -61,7 +61,7 @@ export default {
|
|
|
61
61
|
return Promise.all(updates)
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
const kb = context.session.store
|
|
65
65
|
const ns = UI.ns
|
|
66
66
|
let stateStore
|
|
67
67
|
if (options.newInstance) {
|
|
@@ -140,41 +140,49 @@ export default {
|
|
|
140
140
|
** This is would not be needed if our quey language
|
|
141
141
|
** allowed is to query ardf Collection membership.
|
|
142
142
|
*/
|
|
143
|
-
async function fixSubClasses (kb, tracker) {
|
|
143
|
+
async function fixSubClasses (kb, tracker) { // 20220228
|
|
144
144
|
async function checkOneSuperclass (klass) {
|
|
145
145
|
const collection = kb.any(klass, ns.owl('disjointUnionOf'), null, doc)
|
|
146
146
|
if (!collection) throw new Error(`Classification ${klass} has no disjointUnionOf`)
|
|
147
147
|
if (!collection.elements) throw new Error(`Classification ${klass} has no array`)
|
|
148
148
|
const needed = new Set(collection.elements.map(x => x.uri))
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
|
|
150
|
+
const existing = new Set(kb.each(null, ns.rdfs('subClassOf'), klass, doc).map(x => x.uri))
|
|
151
|
+
const superfluous = existing.filter(sub => !needed.has(sub))
|
|
152
|
+
const deleteActions = superfluous.map(sub => { return { action: 'delete', st: $rdf.st(kb.sym(sub), ns.rdfs('subClassOf'), klass, doc) } })
|
|
153
|
+
/*
|
|
151
154
|
for (const sub of existing) {
|
|
152
155
|
if (!needed.has(sub)) {
|
|
153
156
|
deletables.push($rdf.st(kb.sym(sub), ns.rdfs('subClassOf'), klass, doc))
|
|
154
157
|
}
|
|
155
158
|
}
|
|
159
|
+
*/
|
|
160
|
+
const missing = needed.filter(sub => !existing.has(sub))
|
|
161
|
+
const insertActions = missing.ma(sub => { return { action: 'insert', st: $rdf.st(kb.sym(sub), ns.rdfs('subClassOf'), klass, doc) } })
|
|
162
|
+
/*
|
|
156
163
|
for (const sub of needed) {
|
|
157
164
|
if (!existing.has(sub)) {
|
|
158
165
|
insertables.push($rdf.st(kb.sym(sub), ns.rdfs('subClassOf'), klass, doc))
|
|
159
166
|
}
|
|
160
167
|
}
|
|
168
|
+
*/
|
|
169
|
+
return deleteActions.concat(insertActions)
|
|
161
170
|
}
|
|
162
171
|
const doc = tracker.doc()
|
|
163
172
|
const states = kb.any(tracker, ns.wf('issueClass'))
|
|
164
|
-
const cats = kb.each(tracker, ns.wf('issueCategory'))
|
|
165
|
-
|
|
166
|
-
var deletables = []
|
|
167
|
-
cats.push(states)
|
|
173
|
+
const cats = kb.each(tracker, ns.wf('issueCategory')).concat([states])
|
|
174
|
+
let damage = [] // to make totally functionaly need to deal with map over async.
|
|
168
175
|
for (const klass of cats) {
|
|
169
|
-
await checkOneSuperclass(klass)
|
|
176
|
+
damage = damage.concat(await checkOneSuperclass(klass))
|
|
170
177
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
178
|
+
if (damage.length) {
|
|
179
|
+
const insertables = damage.filter(fix => fix.action === 'insert').map(fix => fix.st)
|
|
180
|
+
const deletables = damage.filter(fix => fix.action === 'delete').map(fix => fix.st)
|
|
181
|
+
// alert(`Internal error: s${damage} subclasses inconsistences!`)
|
|
182
|
+
console.log('Damage:', damage)
|
|
175
183
|
if (confirm(`Fix ${damage} inconsistent subclasses in tracker config?`)) {
|
|
176
184
|
await kb.updater.update(deletables, insertables)
|
|
177
|
-
|
|
185
|
+
}
|
|
178
186
|
}
|
|
179
187
|
}
|
|
180
188
|
|
|
@@ -256,7 +264,7 @@ export default {
|
|
|
256
264
|
const states = store.any(subject, ns.wf('issueClass'))
|
|
257
265
|
const cats = store.each(tracker, ns.wf('issueCategory')) // zero or more
|
|
258
266
|
const vars = ['issue', 'state', 'created']
|
|
259
|
-
|
|
267
|
+
const query = new $rdf.Query(UI.utils.label(subject))
|
|
260
268
|
for (let i = 0; i < cats.length; i++) {
|
|
261
269
|
vars.push('_cat_' + i)
|
|
262
270
|
}
|
|
@@ -396,7 +404,7 @@ export default {
|
|
|
396
404
|
const items = [instancesView, tableView, states]
|
|
397
405
|
.concat(store.each(tracker, ns.wf('issueCategory')))
|
|
398
406
|
items.push(settingsView)
|
|
399
|
-
const selectedTab = tableView
|
|
407
|
+
const selectedTab = tableView.uri
|
|
400
408
|
const options = { renderMain, items, selectedTab }
|
|
401
409
|
|
|
402
410
|
// Add stuff to the ontologies which we believe but they don't say
|
|
@@ -437,7 +445,7 @@ export default {
|
|
|
437
445
|
h.appendChild(dom.createTextNode(classLabel + ' list')) // Use class label @@I18n
|
|
438
446
|
|
|
439
447
|
// New Issue button
|
|
440
|
-
|
|
448
|
+
const b = dom.createElement('button')
|
|
441
449
|
const container = dom.createElement('div')
|
|
442
450
|
b.setAttribute('type', 'button')
|
|
443
451
|
b.setAttribute('style', 'padding: 0.3em; font-size: 100%; margin: 0.5em; display: flex; align-items: center;')
|
|
@@ -572,8 +580,6 @@ export default {
|
|
|
572
580
|
overlay.style = OVERFLOW_STYLE
|
|
573
581
|
overlay.style.visibility = 'hidden'
|
|
574
582
|
|
|
575
|
-
// var overlayPane = null // overlay.appendChild(dom.createElement('div')) // avoid stomping on style by pane
|
|
576
|
-
|
|
577
583
|
authn.checkUser().then(webId => {
|
|
578
584
|
if (webId) {
|
|
579
585
|
console.log('Web ID set already: ' + webId)
|
package/newIssue.js
CHANGED
|
@@ -19,7 +19,6 @@ export function newIssueForm (dom, kb, tracker, superIssue, showNewIssue) {
|
|
|
19
19
|
titlefield.setAttribute('class', 'pendingedit')
|
|
20
20
|
titlefield.disabled = true
|
|
21
21
|
const sts = []
|
|
22
|
-
let issue
|
|
23
22
|
|
|
24
23
|
const expandTemplate = function (template) {
|
|
25
24
|
const now = new $rdf.Literal(new Date())
|
|
@@ -34,34 +33,30 @@ export function newIssueForm (dom, kb, tracker, superIssue, showNewIssue) {
|
|
|
34
33
|
.replace('{DD}', DD)
|
|
35
34
|
}
|
|
36
35
|
// Where to store the new issue?
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (template) {
|
|
36
|
+
const template = kb.anyValue(tracker, ns.wf('issueURITemplate'))
|
|
37
|
+
const issue = template
|
|
40
38
|
// Does each issue do in its own file?
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
// eslint-disable-next-line prefer-const
|
|
47
|
-
issueDoc = issue.doc()
|
|
39
|
+
? kb.sym(expandTemplate($rdf.uri.join(template, stateStore.uri)))
|
|
40
|
+
: kb.sym(stateStore.uri + '#' + 'Iss' + timestring())
|
|
41
|
+
|
|
42
|
+
const issueDoc = issue.doc()
|
|
48
43
|
|
|
49
44
|
// Basic 9 core predicates are stored in the main stateStore
|
|
50
45
|
|
|
51
46
|
const title = kb.literal(titlefield.value)
|
|
52
47
|
sts.push(new $rdf.Statement(issue, ns.wf('tracker'), tracker, stateStore))
|
|
53
48
|
sts.push(new $rdf.Statement(issue, ns.dc('title'), title, stateStore))
|
|
54
|
-
sts.push(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
for (
|
|
49
|
+
sts.push(new $rdf.Statement(issue, ns.dct('created'), new Date(), stateStore))
|
|
50
|
+
// Copy states from super issue as after all they are subtasks so initially same state same category
|
|
51
|
+
const initialStates = superIssue
|
|
52
|
+
? kb.each(superIssue, ns.rdf('type'), null, superIssue.doc())
|
|
53
|
+
: kb.each(tracker, ns.wf('initialState'))
|
|
54
|
+
for (const state of initialStates) {
|
|
60
55
|
sts.push(
|
|
61
56
|
new $rdf.Statement(
|
|
62
57
|
issue,
|
|
63
58
|
ns.rdf('type'),
|
|
64
|
-
|
|
59
|
+
state,
|
|
65
60
|
stateStore
|
|
66
61
|
)
|
|
67
62
|
)
|
|
@@ -100,7 +95,7 @@ export function newIssueForm (dom, kb, tracker, superIssue, showNewIssue) {
|
|
|
100
95
|
'</h2><p>Title of new ' +
|
|
101
96
|
classLabel +
|
|
102
97
|
':</p>'
|
|
103
|
-
|
|
98
|
+
const titlefield = dom.createElement('input')
|
|
104
99
|
titlefield.setAttribute('type', 'text')
|
|
105
100
|
titlefield.setAttribute(
|
|
106
101
|
'style',
|
|
@@ -119,5 +114,6 @@ export function newIssueForm (dom, kb, tracker, superIssue, showNewIssue) {
|
|
|
119
114
|
false
|
|
120
115
|
)
|
|
121
116
|
form.appendChild(titlefield)
|
|
117
|
+
titlefield.focus() // we want user cursor here
|
|
122
118
|
return form
|
|
123
119
|
}
|
package/newTracker.js
CHANGED
|
@@ -20,6 +20,19 @@ export function newTrackerButton (thisTracker, context) {
|
|
|
20
20
|
ws,
|
|
21
21
|
base
|
|
22
22
|
) {
|
|
23
|
+
function morph (x) {
|
|
24
|
+
// Move any URIs in this space into that space
|
|
25
|
+
if (x.elements !== undefined) return x.elements.map(morph) // Morph within lists
|
|
26
|
+
if (x.uri === undefined) return x
|
|
27
|
+
let u = x.uri
|
|
28
|
+
if (u === stateStore.uri) return newStore // special case
|
|
29
|
+
if (u.slice(0, oldBase.length) === oldBase) {
|
|
30
|
+
u = base + u.slice(oldBase.length)
|
|
31
|
+
$rdf.log.debug(' Map ' + x.uri + ' to ' + u)
|
|
32
|
+
}
|
|
33
|
+
return store.sym(u)
|
|
34
|
+
}
|
|
35
|
+
|
|
23
36
|
const appPathSegment = 'issuetracker.w3.org' // how to allocate this string and connect to
|
|
24
37
|
// console.log("Ready to make new instance at "+ws)
|
|
25
38
|
const sp = UI.ns.space
|
|
@@ -46,18 +59,6 @@ export function newTrackerButton (thisTracker, context) {
|
|
|
46
59
|
|
|
47
60
|
const oldBase = here.uri.slice(0, here.uri.lastIndexOf('/') + 1)
|
|
48
61
|
|
|
49
|
-
const morph = function (x) {
|
|
50
|
-
// Move any URIs in this space into that space
|
|
51
|
-
if (x.elements !== undefined) return x.elements.map(morph) // Morph within lists
|
|
52
|
-
if (x.uri === undefined) return x
|
|
53
|
-
let u = x.uri
|
|
54
|
-
if (u === stateStore.uri) return newStore // special case
|
|
55
|
-
if (u.slice(0, oldBase.length) === oldBase) {
|
|
56
|
-
u = base + u.slice(oldBase.length)
|
|
57
|
-
$rdf.log.debug(' Map ' + x.uri + ' to ' + u)
|
|
58
|
-
}
|
|
59
|
-
return store.sym(u)
|
|
60
|
-
}
|
|
61
62
|
const there = morph(here)
|
|
62
63
|
const newTracker = morph(thisTracker)
|
|
63
64
|
|
|
@@ -83,7 +84,7 @@ export function newTrackerButton (thisTracker, context) {
|
|
|
83
84
|
|
|
84
85
|
store.add(newTracker, UI.ns.space('inspiration'), thisTracker, there)
|
|
85
86
|
|
|
86
|
-
// $rdf.log.debug("\n Ready to put " +
|
|
87
|
+
// $rdf.log.debug("\n Ready to put " + store.statementsMatching(undefined, undefined, undefined, there)); //@@
|
|
87
88
|
|
|
88
89
|
updater.put(
|
|
89
90
|
there,
|