create-pmos 0.399.0 → 0.400.0
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/package.json +18 -13
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/briefing-premium-adddoc-test.js +2 -2
- package/workspace/briefing-premium-board-test.js +2 -2
- package/workspace/briefing-premium-doc-edit-test.js +2 -8
- package/workspace/briefing-premium-test.js +3 -2
- package/workspace/briefing-premium-work-test.js +9 -4
- package/workspace/c3-capture-test.js +0 -17
- package/workspace/changelog.json +17 -0
- package/workspace/guide/briefing-premium.md +2 -2
- package/workspace/guide/home.md +20 -2
- package/workspace/guide/layout.md +2 -2
- package/workspace/guide/notes.md +2 -2
- package/workspace/guide/phone-companion.md +1 -1
- package/workspace/lib/route-modules.js +1 -9
- package/workspace/lib/routes-phone-day.js +18 -9
- package/workspace/lib/routes-slash.js +95 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -2
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-term-test.js +0 -10
- package/workspace/premium-menu-rows-test.js +1 -1
- package/workspace/premium-phone-card-test.js +2 -2
- package/workspace/premium-vw-doc-test.js +1 -8
- package/workspace/premium-work-depth-test.js +2 -3
- package/workspace/public/capture.html +23 -0
- package/workspace/public/pm/c3-base.js +47 -0
- package/workspace/public/pm/c3-capture.js +1 -1
- package/workspace/public/pm/c3-ini-ui.js +1 -1
- package/workspace/public/pm/c3-sheet.js +1 -1
- package/workspace/public/pm/c3-toast.js +1 -1
- package/workspace/public/pm/console3.css +3 -0
- package/workspace/public/pm/cozy-home.css +20 -5
- package/workspace/public/pm/cozy-today.css +5 -2
- package/workspace/public/pm/cozy-viewer.js +4 -2
- package/workspace/public/pm/cozy.css +9 -0
- package/workspace/public/pm/goal-chat.js +5 -1
- package/workspace/public/pm/home-app.js +47 -26
- package/workspace/public/pm/home-chat.js +10 -4
- package/workspace/public/pm/home-data.js +3 -1
- package/workspace/public/pm/home-dictate.js +7 -4
- package/workspace/public/pm/home-ini.js +12 -2
- package/workspace/public/pm/home-list.js +20 -7
- package/workspace/public/pm/home-more.js +2 -2
- package/workspace/public/pm/home-phone-card.js +9 -4
- package/workspace/public/pm/home-review.js +2 -3
- package/workspace/public/pm/home-today.js +10 -6
- package/workspace/public/pm/home-work.js +15 -8
- package/workspace/public/pm/note-dock.js +1 -2
- package/workspace/public/pm/notes-links.js +1 -2
- package/workspace/public/pm/notes-task.js +3 -4
- package/workspace/public/pm/premium-board.js +1 -1
- package/workspace/public/pm/premium-initiative-head.js +3 -3
- package/workspace/public/pm/premium-vw-doc.css +20 -2
- package/workspace/public/pm/premium-vw-doc.js +22 -7
- package/workspace/public/pm/view-notes.js +2 -2
- package/workspace/replaced-tests.json +435 -0
- package/workspace/run-tests.js +323 -28
- package/workspace/server.js +15 -10
- package/workspace/test-files.json +3 -140
- package/workspace/test-lists/base.json +1 -2
- package/workspace/test-lists/c3-desktop-light-load.json +1 -2
- package/workspace/test-lists/c3-initiative-boards.json +1 -2
- package/workspace/test-lists/c3-meeting-focus.json +2 -12
- package/workspace/test-lists/c3-work-agent.json +1 -2
- package/workspace/test-lists/calendar-tidy-up.json +1 -2
- package/workspace/test-lists/console3-reports.json +1 -2
- package/workspace/test-lists/docs-three-way-sync.json +1 -2
- package/workspace/test-lists/extension-capture.json +5 -0
- package/workspace/test-lists/jira-wbs.json +1 -2
- package/workspace/test-lists/legacy-cleanup-a.json +9 -0
- package/workspace/test-lists/meeting-material.json +1 -2
- package/workspace/test-lists/meeting-notes.json +2 -36
- package/workspace/test-lists/meeting-replay.json +1 -2
- package/workspace/test-lists/mm-capture.json +2 -12
- package/workspace/test-lists/my-work.json +2 -10
- package/workspace/test-lists/onboarding-firstrun.json +2 -12
- package/workspace/test-lists/people-directory.json +1 -2
- package/workspace/test-lists/run2-a.json +1 -2
- package/workspace/test-lists/run2-d.json +2 -19
- package/workspace/test-lists/run3-b.json +1 -2
- package/workspace/test-lists/run3-c.json +2 -12
- package/workspace/test-lists/run4-b.json +1 -2
- package/workspace/test-lists/run4-d.json +1 -5
- package/workspace/test-lists/run5-c.json +1 -11
- package/workspace/test-lists/run6.json +1 -5
- package/workspace/test-lists/workspace-launch-flags.json +2 -12
- package/workspace/test-lists/workspace-profile-detection.json +2 -10
- package/workspace/test-timings.json +242 -123
- package/workspace/c3-briefing-test.js +0 -136
- package/workspace/c3-core-docs-test.js +0 -170
- package/workspace/c3-driver-fixture.js +0 -64
- package/workspace/c3-driver-test.js +0 -169
- package/workspace/c3-foundation-test.js +0 -163
- package/workspace/c3-ib-items-test.js +0 -114
- package/workspace/c3-ib-more-test.js +0 -146
- package/workspace/c3-ib-triage-backlog-test.js +0 -128
- package/workspace/c3-ini-harness.js +0 -66
- package/workspace/c3-ini-life-test.js +0 -167
- package/workspace/c3-initiatives-test.js +0 -186
- package/workspace/c3-light-load-test.js +0 -112
- package/workspace/c3-one-home-test.js +0 -149
- package/workspace/c3-phone-test.js +0 -289
- package/workspace/c3-quiet-test.js +0 -157
- package/workspace/c3-report-design-real-test.js +0 -264
- package/workspace/c3-report-design-test.js +0 -442
- package/workspace/c3-report-setup-test.js +0 -192
- package/workspace/c3-report-structure-real-test.js +0 -248
- package/workspace/c3-report-structure-test.js +0 -397
- package/workspace/c3-reports-test.js +0 -288
- package/workspace/c3-scan-test.js +0 -517
- package/workspace/c3-sessions-panel-test.js +0 -365
- package/workspace/c3-settings-test.js +0 -204
- package/workspace/c3-updates-test.js +0 -131
- package/workspace/c3-work-test.js +0 -260
- package/workspace/cut-stub.js +0 -40
- package/workspace/first-paint-audit.js +0 -160
- package/workspace/lib/c3-full-console.js +0 -15
- package/workspace/lib/engine/derived/trust.js +0 -3
- package/workspace/lib/engine/plan-forecast.js +0 -342
- package/workspace/lib/engine/report-families.js +0 -175
- package/workspace/lib/engine/truth-table.js +0 -57
- package/workspace/lib/routes-c3-init.js +0 -54
- package/workspace/lib/routes-c3-life.js +0 -120
- package/workspace/lib/routes-c3-timeline.js +0 -192
- package/workspace/lib/routes-forecast.js +0 -86
- package/workspace/lib/routes-releases.js +0 -130
- package/workspace/lib/routes-report-facts.js +0 -85
- package/workspace/lib/routes-report-families.js +0 -33
- package/workspace/lib/routes-signals.js +0 -51
- package/workspace/lib/routes-timeline.js +0 -197
- package/workspace/public/c3.html +0 -35
- package/workspace/public/index.html +0 -156
- package/workspace/public/pm/app.js +0 -831
- package/workspace/public/pm/bd-board.js +0 -159
- package/workspace/public/pm/bd-drag.js +0 -59
- package/workspace/public/pm/bd-model.js +0 -152
- package/workspace/public/pm/bd-timeline.js +0 -233
- package/workspace/public/pm/bd-tree.js +0 -244
- package/workspace/public/pm/board-copy.js +0 -59
- package/workspace/public/pm/board-read.js +0 -38
- package/workspace/public/pm/branches-sheet.js +0 -56
- package/workspace/public/pm/breakdown-api.js +0 -58
- package/workspace/public/pm/breakdown-copy.js +0 -138
- package/workspace/public/pm/briefing-deck.js +0 -441
- package/workspace/public/pm/briefing-model.js +0 -251
- package/workspace/public/pm/c3-ambient.js +0 -100
- package/workspace/public/pm/c3-audience-link.js +0 -21
- package/workspace/public/pm/c3-audience.js +0 -46
- package/workspace/public/pm/c3-boot.js +0 -13
- package/workspace/public/pm/c3-breakdown.js +0 -240
- package/workspace/public/pm/c3-brief-data.js +0 -11
- package/workspace/public/pm/c3-brief-mentions.js +0 -137
- package/workspace/public/pm/c3-brief-needs.js +0 -288
- package/workspace/public/pm/c3-brief-pulse.js +0 -112
- package/workspace/public/pm/c3-brief-summary.js +0 -139
- package/workspace/public/pm/c3-brief-today.js +0 -79
- package/workspace/public/pm/c3-brief.js +0 -279
- package/workspace/public/pm/c3-cal-strategy.js +0 -529
- package/workspace/public/pm/c3-calendar.js +0 -965
- package/workspace/public/pm/c3-calpop.js +0 -111
- package/workspace/public/pm/c3-case.js +0 -196
- package/workspace/public/pm/c3-core-docs.css +0 -18
- package/workspace/public/pm/c3-core-docs.js +0 -236
- package/workspace/public/pm/c3-daypart.js +0 -176
- package/workspace/public/pm/c3-demo-boards.js +0 -764
- package/workspace/public/pm/c3-demo-brief-ix.js +0 -350
- package/workspace/public/pm/c3-demo-brief-page.js +0 -70
- package/workspace/public/pm/c3-demo-cal-ix.js +0 -74
- package/workspace/public/pm/c3-demo-cal2.js +0 -66
- package/workspace/public/pm/c3-demo-cal3.js +0 -173
- package/workspace/public/pm/c3-demo-cal4.js +0 -169
- package/workspace/public/pm/c3-demo-cal5.js +0 -52
- package/workspace/public/pm/c3-demo-coredocs.js +0 -221
- package/workspace/public/pm/c3-demo-data.js +0 -552
- package/workspace/public/pm/c3-demo-focus.js +0 -181
- package/workspace/public/pm/c3-demo-init.js +0 -430
- package/workspace/public/pm/c3-demo-life.js +0 -77
- package/workspace/public/pm/c3-demo-material.js +0 -58
- package/workspace/public/pm/c3-demo-misc2.js +0 -34
- package/workspace/public/pm/c3-demo-phone.js +0 -48
- package/workspace/public/pm/c3-demo-plan2.js +0 -30
- package/workspace/public/pm/c3-demo-rd.js +0 -432
- package/workspace/public/pm/c3-demo-rep-ix.js +0 -126
- package/workspace/public/pm/c3-demo-rep2.js +0 -130
- package/workspace/public/pm/c3-demo-rep3.js +0 -138
- package/workspace/public/pm/c3-demo-rs.js +0 -287
- package/workspace/public/pm/c3-demo-term.js +0 -153
- package/workspace/public/pm/c3-demo-time.js +0 -49
- package/workspace/public/pm/c3-demo-work-ix.js +0 -32
- package/workspace/public/pm/c3-demo.js +0 -131
- package/workspace/public/pm/c3-design-studio.js +0 -369
- package/workspace/public/pm/c3-doc-formats.js +0 -153
- package/workspace/public/pm/c3-doc-sheet.js +0 -1230
- package/workspace/public/pm/c3-dock.js +0 -206
- package/workspace/public/pm/c3-docs.js +0 -291
- package/workspace/public/pm/c3-driver-work.js +0 -110
- package/workspace/public/pm/c3-driver.css +0 -18
- package/workspace/public/pm/c3-driver.js +0 -298
- package/workspace/public/pm/c3-focus.css +0 -304
- package/workspace/public/pm/c3-focus.js +0 -983
- package/workspace/public/pm/c3-ib-docs.js +0 -92
- package/workspace/public/pm/c3-ib-initiatives.js +0 -201
- package/workspace/public/pm/c3-ib-items.js +0 -210
- package/workspace/public/pm/c3-ib-releases.js +0 -48
- package/workspace/public/pm/c3-ib-sprints.js +0 -201
- package/workspace/public/pm/c3-ib-triage.js +0 -177
- package/workspace/public/pm/c3-ii-tabs.js +0 -252
- package/workspace/public/pm/c3-ini-life.css +0 -34
- package/workspace/public/pm/c3-ini-life.js +0 -379
- package/workspace/public/pm/c3-ini-records.js +0 -197
- package/workspace/public/pm/c3-ini-timeline.js +0 -278
- package/workspace/public/pm/c3-ini-work.js +0 -139
- package/workspace/public/pm/c3-init-extras.js +0 -170
- package/workspace/public/pm/c3-initiatives.js +0 -852
- package/workspace/public/pm/c3-lifecycle-panels.js +0 -479
- package/workspace/public/pm/c3-look.js +0 -27
- package/workspace/public/pm/c3-material.css +0 -22
- package/workspace/public/pm/c3-material.js +0 -321
- package/workspace/public/pm/c3-md.js +0 -3
- package/workspace/public/pm/c3-misc-panels.js +0 -89
- package/workspace/public/pm/c3-new-session.js +0 -110
- package/workspace/public/pm/c3-notes.js +0 -751
- package/workspace/public/pm/c3-phone-boot.js +0 -47
- package/workspace/public/pm/c3-phone-detail.js +0 -97
- package/workspace/public/pm/c3-phone-model.js +0 -3
- package/workspace/public/pm/c3-phone.css +0 -66
- package/workspace/public/pm/c3-phone.js +0 -444
- package/workspace/public/pm/c3-plan-panels.js +0 -163
- package/workspace/public/pm/c3-plan.js +0 -193
- package/workspace/public/pm/c3-quiet.css +0 -113
- package/workspace/public/pm/c3-quiet.js +0 -177
- package/workspace/public/pm/c3-replay.css +0 -133
- package/workspace/public/pm/c3-replay.js +0 -429
- package/workspace/public/pm/c3-report-deck.css +0 -163
- package/workspace/public/pm/c3-report-deck.js +0 -598
- package/workspace/public/pm/c3-report-frame.css +0 -20
- package/workspace/public/pm/c3-report-print.css +0 -20
- package/workspace/public/pm/c3-report-setup.css +0 -67
- package/workspace/public/pm/c3-report-setup.js +0 -298
- package/workspace/public/pm/c3-report-store.js +0 -244
- package/workspace/public/pm/c3-report-structure.css +0 -44
- package/workspace/public/pm/c3-report-structure.js +0 -473
- package/workspace/public/pm/c3-reports.css +0 -68
- package/workspace/public/pm/c3-reports.js +0 -377
- package/workspace/public/pm/c3-roadmap.js +0 -249
- package/workspace/public/pm/c3-scan-api.js +0 -167
- package/workspace/public/pm/c3-scan-next.js +0 -248
- package/workspace/public/pm/c3-scan-setup.js +0 -313
- package/workspace/public/pm/c3-scan-words.js +0 -41
- package/workspace/public/pm/c3-scan.css +0 -74
- package/workspace/public/pm/c3-scan.js +0 -93
- package/workspace/public/pm/c3-session-chat.js +0 -103
- package/workspace/public/pm/c3-session-conv.js +0 -165
- package/workspace/public/pm/c3-session-term.js +0 -216
- package/workspace/public/pm/c3-settings.css +0 -85
- package/workspace/public/pm/c3-settings.js +0 -1045
- package/workspace/public/pm/c3-shell.js +0 -628
- package/workspace/public/pm/c3-signals.js +0 -196
- package/workspace/public/pm/c3-strategy-panels.js +0 -45
- package/workspace/public/pm/c3-swipe.js +0 -230
- package/workspace/public/pm/c3-terminal-data.js +0 -48
- package/workspace/public/pm/c3-terminal-edge.js +0 -91
- package/workspace/public/pm/c3-terminal-icons.js +0 -40
- package/workspace/public/pm/c3-terminal-results.js +0 -141
- package/workspace/public/pm/c3-terminal.js +0 -52
- package/workspace/public/pm/c3-tickets.js +0 -163
- package/workspace/public/pm/c3-timeline.js +0 -201
- package/workspace/public/pm/calendar-views.js +0 -1049
- package/workspace/public/pm/console3-lift.md +0 -220
- package/workspace/public/pm/cozy-home.js +0 -172
- package/workspace/public/pm/cozy-initiative.css +0 -138
- package/workspace/public/pm/cycle-review.js +0 -125
- package/workspace/public/pm/data.js +0 -1577
- package/workspace/public/pm/dest-board.js +0 -444
- package/workspace/public/pm/dest-docs.js +0 -530
- package/workspace/public/pm/dest-initiatives.js +0 -162
- package/workspace/public/pm/dest-mywork.js +0 -307
- package/workspace/public/pm/dest-notes.js +0 -537
- package/workspace/public/pm/dest-people.js +0 -449
- package/workspace/public/pm/dest-reports.js +0 -383
- package/workspace/public/pm/dest-settings.js +0 -601
- package/workspace/public/pm/dest-today.js +0 -267
- package/workspace/public/pm/display-word.js +0 -56
- package/workspace/public/pm/doc-editor.js +0 -473
- package/workspace/public/pm/doc-graph.js +0 -272
- package/workspace/public/pm/doc-health-panel.js +0 -110
- package/workspace/public/pm/doc-rail.js +0 -167
- package/workspace/public/pm/doc-remote.js +0 -180
- package/workspace/public/pm/dock-sessions.js +0 -472
- package/workspace/public/pm/dock.js +0 -216
- package/workspace/public/pm/fixture.js +0 -821
- package/workspace/public/pm/flag-picker.js +0 -104
- package/workspace/public/pm/frame-copy.js +0 -278
- package/workspace/public/pm/freshness-line.js +0 -149
- package/workspace/public/pm/handoff-box.js +0 -82
- package/workspace/public/pm/initiative-list.js +0 -235
- package/workspace/public/pm/initiative-sheet.js +0 -331
- package/workspace/public/pm/initiatives-api.js +0 -95
- package/workspace/public/pm/initiatives-copy.js +0 -287
- package/workspace/public/pm/initiatives-timeline-copy.js +0 -59
- package/workspace/public/pm/initiatives-timeline.js +0 -410
- package/workspace/public/pm/initiatives-ui.js +0 -291
- package/workspace/public/pm/item-sheet.js +0 -268
- package/workspace/public/pm/keep-card.js +0 -204
- package/workspace/public/pm/lifecycle-lens-model.js +0 -246
- package/workspace/public/pm/lifecycle-lens.js +0 -276
- package/workspace/public/pm/lifecycle.js +0 -111
- package/workspace/public/pm/mobile.css +0 -366
- package/workspace/public/pm/mobile.js +0 -581
- package/workspace/public/pm/modes-live.js +0 -453
- package/workspace/public/pm/modes.js +0 -147
- package/workspace/public/pm/my-work-card.js +0 -51
- package/workspace/public/pm/my-work-data.js +0 -36
- package/workspace/public/pm/new-initiative-sheet.js +0 -169
- package/workspace/public/pm/next-step-ui.js +0 -190
- package/workspace/public/pm/outbox-panel.js +0 -125
- package/workspace/public/pm/palette-copy.js +0 -55
- package/workspace/public/pm/palette.js +0 -343
- package/workspace/public/pm/panel-breakdown.js +0 -702
- package/workspace/public/pm/panel-cockpit.js +0 -425
- package/workspace/public/pm/panel-detail.js +0 -1513
- package/workspace/public/pm/panel-initiatives.js +0 -929
- package/workspace/public/pm/panel-newsess.js +0 -709
- package/workspace/public/pm/panel-repos.js +0 -741
- package/workspace/public/pm/panel-tabs.js +0 -1506
- package/workspace/public/pm/panel-trees.js +0 -204
- package/workspace/public/pm/people-link.js +0 -106
- package/workspace/public/pm/phone-deck.js +0 -167
- package/workspace/public/pm/pm-work-view.js +0 -1533
- package/workspace/public/pm/portfolio-report.js +0 -61
- package/workspace/public/pm/premium-acts.js +0 -280
- package/workspace/public/pm/premium-brief.js +0 -111
- package/workspace/public/pm/premium-chat.js +0 -22
- package/workspace/public/pm/premium-doc-sheet.js +0 -312
- package/workspace/public/pm/premium-initiative.js +0 -324
- package/workspace/public/pm/premium-insights.css +0 -228
- package/workspace/public/pm/premium-metric-tiles.js +0 -68
- package/workspace/public/pm/premium-report-brief.js +0 -132
- package/workspace/public/pm/premium-vw-rec.js +0 -67
- package/workspace/public/pm/premium-wide.css +0 -30
- package/workspace/public/pm/print.css +0 -44
- package/workspace/public/pm/provider-cards.js +0 -136
- package/workspace/public/pm/registry.js +0 -203
- package/workspace/public/pm/release-card.js +0 -110
- package/workspace/public/pm/releases-view.js +0 -248
- package/workspace/public/pm/report-families-view.js +0 -505
- package/workspace/public/pm/report-slides.js +0 -438
- package/workspace/public/pm/report-tab.js +0 -33
- package/workspace/public/pm/report-view.js +0 -337
- package/workspace/public/pm/reports-copy.js +0 -134
- package/workspace/public/pm/roadmap.js +0 -294
- package/workspace/public/pm/run-card.js +0 -260
- package/workspace/public/pm/sessions-panel.js +0 -219
- package/workspace/public/pm/sheet-jira.js +0 -353
- package/workspace/public/pm/shell-bell.js +0 -163
- package/workspace/public/pm/shell-model.js +0 -83
- package/workspace/public/pm/shell-phone.js +0 -124
- package/workspace/public/pm/shell-readaloud.js +0 -53
- package/workspace/public/pm/shell-recording.js +0 -274
- package/workspace/public/pm/shell-ticker.js +0 -90
- package/workspace/public/pm/sig-watch.js +0 -41
- package/workspace/public/pm/slide-confirm.js +0 -163
- package/workspace/public/pm/slides-copy.js +0 -52
- package/workspace/public/pm/status-banner.js +0 -95
- package/workspace/public/pm/tab-doc.js +0 -859
- package/workspace/public/pm/tab-gone.js +0 -21
- package/workspace/public/pm/tab-term.js +0 -1210
- package/workspace/public/pm/tab-web.js +0 -90
- package/workspace/public/pm/timeline-copy.js +0 -48
- package/workspace/public/pm/timeline-forecast-view.js +0 -164
- package/workspace/public/pm/today-agenda.js +0 -331
- package/workspace/public/pm/today-cards.js +0 -244
- package/workspace/public/pm/today-copy.js +0 -506
- package/workspace/public/pm/today-day.js +0 -1371
- package/workspace/public/pm/today-goals.js +0 -297
- package/workspace/public/pm/today-jobs.js +0 -84
- package/workspace/public/pm/today-mentions.js +0 -50
- package/workspace/public/pm/topbar.js +0 -202
- package/workspace/public/pm/triage-card.js +0 -60
- package/workspace/public/pm/undo-hold.js +0 -103
- package/workspace/public/pm/view-addrepo.js +0 -208
- package/workspace/public/pm/view-files.js +0 -197
- package/workspace/public/pm/view-livenotes.js +0 -399
- package/workspace/public/pm/view-today.js +0 -13
- package/workspace/public/pm/view-validate.js +0 -171
- package/workspace/public/pm/welcome.js +0 -391
- package/workspace/public/pm/work-place.js +0 -68
- package/workspace/public/pm/xlsx-read.js +0 -117
- package/workspace/public/welcome.html +0 -22
- package/workspace/test-lists/browser-suites-green.json +0 -5
- package/workspace/test-lists/c3-core-docs.json +0 -9
- package/workspace/test-lists/c3-doc-sheet-rich.json +0 -6
- package/workspace/test-lists/c3-doc-sheet-size.json +0 -6
- package/workspace/test-lists/c3-doc-sheet-v2.json +0 -6
- package/workspace/test-lists/c3-ib-items.json +0 -9
- package/workspace/test-lists/c3-ib-more.json +0 -9
- package/workspace/test-lists/c3-ib-triage-backlog.json +0 -9
- package/workspace/test-lists/c3-ini-life.json +0 -9
- package/workspace/test-lists/c3-meeting-board.json +0 -5
- package/workspace/test-lists/c3-meeting-card.json +0 -5
- package/workspace/test-lists/c3-notes-place.json +0 -5
- package/workspace/test-lists/c3-notes-series.json +0 -5
- package/workspace/test-lists/calendar-time-page.json +0 -5
- package/workspace/test-lists/calpop.json +0 -4
- package/workspace/test-lists/console3-briefing.json +0 -9
- package/workspace/test-lists/console3-foundation.json +0 -9
- package/workspace/test-lists/console3-work-page.json +0 -9
- package/workspace/test-lists/premium-brief-parity.json +0 -9
- package/workspace/test-lists/report-design-studio-ui.json +0 -5
- package/workspace/test-lists/report-structure-ui.json +0 -11
- package/workspace/test-lists/report-workspace-ui.json +0 -5
- package/workspace/test-lists/run3-a.json +0 -5
- package/workspace/test-lists/run3-d.json +0 -6
- package/workspace/test-lists/run4-c.json +0 -13
- package/workspace/test-lists/today-goals-jobs-ui.json +0 -5
- package/workspace/test-lists/today-mentions-cards.json +0 -5
- package/workspace/test-lists/workspace-tabs-declutter.json +0 -13
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/* pm/c3-ib-docs.js — the Docs tab of a board (mockup v5, 34-initiatives.js tabDocs / docList / docRow), and the doc helpers the
|
|
2
|
-
* initiative's own Docs tab (c3-ii-tabs.js) shares.
|
|
3
|
-
* registerBoardTab('docs', (host, ctx) => ...)
|
|
4
|
-
* CORE First, the board's core documents (c3-core-docs.js, GET /api/core-docs level=board): the set, its state, Draft it, Review the draft.
|
|
5
|
-
* Then "Other documents", the list below.
|
|
6
|
-
* DOCS The documents of the board's initiatives from the Documents data: GET /api/docs/library (files { path, title, category, date,
|
|
7
|
-
* initiative }, categories). A file belongs to the board when its `initiative` is one of the board's initiatives (from
|
|
8
|
-
* loadItems, c3-ini-work.js). Graph nodes (files with `node`) are left out. A search box filters by title, path, type and
|
|
9
|
-
* initiative. A row opens in place (its path, type and date) and "Open the document" opens the document sheet (c3-doc-sheet.js);
|
|
10
|
-
* when the sheet cannot load, the toast names the path.
|
|
11
|
-
* SHARED loadDocs(ctx, idSet) · renderDocs(host, ctx, docs, order, titles, grouped)
|
|
12
|
-
* Nothing is invented: a board with no linked documents says so. */
|
|
13
|
-
import { el } from './dom.js';
|
|
14
|
-
import { registerBoardTab } from './c3-initiatives.js';
|
|
15
|
-
import { icon, pbtn, lk, chip, tag, st, note, sect, list, empty, nrow, plural, day, ago, parseDay, put, cols } from './c3-ini-ui.js';
|
|
16
|
-
import { loadItems } from './c3-ini-work.js';
|
|
17
|
-
import { coreDocs } from './c3-core-docs.js';
|
|
18
|
-
|
|
19
|
-
const STALE_DAYS = 30;
|
|
20
|
-
/** The documents of the library that belong to the ids: { ok, error, docs: [{ path, name, cat, ty, date, ini, st }] }. */
|
|
21
|
-
export async function loadDocs(ctx, idSet) {
|
|
22
|
-
const lib = await ctx.api.get('/api/docs/library', { board: ctx.board.id });
|
|
23
|
-
if (!lib || !lib.ok) return { ok: false, error: (lib && lib.error) || 'no answer', docs: [] };
|
|
24
|
-
const catName = Object.fromEntries((lib.categories || []).map((c) => [c.key, c.name]));
|
|
25
|
-
const docs = (lib.files || []).filter((f) => !f.node && f.initiative && idSet.has(f.initiative)).map((f) => {
|
|
26
|
-
const age = parseDay(f.date) ? -(Math.round((parseDay(f.date) - parseDay(ctx.today)) / 864e5)) : null;
|
|
27
|
-
return { path: f.path, name: f.title || f.path, cat: f.category || '', ty: catName[f.category] || f.category || 'Document', date: f.date || '', ini: f.initiative, st: age != null && age > STALE_DAYS ? 'stale' : 'current' };
|
|
28
|
-
});
|
|
29
|
-
docs.sort((a, b) => String(b.date).localeCompare(String(a.date)));
|
|
30
|
-
return { ok: true, error: '', docs };
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async function openDoc(ctx, d, titles) {
|
|
34
|
-
try {
|
|
35
|
-
const { openDocSheet } = await import('./c3-doc-sheet.js');
|
|
36
|
-
const ui = openDocSheet({ ws: ctx.ws, doc: { path: d.path, name: d.name, ty: d.ty, v: '', st: d.st, ini: d.ini, iniName: titles.get(d.ini) || d.ini },
|
|
37
|
-
library: () => ctx.api.get('/api/docs/library', { board: ctx.board.id }) });
|
|
38
|
-
ui.setOpener((o) => openDoc(ctx, { path: o.path, name: o.name, ty: o.ty, st: o.st, ini: o.ini }, titles));
|
|
39
|
-
} catch { ctx.toast('The document sheet could not open. The file is ' + d.path + '.'); }
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** The search box and the list of docs. `grouped` false draws one flat list (an initiative's own page). `title` names the list ("Other documents"
|
|
43
|
-
* beside the core documents; "Documents" by default). */
|
|
44
|
-
export function renderDocs(host, ctx, docs, order, titles, grouped, title) {
|
|
45
|
-
const results = el('div', { 'data-inb': 'docs-list' });
|
|
46
|
-
const input = el('input', { type: 'text', placeholder: 'Search documents', 'aria-label': 'Search documents', 'data-inb': 'docs-search', autocomplete: 'off' });
|
|
47
|
-
const count = el('span', { class: 'dim mono ini-meta', 'data-inb': 'docs-count', 'aria-live': 'polite' });
|
|
48
|
-
const row = (d) => nrow({ ic: 'doc', title: d.name, titleAttrs: { 'data-inb-doc': d.path },
|
|
49
|
-
chips: [/spec|prd/i.test(d.cat + ' ' + d.ty) ? tag(d.ty) : chip(d.ty), d.st === 'stale' ? st('warn', 'clock', 'Stale') : null, d.date ? chip(icon('clock', 'sm'), 'updated ' + ago(d.date, ctx.today)) : null,
|
|
50
|
-
grouped && d.ini ? lk({ onclick: () => ctx.openInitiative(d.ini), 'data-inb-docini': d.ini }, d.ini) : null],
|
|
51
|
-
xp: [note(d.path + (d.date ? ' · ' + day(d.date) : '')), el('div', { class: 'chips2' }, pbtn('outline', 'Open the document', 'next', { 'data-inb-docopen': d.path, onclick: () => openDoc(ctx, d, titles) }))],
|
|
52
|
-
attrs: { 'data-inb-docrow': d.path } });
|
|
53
|
-
const draw = () => {
|
|
54
|
-
const q = input.value.trim().toLowerCase();
|
|
55
|
-
const shown = docs.filter((d) => !q || (d.name + ' ' + d.path + ' ' + d.ty + ' ' + d.ini + ' ' + (titles.get(d.ini) || '')).toLowerCase().includes(q));
|
|
56
|
-
count.textContent = q ? plural(shown.length, 'document') + ' match' + (shown.length === 1 ? 'es' : '') : plural(docs.length, 'document');
|
|
57
|
-
if (!shown.length) { put(results, empty(q ? 'No document matches "' + input.value.trim() + '".' : 'No documents.', { 'data-inb': 'docs-none' })); return; }
|
|
58
|
-
if (!grouped) { put(results, sect({ ic: 'doc', title: title || 'Documents', count: shown.length }, list(shown.map(row)))); return; }
|
|
59
|
-
put(results, ...order.filter((id) => shown.some((d) => d.ini === id)).map((id) => {
|
|
60
|
-
const g = shown.filter((d) => d.ini === id);
|
|
61
|
-
return sect({ ic: 'init', title: id + ' ' + (titles.get(id) || ''), count: g.length, attrs: { 'data-inb-docgrp': id }, right: lk({ onclick: () => ctx.openInitiative(id, 'docs'), 'aria-label': 'Open ' + id }, 'Open initiative') }, list(g.map(row)));
|
|
62
|
-
}));
|
|
63
|
-
};
|
|
64
|
-
input.addEventListener('input', draw);
|
|
65
|
-
put(host, grouped && title ? el('div', { class: 'sh2 cd-oh', 'data-inb': 'docs-title' }, el('h2', null, icon('doc', 'sm'), title, ' ', el('span', { class: 'bdg g' }, String(docs.length)))) : null,
|
|
66
|
-
el('div', { class: 'calbar' }, el('div', { class: 'form ini-grow' }, input), count), results);
|
|
67
|
-
draw();
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
registerBoardTab('docs', async (host, ctx) => {
|
|
71
|
-
let dead = false;
|
|
72
|
-
const other = el('div', { class: 'cd-host', 'data-cd': 'other' }, note('Reading the documents'));
|
|
73
|
-
const cd = coreDocs({ api: ctx.api, level: 'board', board: ctx.board.id, ws: ctx.ws, today: ctx.today, toast: ctx.toast, scopeLabel: ctx.board.name, boardRow: ctx.board,
|
|
74
|
-
nav: { tab: (t) => ctx.openBoard(ctx.board.id, t), tool: () => {}, reports: () => ctx.showTab('rep') } });
|
|
75
|
-
put(host, cols([cd.left, other], cd.right));
|
|
76
|
-
const stop = () => { dead = true; cd.dispose(); };
|
|
77
|
-
const items = await loadItems(ctx);
|
|
78
|
-
if (dead) return stop;
|
|
79
|
-
if (!items.ok) { put(other, el('div', { class: 'fold w', role: 'alert' }, icon('alert', 'sm'), 'The initiatives of this board could not be read: ' + items.error + '.')); return stop; }
|
|
80
|
-
const titles = new Map(items.initiatives.map((r) => [r.id, r.title]));
|
|
81
|
-
const lib = await loadDocs(ctx, new Set(titles.keys()));
|
|
82
|
-
if (dead) return stop;
|
|
83
|
-
if (!lib.ok) { put(other, el('div', { class: 'fold w', role: 'alert' }, icon('alert', 'sm'), 'The documents could not be read: ' + lib.error + '.')); return stop; }
|
|
84
|
-
cd.setIniDocs({ docs: lib.docs.length, initiatives: new Set(lib.docs.map((d) => d.ini)).size });
|
|
85
|
-
if (!lib.docs.length) {
|
|
86
|
-
put(other, empty(items.initiatives.length ? 'No other documents are linked to the initiatives of ' + ctx.board.name + ' yet.' : ctx.board.name + ' has no initiatives, so there are no other documents.', { 'data-inb': 'docs-empty' }));
|
|
87
|
-
return stop;
|
|
88
|
-
}
|
|
89
|
-
const order = [...new Set(lib.docs.map((d) => d.ini))];
|
|
90
|
-
renderDocs(other, ctx, lib.docs, order, titles, true, 'Other documents');
|
|
91
|
-
return stop;
|
|
92
|
-
});
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
/* pm/c3-ib-initiatives.js — the Initiatives tab of a board (mockup v5, 34-initiatives.js tabInitiatives / iniToolbar / iniRow; its header and
|
|
2
|
-
* lifecycle from mockup v2 of c3-initiative-lifecycle, approved 2026-10-13).
|
|
3
|
-
* registerBoardTab('initiatives', (host, ctx) => ...) ctx is documented in the header of c3-initiatives.js.
|
|
4
|
-
* What it draws, all of it paged on the server (GET /api/boards/backlog; q, view, cat, stage, status, owner, horizon, sort, offset, limit, archived):
|
|
5
|
-
* - one row of controls: a search box with an icon (debounced), the view menu (Now and next, Mine, At risk, No owner, All), a filter
|
|
6
|
-
* icon whose menu holds Status (grouped Active, Paused, Closed), Stage, Category, Owner and Horizon and whose badge counts the
|
|
7
|
-
* filters on, a sort icon whose menu holds the sort keys and the direction, and New initiative. "All active" and "At risk or late"
|
|
8
|
-
* are comma lists (status=on track,at risk,late), which the server reads as any of;
|
|
9
|
-
* - the filters on, as removable chips in the list header, and Clear;
|
|
10
|
-
* - one console3 row per initiative: id, its workflow template, the stage dots of its own workflow, status, then owner, progress,
|
|
11
|
-
* dates and warnings (or, when it is on hold or cancelled, since when, the check-back day and the reason), "Merged from", the
|
|
12
|
-
* duplicate hint; a "…" menu (Move to a stage, Status, Tidy up: c3-ini-life.js rowMenu) and Open;
|
|
13
|
-
* - a footer: the numbered pager of 25, "N cancelled hidden" (opens All with Status: Cancelled) and "N archived" (opens the archive);
|
|
14
|
-
* - the archive: a search box and Back to initiatives, each archived initiative with its reason or "Merged into <id>", Restore or
|
|
15
|
-
* Undo merge.
|
|
16
|
-
* ctx.filter (from the URL or a Summary tile) opens the tab on that view and those filters. One request is in flight at a time; a change
|
|
17
|
-
* made meanwhile is sent when it returns and the older answer is dropped. After a hold, cancel or resume the list reads again until the
|
|
18
|
-
* row shows it (the engine derives a lifecycle change in a child process). host.dataset.ibbState is loading | ready | error and
|
|
19
|
-
* host.dataset.ibbSeq counts the answers drawn (the browser suites poll both). */
|
|
20
|
-
import { el } from './dom.js';
|
|
21
|
-
import { registerBoardTab } from './c3-initiatives.js';
|
|
22
|
-
import { icon, lk, ib, pbtn, pill, chip, st, note, list, empty, nrow, sect, statusChip, ownerChip, stepsMini, progChip, dateChip, daysBetween, plural, openMenu, CATS, put } from './c3-ini-ui.js';
|
|
23
|
-
import { wfOf, catOf, tplName } from './c3-ini-work.js';
|
|
24
|
-
import { rowMenu, lifeChips, archivedChips, dupChip, mergedFromChip, restoreBtn, rowIcon, ensureLifeCss } from './c3-ini-life.js';
|
|
25
|
-
|
|
26
|
-
const PAGE = 25;
|
|
27
|
-
const VIEWS = [['now', 'Now and next'], ['mine', 'Mine'], ['risk', 'At risk'], ['noowner', 'No owner'], ['all', 'All']];
|
|
28
|
-
const STATUS_GROUPS = [['', [['', 'Any']]],
|
|
29
|
-
['Active', [['on track,at risk,late', 'All active'], ['on track', 'On track'], ['at risk,late', 'At risk or late'], ['at risk', 'At risk'], ['late', 'Late']]],
|
|
30
|
-
['Paused', [['on hold', 'On hold']]],
|
|
31
|
-
['Closed', [['done,cancelled', 'Done or cancelled'], ['done', 'Done'], ['cancelled', 'Cancelled']]]];
|
|
32
|
-
const STATUS = STATUS_GROUPS.flatMap((g) => g[1]);
|
|
33
|
-
const HORIZON = [['', 'Any'], ['now,next', 'Now and next'], ['now', 'Now'], ['next', 'Next'], ['later', 'Later']];
|
|
34
|
-
const SORTS = [['horizon', 'Horizon'], ['end', 'Ends'], ['title', 'Title'], ['stage', 'Stage'], ['progress', 'Progress'], ['status', 'Status'], ['owner', 'Owner'], ['id', 'Key']];
|
|
35
|
-
const FKEYS = ['status', 'stage', 'cat', 'owner', 'horizon'];
|
|
36
|
-
const FNAME = { status: 'Status', stage: 'Stage', cat: 'Category', owner: 'Owner', horizon: 'Horizon' };
|
|
37
|
-
const toneOf = (s) => (s === 'late' ? 'bad' : s === 'at risk' ? 'warn' : 'ok');
|
|
38
|
-
const warnChip = (w) => st('warn', 'alert', w, { title: 'An order rule, shown as a warning. It never blocks.', 'data-ini-warning': w });
|
|
39
|
-
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
40
|
-
|
|
41
|
-
registerBoardTab('initiatives', (host, ctx) => {
|
|
42
|
-
ensureLifeCss();
|
|
43
|
-
const b = ctx.board;
|
|
44
|
-
const f0 = ctx.filter || {};
|
|
45
|
-
const sort0 = String(f0.sort || 'horizon');
|
|
46
|
-
const Q = { q: String(f0.q || ''), view: VIEWS.some((v) => v[0] === f0.view) ? f0.view : 'now', cat: CATS.includes(f0.cat) ? f0.cat : '', stage: f0.stage || '', status: f0.status || '', owner: f0.owner || '', horizon: f0.horizon || '',
|
|
47
|
-
sort: SORTS.some((s) => s[0] === sort0.replace(/^-/, '')) ? sort0.replace(/^-/, '') : 'horizon', dir: sort0.startsWith('-') ? -1 : 1, offset: Math.max(0, Number(f0.offset) || 0), archived: f0.archived === '1' };
|
|
48
|
-
const S = { data: null, flying: false, again: false, dead: false, seq: 0, err: '' };
|
|
49
|
-
|
|
50
|
-
const search = el('input', { type: 'text', 'data-ibb': 'q', 'aria-label': 'Search initiatives', value: Q.q, autocomplete: 'off' });
|
|
51
|
-
let deb = null;
|
|
52
|
-
search.addEventListener('input', () => { clearTimeout(deb); deb = setTimeout(() => { Q.q = search.value.trim(); Q.offset = 0; request(); }, 250); });
|
|
53
|
-
search.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); clearTimeout(deb); Q.q = search.value.trim(); Q.offset = 0; request(); } });
|
|
54
|
-
const top = el('div', { class: 'calbar il-bar', 'data-ibb': 'toolbar' });
|
|
55
|
-
const err = el('div', { class: 'fold w', role: 'alert', 'data-ibb': 'error', hidden: '' });
|
|
56
|
-
const body = el('div', { 'data-ibb': 'body' });
|
|
57
|
-
const foot = el('div', { class: 'il-listfoot', 'data-ibb': 'foot' });
|
|
58
|
-
put(host, el('div', { class: 'calbody', 'data-ibb': 'initiatives' }, top, err, body, foot));
|
|
59
|
-
host.dataset.ibbState = 'loading'; host.dataset.ibbSeq = '0';
|
|
60
|
-
|
|
61
|
-
const on = () => FKEYS.filter((k) => Q[k]);
|
|
62
|
-
const labelOf = (k, v) => (k === 'status' ? (STATUS.find((x) => x[0] === v) || [null, v])[1] : k === 'horizon' ? (HORIZON.find((x) => x[0] === v) || [null, v])[1] : k === 'owner' && v === 'none' ? 'No owner' : v);
|
|
63
|
-
const set = (patch) => { Object.assign(Q, patch, { offset: 0 }); request(); };
|
|
64
|
-
function clearFilters() { for (const k of FKEYS) Q[k] = ''; Q.q = ''; search.value = ''; Q.offset = 0; request(); }
|
|
65
|
-
|
|
66
|
-
function drawControls() {
|
|
67
|
-
search.placeholder = Q.archived ? 'Search the ' + b.name + ' archive' : 'Search ' + b.name + ' initiatives';
|
|
68
|
-
search.setAttribute('aria-label', Q.archived ? 'Search the archive' : 'Search initiatives');
|
|
69
|
-
const box = el('div', { class: 'form il-search' }, icon('search', 'sm'), search);
|
|
70
|
-
if (Q.archived) {
|
|
71
|
-
put(top, box, pbtn('outline', [el('span', { class: 'il-back' }, icon('next', 'sm')), 'Back to initiatives'], null, { 'data-ibb': 'back', onclick: () => set({ archived: false }) }));
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
const n = on().length;
|
|
75
|
-
const view = (VIEWS.find((v) => v[0] === Q.view) || VIEWS[0])[1];
|
|
76
|
-
const sl = (SORTS.find((s) => s[0] === Q.sort) || SORTS[0])[1];
|
|
77
|
-
put(top, box,
|
|
78
|
-
pbtn('ghost', [view, el('span', { class: 'il-chev' }, icon('next', 'sm'))], null, { 'data-ibb': 'views', 'aria-haspopup': 'menu', 'aria-expanded': 'false', title: 'Saved views', onclick: (e) => viewsMenu(e.currentTarget) }),
|
|
79
|
-
ib(n ? 'Filters, ' + n + ' on' : 'Filters', [icon('filter', 'sm'), n ? el('span', { class: 'bdg' }, String(n)) : null], { class: 'il-ib', 'data-ibb': 'filters', 'aria-haspopup': 'dialog', 'aria-expanded': 'false', title: 'Filters', onclick: (e) => filterMenu(e.currentTarget) }),
|
|
80
|
-
ib('Sort: ' + sl + ', ' + (Q.dir > 0 ? 'ascending' : 'descending'), el('span', { class: Q.dir > 0 ? 'il-up' : 'il-down' }, icon('next', 'sm')), { 'data-ibb': 'sort', 'aria-haspopup': 'menu', 'aria-expanded': 'false', onclick: (e) => sortMenu(e.currentTarget) }),
|
|
81
|
-
pbtn('primary', 'New initiative', 'plus', { 'data-ini': 'new-initiative', 'aria-haspopup': 'dialog', onclick: () => ctx.newInitiative() }));
|
|
82
|
-
}
|
|
83
|
-
const tick = () => el('span', { class: 'il-tick' }, icon('check', 'sm'));
|
|
84
|
-
function viewsMenu(anchor) {
|
|
85
|
-
openMenu(anchor, { label: 'Saved views', items: [{ group: 'Views' }, ...VIEWS.map(([k, l]) => ({ kids: [tick(), l], checked: Q.view === k, attrs: { 'data-ibb-view': k }, onPick: () => set({ view: k }) }))] });
|
|
86
|
-
}
|
|
87
|
-
function sortMenu(anchor) {
|
|
88
|
-
openMenu(anchor, { label: 'Sort', items: [{ group: 'Sort by' }, ...SORTS.map(([k, l]) => ({ kids: [tick(), l], checked: Q.sort === k, attrs: { 'data-ibb-sort': k }, onPick: () => set({ sort: k }) })),
|
|
89
|
-
{ group: 'Order' }, { kids: [el('span', { class: Q.dir > 0 ? 'il-up' : 'il-down' }, icon('next', 'sm')), Q.dir > 0 ? 'Ascending, press to flip' : 'Descending, press to flip'], attrs: { 'data-ibb': 'dir' }, onPick: () => set({ dir: -Q.dir }) }] });
|
|
90
|
-
}
|
|
91
|
-
function filterMenu(anchor) {
|
|
92
|
-
const fa = (S.data && S.data.facets) || {};
|
|
93
|
-
const keep = (k, keys) => (Q[k] && !keys.includes(Q[k]) ? [Q[k], ...keys] : keys);
|
|
94
|
-
const order = (b.workflow || []).map((s) => s.name);
|
|
95
|
-
const stages = keep('stage', Object.keys(fa.stage || {}).sort((x, y) => ((order.indexOf(x) + 1 || 99) - (order.indexOf(y) + 1 || 99)) || x.localeCompare(y)));
|
|
96
|
-
const owners = keep('owner', Object.keys(fa.owner || {}).filter((o) => o !== 'none').sort((x, y) => (x === 'You' ? -1 : y === 'You' ? 1 : x.localeCompare(y))));
|
|
97
|
-
const n = (k, v) => (fa[k] && fa[k][v] != null ? ' (' + fa[k][v] + ')' : '');
|
|
98
|
-
const opt = (k, [v, l]) => el('option', { value: v, selected: v === Q[k] }, l);
|
|
99
|
-
const sel = (k, label, kids) => el('label', { class: 'il-f' }, el('span', null, label), el('select', { 'data-ibb-filter': k, 'aria-label': label, onchange: (e) => { Q[k] = e.target.value; Q.offset = 0; request(); } }, ...kids));
|
|
100
|
-
const panel = el('div', { 'data-ibb': 'filter-panel' }, el('div', { class: 'ini-mlbl' }, 'Filter initiatives'),
|
|
101
|
-
sel('status', 'Status', STATUS_GROUPS.map(([g, opts]) => (g ? el('optgroup', { label: g }, ...opts.map((o) => opt('status', o))) : opts.map((o) => opt('status', o))))),
|
|
102
|
-
sel('stage', 'Stage', [['', 'Any'], ...stages.map((s) => [s, s + n('stage', s)])].map((o) => opt('stage', o))),
|
|
103
|
-
sel('cat', 'Category', [['', 'Any'], ...CATS.map((c) => [c, c + n('cat', c)])].map((o) => opt('cat', o))),
|
|
104
|
-
sel('owner', 'Owner', [['', 'Anyone'], ['none', 'No owner' + n('owner', 'none')], ...owners.map((o) => [o, o + n('owner', o)])].map((o) => opt('owner', o))),
|
|
105
|
-
sel('horizon', 'Horizon', HORIZON.map((o) => opt('horizon', o))),
|
|
106
|
-
el('div', { class: 'chips2 il-fend' }, lk({ 'data-ibb': 'clear-in-menu', onclick: () => { clearFilters(); anchor.focus(); } }, 'Clear filters')));
|
|
107
|
-
openMenu(anchor, { label: 'Filters', body: panel });
|
|
108
|
-
}
|
|
109
|
-
function chipsOf() {
|
|
110
|
-
const ks = on();
|
|
111
|
-
if (!ks.length) return null;
|
|
112
|
-
return el('div', { class: 'chips2 il-chips', 'data-ibb': 'chips' },
|
|
113
|
-
...ks.map((k) => lk({ 'data-ibb-unset': k, title: 'Remove this filter', onclick: () => set({ [k]: '' }) }, FNAME[k] + ': ' + labelOf(k, Q[k]) + ' ', icon('x', 'sm'))),
|
|
114
|
-
lk({ 'data-ibb': 'clear', onclick: clearFilters }, 'Clear'));
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const L = { ctx, done: (change) => settle(change) };
|
|
118
|
-
function rowOf(r) {
|
|
119
|
-
if (r.archived) {
|
|
120
|
-
return nrow({ ic: rowIcon(r), title: r.title || r.id, onOpen: () => ctx.openInitiative(r.id), openLabel: 'Open ' + r.id + ' ' + (r.title || ''), titleAttrs: { 'data-ibb-open': r.id },
|
|
121
|
-
chips: archivedChips(r).flat(), right: [restoreBtn(L, r)], attrs: { 'data-ibb-row': r.id, 'data-il-archived': r.archived.into ? 'merged' : 'archived' } });
|
|
122
|
-
}
|
|
123
|
-
const wf = wfOf(r, b);
|
|
124
|
-
const stopped = r.status === 'on hold' || r.status === 'cancelled';
|
|
125
|
-
const late = !stopped && r.status !== 'done' && r.end && daysBetween(ctx.today, r.end) < 0;
|
|
126
|
-
return nrow({ ic: rowIcon(r), hot: r.status === 'late' || r.status === 'at risk', title: r.title || r.id,
|
|
127
|
-
onOpen: () => ctx.openInitiative(r.id), openLabel: 'Open ' + r.id + ' ' + (r.title || ''), titleAttrs: { 'data-ibb-open': r.id },
|
|
128
|
-
chips: [el('span', { class: 'chip2 mono' }, r.id), el('span', { class: 'tag', title: 'Workflow' }, tplName(r, b)), stepsMini(wf, r.stage, tplName(r, b)), statusChip(r.status),
|
|
129
|
-
...(stopped ? lifeChips(r) : [ownerChip(r.owner), progChip(r.progress || 0, toneOf(r.status)), dateChip(r.start, r.end, late), b.build ? chip(icon('bolt', 'sm'), plural((r.epics || []).length, 'epic')) : null, r.anchor ? null : st('warn', 'alert', 'No anchor'), ...(r.warnings || []).map(warnChip)]),
|
|
130
|
-
mergedFromChip(r), dupChip(L, r)],
|
|
131
|
-
right: [ib('Actions for ' + r.id, 'more', { 'data-ibb-move': r.id, 'data-ibb-menu': r.id, 'aria-haspopup': 'menu', 'aria-expanded': 'false', title: 'Move, pause, merge or archive',
|
|
132
|
-
onclick: (e) => rowMenu(e.currentTarget, L, r, b.self ? null : async (stage) => { const m = await ctx.moveTo(r.id, stage); if (m && m.ok) request(); }) }),
|
|
133
|
-
ib('Open ' + r.id, 'next', { 'data-ini-open': r.id, onclick: () => ctx.openInitiative(r.id) })],
|
|
134
|
-
attrs: { 'data-ibb-row': r.id, 'data-cat': r.cat || catOf(wf, r.stage), 'data-status': r.status } });
|
|
135
|
-
}
|
|
136
|
-
function pagerOf(d) {
|
|
137
|
-
const pages = Math.max(1, Math.ceil(d.total / PAGE)); const cur = Math.floor(d.offset / PAGE);
|
|
138
|
-
if (pages < 2) return null;
|
|
139
|
-
const nums = []; for (let p = 0; p < pages; p++) if (p < 2 || p >= pages - 1 || Math.abs(p - cur) <= 1) nums.push(p); else if (nums[nums.length - 1] !== '…') nums.push('…');
|
|
140
|
-
const to = (p) => { Q.offset = p * PAGE; request(true); };
|
|
141
|
-
return el('div', { class: 'chips2 ini-pager', 'data-ibb': 'pager' }, el('span', { class: 'dim mono ini-meta' }, (d.offset + 1) + '–' + Math.min(d.total, d.offset + d.rows.length) + ' of ' + d.total),
|
|
142
|
-
pill({ 'data-ibb': 'prev', disabled: cur === 0, onclick: () => to(cur - 1) }, 'Previous'),
|
|
143
|
-
...nums.map((p) => (p === '…' ? el('span', { class: 'dim' }, '…') : pill({ 'data-ibb-page': String(p + 1), 'aria-pressed': String(p === cur), 'aria-label': 'Page ' + (p + 1), onclick: () => to(p) }, String(p + 1)))),
|
|
144
|
-
pill({ 'data-ibb': 'next', disabled: cur >= pages - 1, onclick: () => to(cur + 1) }, 'Next'));
|
|
145
|
-
}
|
|
146
|
-
function draw() {
|
|
147
|
-
err.textContent = S.err; err.hidden = !S.err;
|
|
148
|
-
drawControls();
|
|
149
|
-
const d = S.data;
|
|
150
|
-
if (!d) return;
|
|
151
|
-
if (Q.archived) {
|
|
152
|
-
put(body, sect({ ic: 'clip', title: 'Archive', count: d.total, right: el('span', { class: 'dim il-hint' }, 'Kept whole. Restore puts it back as it was.'), attrs: { 'data-ibb': 'archive' } },
|
|
153
|
-
d.rows.length ? list(d.rows.map(rowOf), { 'data-ibb': 'rows' }) : empty(Q.q ? 'Nothing in the archive matches.' : 'Nothing archived on this board.', { 'data-ibb': 'empty' })));
|
|
154
|
-
put(foot, pagerOf(d));
|
|
155
|
-
} else {
|
|
156
|
-
const filtered = on().length || Q.q;
|
|
157
|
-
put(body, sect({ ic: 'init', title: 'Initiatives', count: d.total, right: chipsOf() },
|
|
158
|
-
d.rows.length ? list(d.rows.map(rowOf), { 'data-ibb': 'rows' }) : empty(filtered || Q.view !== 'all' ? 'No initiatives match. Clear the filters or pick All.' : b.name + ' has no initiatives yet. Press New initiative, or accept an ask in Triage.', { 'data-ibb': 'empty' })));
|
|
159
|
-
put(foot, pagerOf(d), d.cancelledHidden || d.archived ? el('span', { class: 'chips2' },
|
|
160
|
-
d.cancelledHidden ? lk({ 'data-ibb': 'show-cancelled', title: 'Cancelled initiatives are hidden from every view', onclick: () => set({ view: 'all', status: 'cancelled' }) }, icon('x', 'sm'), d.cancelledHidden + ' cancelled hidden') : null,
|
|
161
|
-
d.archived ? lk({ 'data-ibb': 'show-archive', onclick: () => set({ archived: true }) }, icon('clip', 'sm'), d.archived + ' archived') : null) : null);
|
|
162
|
-
}
|
|
163
|
-
host.dataset.ibbSeq = String(++S.seq);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
async function request(keepFocus) {
|
|
167
|
-
if (S.dead) return;
|
|
168
|
-
if (S.flying) { S.again = true; return; }
|
|
169
|
-
S.flying = true; host.dataset.ibbState = 'loading'; host.setAttribute('aria-busy', 'true');
|
|
170
|
-
let r;
|
|
171
|
-
for (;;) {
|
|
172
|
-
S.again = false;
|
|
173
|
-
const q = { ...Q };
|
|
174
|
-
r = await ctx.api.get('/api/boards/backlog', { board: b.id, q: q.q, view: q.view, cat: q.cat, stage: q.stage, status: q.status, owner: q.owner, horizon: q.horizon, sort: (q.dir < 0 ? '-' : '') + q.sort, offset: q.offset, limit: PAGE, archived: q.archived ? '1' : '' });
|
|
175
|
-
if (S.dead) return null;
|
|
176
|
-
if (!S.again) break;
|
|
177
|
-
}
|
|
178
|
-
S.flying = false; host.removeAttribute('aria-busy');
|
|
179
|
-
if (!r || !r.ok || r.pending) { S.err = r && r.pending ? 'The repository is still being read. Try again in a moment.' : 'The initiatives could not be read: ' + ((r && r.error) || 'no answer') + '.'; host.dataset.ibbState = 'error'; draw(); return null; }
|
|
180
|
-
S.err = ''; S.data = { total: r.total || 0, offset: r.offset || 0, limit: r.limit || PAGE, rows: r.rows || [], facets: r.facets || {}, cancelledHidden: r.cancelledHidden || 0, archived: r.archived || 0 };
|
|
181
|
-
Q.offset = S.data.offset;
|
|
182
|
-
draw(); host.dataset.ibbState = 'ready';
|
|
183
|
-
if (keepFocus) { const f = foot.querySelector('[aria-pressed="true"]'); if (f) f.focus(); }
|
|
184
|
-
return S.data;
|
|
185
|
-
}
|
|
186
|
-
/* After a write: read again. A lifecycle line is derived in a child process, so the list may show the old status for a moment;
|
|
187
|
-
* read again until the row shows the new one, or it left the list (a paused initiative leaves Now and next), up to ten times. */
|
|
188
|
-
async function settle(change) {
|
|
189
|
-
for (let k = 0; k < 10 && !S.dead; k++) {
|
|
190
|
-
const d = await request();
|
|
191
|
-
if (!d || !change || change.kind !== 'status') return;
|
|
192
|
-
const row = d.rows.find((x) => x.id === change.id);
|
|
193
|
-
if (change.status ? (!row || row.status === change.status) : (!row || (row.status !== 'on hold' && row.status !== 'cancelled'))) return;
|
|
194
|
-
await sleep(800);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
drawControls();
|
|
199
|
-
request();
|
|
200
|
-
return () => { S.dead = true; clearTimeout(deb); };
|
|
201
|
-
});
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
/* pm/c3-ib-items.js — the Backlog, Board and Timeline tabs of a board (mockup v5, 34-initiatives.js tabItems / backlogBody / kanbanBody /
|
|
2
|
-
* timelineBody). The three show the same work items, Jira items and PMOS tasks mixed (GET /api/boards/items through loadItems), under ONE
|
|
3
|
-
* filter set per board that the three tabs share, on one row (c3-board-declutter): search, an initiative picker, and a Filters panel
|
|
4
|
-
* with Type, Source and Done; a filter that is on shows as a chip with an x. ctx.filter.ini (a link "this initiative
|
|
5
|
-
* only" from an initiative page) sets the Initiative filter on mount. Source shows only when the board has Build and deliver on: with it
|
|
6
|
-
* off there is no Jira, and every item is a PMOS task.
|
|
7
|
-
* registerBoardTab('backlog' | 'board' | 'timeline', (host, ctx) => ...)
|
|
8
|
-
* Backlog an "Add a PMOS task" form (POST /api/boards/tasks/add: title, initiative), then a section per initiative: its epics, each
|
|
9
|
-
* followed by its items, then the items with no epic. A row opens the item sheet (c3-ini-work.js openWorkSheet).
|
|
10
|
-
* Board four columns, one per item status (To do, In progress, In review, Done), 8 cards each with "Show more". A PMOS task is
|
|
11
|
-
* dragged to another column (HTML drag and drop) or moved with its Move menu: POST /api/boards/tasks/state. A Jira item has
|
|
12
|
-
* a lock: a drop says its status lives in Jira. Epics are on Backlog and Timeline, not here.
|
|
13
|
-
* Timeline initiative > epic > item on the HTML timeline (c3-ini-timeline.js): a PMOS bar drags to reschedule (POST
|
|
14
|
-
* /api/boards/tasks/reschedule, with Undo), a Jira bar is locked; release dates (GET /api/releases) are markers.
|
|
15
|
-
* Every control is a button; the drag handlers are drag events on the cards and columns (pointer handlers stay on the document). */
|
|
16
|
-
import { el } from './dom.js';
|
|
17
|
-
import { registerBoardTab } from './c3-initiatives.js';
|
|
18
|
-
import { icon, pill, lk, ib, pbtn, note, sect, card, list, empty, stepsMini, jiraLabel, plural, trunc, openMenu, mono, put } from './c3-ini-ui.js';
|
|
19
|
-
import { STATUSES, wfOf, tplName, loadItems, dropItems, workRow, workTlRows, iniTlRow, rescheduleTask, lockedToast } from './c3-ini-work.js';
|
|
20
|
-
import { timeline, tlInit, tlRange, tlStill } from './c3-ini-timeline.js';
|
|
21
|
-
|
|
22
|
-
const COL_CAP = 8;
|
|
23
|
-
const TL_CAP = 14;
|
|
24
|
-
const KINDS = [['', 'Any type'], ['Epic', 'Epic'], ['Story', 'Story'], ['Task', 'Task'], ['Bug', 'Bug']];
|
|
25
|
-
const STATE = new Map(); // ws|board -> the shared filters
|
|
26
|
-
const stateOf = (ctx) => {
|
|
27
|
-
const k = ctx.ws + '|' + ctx.board.id;
|
|
28
|
-
if (!STATE.has(k)) STATE.set(k, { q: '', ini: '', src: '', kind: '', hideDone: false, more: {}, tlAll: false });
|
|
29
|
-
return STATE.get(k);
|
|
30
|
-
};
|
|
31
|
-
const matches = (st, w) => {
|
|
32
|
-
const q = st.q.trim().toLowerCase();
|
|
33
|
-
return (!st.ini || w.ini === st.ini) && (!st.src || w.src === st.src) && (!st.kind || w.kind === st.kind) && (!st.hideDone || w.status !== 'Done')
|
|
34
|
-
&& (!q || ((w.key || '') + ' ' + w.title + ' ' + (w.owner || '') + ' ' + w.ini).toLowerCase().includes(q));
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
function mountItems(tab) {
|
|
38
|
-
return async (host, ctx) => {
|
|
39
|
-
const b = ctx.board;
|
|
40
|
-
const st = stateOf(ctx);
|
|
41
|
-
if (ctx.filter && ctx.filter.ini) st.ini = ctx.filter.ini;
|
|
42
|
-
if (!b.build && st.src === 'jira') st.src = '';
|
|
43
|
-
let dead = false; let R = null;
|
|
44
|
-
put(host, note('Reading the work items'));
|
|
45
|
-
async function reload(force) {
|
|
46
|
-
R = await loadItems(ctx, force);
|
|
47
|
-
if (!dead) draw();
|
|
48
|
-
}
|
|
49
|
-
const changed = () => { dropItems(ctx); reload(true); };
|
|
50
|
-
|
|
51
|
-
function toolbar(all, shown) {
|
|
52
|
-
const byId = new Map(R.initiatives.map((i) => [i.id, i]));
|
|
53
|
-
const withWork = [...new Set(all.map((w) => w.ini))].map((id) => byId.get(id)).filter(Boolean).sort((a, c) => ((c.featured ? 1 : 0) - (a.featured ? 1 : 0)) || a.id.localeCompare(c.id));
|
|
54
|
-
if (st.ini && !withWork.some((i) => i.id === st.ini) && byId.get(st.ini)) withWork.push(byId.get(st.ini));
|
|
55
|
-
const others = R.initiatives.length - withWork.length;
|
|
56
|
-
const search = el('input', { type: 'text', value: st.q, placeholder: 'Search ' + b.name + ' work items', 'aria-label': 'Search work items', 'data-wk': 'q', autocomplete: 'off' });
|
|
57
|
-
let deb = null;
|
|
58
|
-
search.addEventListener('input', () => { clearTimeout(deb); deb = setTimeout(() => { st.q = search.value; draw('[data-wk="q"]'); }, 200); });
|
|
59
|
-
const tick = () => el('span', { class: 'il-tick' }, icon('check', 'sm'));
|
|
60
|
-
const SRCS = [['', 'All sources'], ['jira', 'Jira ' + jiraLabel(b)], ['pmos', 'PMOS tasks']];
|
|
61
|
-
const nf = (st.kind ? 1 : 0) + (st.src ? 1 : 0) + (st.hideDone ? 1 : 0);
|
|
62
|
-
const iniMenu = (anchor) => openMenu(anchor, { label: 'Initiative', items: [{ group: 'Initiative' },
|
|
63
|
-
{ kids: [tick(), 'All initiatives'], checked: !st.ini, attrs: { 'data-wk-ini': '' }, onPick: () => { st.ini = ''; draw('[data-wk="ini"]'); } },
|
|
64
|
-
...withWork.map((i) => ({ kids: [tick(), el('span', { class: 'mono' }, i.id), ' ' + trunc(i.title, 30)], checked: st.ini === i.id, attrs: { 'data-wk-ini': i.id, title: i.id + ' ' + i.title }, onPick: () => { st.ini = i.id; draw('[data-wk="ini"]'); } })),
|
|
65
|
-
...(others > 0 ? [{ group: plural(others, 'more has', 'more have') + ' no work yet' }] : [])] });
|
|
66
|
-
const filterMenu = (anchor) => {
|
|
67
|
-
const sel = (k, label, opts) => el('label', { class: 'il-f' }, el('span', null, label), el('select', { 'aria-label': label, 'data-wk': k === 'kind' ? 'kind' : 'src', onchange: (e) => { st[k] = e.target.value; draw('[data-wk="filters"]'); } }, ...opts.map(([v, l]) => el('option', { value: v, selected: v === st[k] }, l))));
|
|
68
|
-
openMenu(anchor, { label: 'Filters', body: el('div', { 'data-wk': 'filter-panel' }, el('div', { class: 'ini-mlbl' }, 'Filter work items'),
|
|
69
|
-
sel('kind', 'Type', KINDS), b.build ? sel('src', 'Source', SRCS) : null,
|
|
70
|
-
el('label', { class: 'il-f' }, el('span', null, 'Done'), el('select', { 'aria-label': 'Done items', 'data-wk': 'done', onchange: (e) => { st.hideDone = e.target.value === 'hide'; draw('[data-wk="filters"]'); } }, el('option', { value: 'show', selected: !st.hideDone }, 'Show'), el('option', { value: 'hide', selected: st.hideDone }, 'Hide'))),
|
|
71
|
-
b.build ? null : el('div', { class: 'dim il-fnote', 'data-wk': 'no-jira' }, 'Build and deliver is off, so every item is a PMOS task. ', lk({ onclick: () => ctx.openBoardSettings() }, 'Board settings')),
|
|
72
|
-
el('div', { class: 'chips2 il-fend' }, lk({ 'data-wk': 'clear-in-menu', onclick: () => { Object.assign(st, { q: '', ini: '', src: '', kind: '', hideDone: false }); draw(); } }, 'Clear filters'))) });
|
|
73
|
-
};
|
|
74
|
-
const on = [st.kind ? ['kind', 'Type: ' + st.kind] : null, st.src ? ['src', 'Source: ' + (st.src === 'jira' ? 'Jira' : 'PMOS tasks')] : null, st.hideDone ? ['hideDone', 'Done hidden'] : null].filter(Boolean);
|
|
75
|
-
const any = st.q || st.ini || on.length;
|
|
76
|
-
return [
|
|
77
|
-
el('div', { class: 'calbar wk-fbar' }, el('div', { class: 'form il-search' }, icon('search', 'sm'), search),
|
|
78
|
-
pbtn('ghost', [st.ini ? el('span', { class: 'mono' }, st.ini) : 'All initiatives', el('span', { class: 'il-chev' }, icon('next', 'sm'))], null, { 'data-wk': 'ini', 'aria-haspopup': 'menu', 'aria-expanded': 'false', title: 'Initiative', onclick: (e) => iniMenu(e.currentTarget) }),
|
|
79
|
-
ib(nf ? 'Filters, ' + nf + ' on' : 'Filters', [icon('filter', 'sm'), nf ? el('span', { class: 'bdg' }, String(nf)) : null], { class: 'il-ib', 'data-wk': 'filters', 'aria-haspopup': 'dialog', 'aria-expanded': 'false', title: 'Filters', onclick: (e) => filterMenu(e.currentTarget) }),
|
|
80
|
-
any ? el('div', { class: 'chips2 il-chips', 'data-wk': 'chips' },
|
|
81
|
-
...on.map(([k, l]) => lk({ 'data-wk-unset': k, title: 'Remove this filter', onclick: () => { st[k] = k === 'hideDone' ? false : ''; draw('[data-wk="filters"]'); } }, l + ' ', icon('x', 'sm'))),
|
|
82
|
-
lk({ 'data-wk': 'clear', onclick: () => { Object.assign(st, { q: '', ini: '', src: '', kind: '', hideDone: false }); draw(); } }, 'Clear')) : null),
|
|
83
|
-
];
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/* ── Backlog ── */
|
|
87
|
-
function addForm() {
|
|
88
|
-
const inis = R.initiatives.filter((i) => i.status !== 'done' && i.status !== 'cancelled').sort((a, c) => ((c.featured ? 1 : 0) - (a.featured ? 1 : 0)) || a.id.localeCompare(c.id)).slice(0, 60);
|
|
89
|
-
const F = { ini: st.ini && inis.some((i) => i.id === st.ini) ? st.ini : (inis[0] || {}).id || '', busy: false };
|
|
90
|
-
const input = el('input', { type: 'text', placeholder: 'Add a PMOS task', 'aria-label': 'Add a PMOS task', 'data-wk': 'add-title' });
|
|
91
|
-
const msg = el('div', { class: 'fold w', role: 'alert', hidden: '', 'data-wk': 'add-error' });
|
|
92
|
-
async function add() {
|
|
93
|
-
const title = input.value.trim();
|
|
94
|
-
if (!title) { msg.textContent = 'Write the task first.'; msg.hidden = false; input.focus(); return; }
|
|
95
|
-
if (!F.ini || F.busy) return;
|
|
96
|
-
F.busy = true;
|
|
97
|
-
const r = await ctx.api.post('/api/boards/tasks/add', { board: b.id, initiative: F.ini, title });
|
|
98
|
-
F.busy = false;
|
|
99
|
-
if (!r || !r.ok) { msg.textContent = 'The task was not added: ' + ((r && r.error) || 'no answer') + '.'; msg.hidden = false; return; }
|
|
100
|
-
ctx.toast('PMOS task added to ' + F.ini + '. Drag it on the Timeline to set its dates.');
|
|
101
|
-
changed();
|
|
102
|
-
}
|
|
103
|
-
input.addEventListener('keydown', (e) => { if (e.key === 'Enter') { e.preventDefault(); add(); } });
|
|
104
|
-
return card({ ic: 'plus', title: 'Add a PMOS task', sub: b.build ? 'Jira items are created in Jira' : 'this board has no Jira', attrs: { 'data-wk': 'add' } },
|
|
105
|
-
inis.length ? el('div', { class: 'form' }, input,
|
|
106
|
-
el('select', { 'aria-label': 'Initiative for the task', 'data-wk': 'add-ini', onchange: (e) => { F.ini = e.target.value; } }, ...inis.map((i) => el('option', { value: i.id, selected: i.id === F.ini }, i.id + ' ' + trunc(i.title, 28)))),
|
|
107
|
-
pbtn('outline', 'Add', 'plus', { 'data-wk': 'add-go', onclick: add })) : note('No open initiative to add a task to.'), msg);
|
|
108
|
-
}
|
|
109
|
-
function backlogBody(shown, all) {
|
|
110
|
-
const byId = new Map(R.initiatives.map((i) => [i.id, i]));
|
|
111
|
-
const groups = [...new Set(shown.map((w) => w.ini))].map((id) => byId.get(id)).filter(Boolean).sort((a, c) => ((c.featured ? 1 : 0) - (a.featured ? 1 : 0)) || String(a.start || '9').localeCompare(String(c.start || '9')));
|
|
112
|
-
const secs = groups.map((i) => {
|
|
113
|
-
const its = shown.filter((w) => w.ini === i.id); const epics = its.filter((w) => w.kind === 'Epic');
|
|
114
|
-
const inEpic = (w) => w.kind !== 'Epic' && w.epic && epics.some((e) => e.uid === w.epic);
|
|
115
|
-
const ordered = [...epics.flatMap((e) => [e, ...its.filter((w) => w.epic === e.uid)]), ...its.filter((w) => w.kind !== 'Epic' && !inEpic(w))];
|
|
116
|
-
return sect({ ic: 'init', title: i.id + ' ' + trunc(i.title, 48), count: its.length, attrs: { 'data-wk-group': i.id },
|
|
117
|
-
right: el('span', { class: 'chips2' }, stepsMini(wfOf(i, b), i.stage, tplName(i, b)), lk({ onclick: () => ctx.openInitiative(i.id, 'breakdown') }, 'Open initiative')) },
|
|
118
|
-
list(ordered.map((w) => workRow(ctx, w, { all, sub: inEpic(w), onChanged: changed }))));
|
|
119
|
-
});
|
|
120
|
-
return [addForm(), ...(secs.length ? secs : [empty('No work items match. Clear the filters, or add a PMOS task.', { 'data-wk': 'empty' })])];
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/* ── Board (kanban) ── */
|
|
124
|
-
async function setState(w, s) {
|
|
125
|
-
if (w.src === 'jira') { lockedToast(ctx, w.key); return; }
|
|
126
|
-
if (w.status === s) return;
|
|
127
|
-
const r = await ctx.api.post('/api/boards/tasks/state', { board: b.id, task: w.ref, state: s });
|
|
128
|
-
if (!r || !r.ok) { ctx.toast({ text: 'The status did not change: ' + ((r && r.error) || 'no answer') + '.', tone: 'error' }); return; }
|
|
129
|
-
ctx.toast('"' + trunc(w.title, 40) + '" moved to ' + s + '.');
|
|
130
|
-
changed();
|
|
131
|
-
}
|
|
132
|
-
function kbCard(w, all) {
|
|
133
|
-
const li = workRow(ctx, w, { all, epic: true, onChanged: changed,
|
|
134
|
-
right: w.src === 'pmos' ? [ib('Move ' + w.title + ' to another status', 'more', { 'data-wk-move': w.ref, 'aria-haspopup': 'menu', 'aria-expanded': 'false',
|
|
135
|
-
onclick: (e) => openMenu(e.currentTarget, { label: 'Move to a status', items: [{ group: 'Move to' }, ...STATUSES.map((s) => ({ label: s, current: s === w.status, disabled: s === w.status, attrs: { 'data-wk-state': s }, onPick: () => setState(w, s) }))] }) })] : [] });
|
|
136
|
-
li.setAttribute('draggable', 'true'); li.setAttribute('data-ini-card', w.uid);
|
|
137
|
-
li.addEventListener('dragstart', (e) => { try { e.dataTransfer.setData('text/plain', w.uid); e.dataTransfer.effectAllowed = 'move'; } catch { /* no data transfer */ } li.classList.add('ini-dragging'); });
|
|
138
|
-
li.addEventListener('dragend', () => li.classList.remove('ini-dragging'));
|
|
139
|
-
return li;
|
|
140
|
-
}
|
|
141
|
-
function kanbanBody(shown, all) {
|
|
142
|
-
const items = shown.filter((w) => w.kind !== 'Epic');
|
|
143
|
-
const cols = STATUSES.map((s) => {
|
|
144
|
-
const cards = items.filter((w) => w.status === s).sort((a, c) => ((c.blocked ? 1 : 0) - (a.blocked ? 1 : 0)) || String(a.end || '9').localeCompare(String(c.end || '9')));
|
|
145
|
-
const cap = st.more[s] ? cards.length : COL_CAP;
|
|
146
|
-
const col = sect({ ic: s === 'Done' ? 'check' : s === 'To do' ? 'todo' : 'bolt', title: s, count: cards.length, attrs: { 'data-ini-col': s, 'aria-label': s } },
|
|
147
|
-
cards.length ? list(cards.slice(0, cap).map((w) => kbCard(w, all))) : empty('Drop a PMOS task here'),
|
|
148
|
-
cards.length > cap ? el('div', { class: 'chips2' }, pill({ 'data-wk-more': s, onclick: () => { st.more[s] = true; draw(); } }, 'Show ' + (cards.length - cap) + ' more')) : null);
|
|
149
|
-
col.addEventListener('dragover', (e) => { e.preventDefault(); col.classList.add('over'); });
|
|
150
|
-
col.addEventListener('dragleave', (e) => { if (!col.contains(e.relatedTarget)) col.classList.remove('over'); });
|
|
151
|
-
col.addEventListener('drop', (e) => {
|
|
152
|
-
e.preventDefault(); col.classList.remove('over');
|
|
153
|
-
let uid = ''; try { uid = e.dataTransfer.getData('text/plain'); } catch { uid = ''; }
|
|
154
|
-
const w = items.find((x) => x.uid === uid); if (w) setState(w, s);
|
|
155
|
-
});
|
|
156
|
-
return col;
|
|
157
|
-
});
|
|
158
|
-
return [note('Columns are item statuses. Drag a PMOS task to move it, or use its menu. Jira items carry a lock: their status changes in Jira and shows here after the next sync. Epics are in Backlog and Timeline.'),
|
|
159
|
-
el('div', { class: 'brief sbb' }, el('div', { class: 'ini-kb', 'data-wk': 'kanban' }, ...cols))];
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/* ── Timeline ── */
|
|
163
|
-
let markers = null;
|
|
164
|
-
async function loadMarkers() {
|
|
165
|
-
if (!b.build) { markers = []; return; }
|
|
166
|
-
const r = await ctx.api.get('/api/releases', { board: b.id });
|
|
167
|
-
markers = r && r.ok ? (r.releases || []).filter((x) => !x.board || x.board === b.id).map((x) => ({ id: x.id, at: String(x.release_at || x.deploy_at || x.date || '').slice(0, 10), label: x.name || x.id, kind: 'release' })).filter((m) => m.at) : [];
|
|
168
|
-
}
|
|
169
|
-
function timelineBody(shown) {
|
|
170
|
-
const withItems = new Set(shown.map((w) => w.ini));
|
|
171
|
-
let inis = R.initiatives.filter((i) => (st.ini ? i.id === st.ini : true));
|
|
172
|
-
let hidden = 0;
|
|
173
|
-
if (!st.ini) {
|
|
174
|
-
const pick = inis.filter((i) => withItems.has(i.id)).sort((a, c) => ((c.featured ? 1 : 0) - (a.featured ? 1 : 0)) || String(a.start || '9').localeCompare(String(c.start || '9')));
|
|
175
|
-
const rest = (st.src || st.q || st.kind) ? [] : inis.filter((i) => !withItems.has(i.id) && ['on track', 'at risk', 'late'].includes(i.status) && i.start && i.end && (i.horizon === 'now' || i.featured)).sort((a, c) => String(a.start).localeCompare(String(c.start)));
|
|
176
|
-
const cap = st.tlAll ? 1e9 : TL_CAP; inis = [...pick, ...rest].slice(0, Math.max(cap, pick.length));
|
|
177
|
-
hidden = pick.length + rest.length - inis.length;
|
|
178
|
-
}
|
|
179
|
-
const rows = inis.map((i) => iniTlRow(ctx, i, workTlRows(ctx, shown.filter((w) => w.ini === i.id), changed), b));
|
|
180
|
-
const first = inis.find((i) => withItems.has(i.id));
|
|
181
|
-
const { from, to } = tlRange(ctx.today);
|
|
182
|
-
const key = 'b:' + ctx.ws + ':' + b.id;
|
|
183
|
-
const node = timeline({ key, rows, from, to, today: ctx.today, markers: markers || [], head: 'Initiative > epic > item',
|
|
184
|
-
defOpen: st.ini ? [st.ini] : first ? [first.id, ...shown.filter((w) => w.ini === first.id && w.kind === 'Epic').map((e) => e.uid)] : [],
|
|
185
|
-
onMove: (task, days) => rescheduleTask(ctx, task, days, () => { tlStill(key); changed(); }),
|
|
186
|
-
onLocked: (k) => lockedToast(ctx, k) });
|
|
187
|
-
requestAnimationFrame(() => { if (!dead) tlInit(host); });
|
|
188
|
-
return [sect({ ic: 'cal', title: 'Timeline', count: rows.length, right: mono('press a row to open its epics') }, node,
|
|
189
|
-
hidden > 0 ? el('div', { class: 'chips2' }, el('span', { class: 'dim ini-note' }, plural(hidden, 'more Now initiative', 'more Now initiatives') + ' with no epics yet'), pill({ 'data-wk': 'tl-all', onclick: () => { st.tlAll = true; draw(); } }, 'Show all')) : null,
|
|
190
|
-
b.build ? note('Release dates come from Jira ' + jiraLabel(b) + ' fix versions. PMOS bars drag to reschedule; Jira bars are locked.') : note('Every bar here is a PMOS task: drag it to reschedule.'))];
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
function draw(focusSel) {
|
|
194
|
-
if (dead) return;
|
|
195
|
-
if (!R.ok) { put(host, el('div', { class: 'fold w', role: 'alert', 'data-ini': 'error' }, icon('alert', 'sm'), 'The work items could not be read: ' + R.error + '.')); return; }
|
|
196
|
-
const all = R.items; const shown = all.filter((w) => matches(st, w));
|
|
197
|
-
const body = tab === 'backlog' ? backlogBody(shown, all) : tab === 'board' ? kanbanBody(shown, all) : timelineBody(shown);
|
|
198
|
-
put(host, el('div', { class: 'calbody', 'data-wk-tab': tab }, ...toolbar(all, shown), ...body));
|
|
199
|
-
if (focusSel) { const f = host.querySelector(focusSel); if (f) { f.focus(); if (f.setSelectionRange && f.value) f.setSelectionRange(f.value.length, f.value.length); } }
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
if (tab === 'timeline') await loadMarkers();
|
|
203
|
-
await reload(false);
|
|
204
|
-
return () => { dead = true; };
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
registerBoardTab('backlog', mountItems('backlog'));
|
|
209
|
-
registerBoardTab('board', mountItems('board'));
|
|
210
|
-
registerBoardTab('timeline', mountItems('timeline'));
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/* pm/c3-ib-releases.js — the Releases tab of a board with Build and deliver on (mockup v5, 34-initiatives.js tabReleases).
|
|
2
|
-
* registerBoardTab('releases', (host, ctx) => ...)
|
|
3
|
-
* Reads GET /api/releases (lib/routes-releases.js: id, name?, initiative_ids, deploy_at, release_at, accepted_at, gapFlags, and `board`
|
|
4
|
-
* and `status` when a release carries them) and keeps the releases whose initiative_ids meet the board's initiatives (loadItems). A
|
|
5
|
-
* release that names another board in `board` is left out. Read-only: releases mirror Jira fix versions; their dates live on the Calendar.
|
|
6
|
-
* Left: Unreleased (the nearest first), each row with its status, date and days to go, the share of its scope done, and in place its
|
|
7
|
-
* scope as links; then Released. The Unreleased header links to the Calendar (c3-board-declutter: no side card). Nothing is invented: a release with no name shows
|
|
8
|
-
* its id, one with no date says "No date yet". */
|
|
9
|
-
import { el } from './dom.js';
|
|
10
|
-
import { registerBoardTab } from './c3-initiatives.js';
|
|
11
|
-
import { icon, lk, chip, tag, st, note, sect, list, empty, nrow, hbs, hbr, statusChip, jiraLabel, plural, day, daysBetween, put } from './c3-ini-ui.js';
|
|
12
|
-
import { loadItems } from './c3-ini-work.js';
|
|
13
|
-
|
|
14
|
-
const whenOf = (r) => String(r.release_at || r.deploy_at || r.date || '').slice(0, 10);
|
|
15
|
-
const relSt = (s) => (/at risk/i.test(s) ? st('warn', 'alert', 'At risk') : /ready/i.test(s) ? st('ok', 'check', 'Ready') : /released|accepted/i.test(s) ? st('ok', 'check', s) : tag(s));
|
|
16
|
-
|
|
17
|
-
registerBoardTab('releases', async (host, ctx) => {
|
|
18
|
-
let dead = false;
|
|
19
|
-
const b = ctx.board;
|
|
20
|
-
put(host, note('Reading the releases'));
|
|
21
|
-
const [items, rel] = await Promise.all([loadItems(ctx), ctx.api.get('/api/releases', { board: b.id })]);
|
|
22
|
-
if (dead) return () => {};
|
|
23
|
-
const fail = (t) => { put(host, el('div', { class: 'fold w', role: 'alert' }, icon('alert', 'sm'), t)); return () => { dead = true; }; };
|
|
24
|
-
if (!items.ok) return fail('The initiatives of this board could not be read: ' + items.error + '.');
|
|
25
|
-
if (!rel || !rel.ok) return fail('The releases could not be read: ' + ((rel && rel.error) || 'no answer') + '.');
|
|
26
|
-
const byId = new Map(items.initiatives.map((i) => [i.id, i]));
|
|
27
|
-
const mine = (rel.releases || []).filter((r) => (r.board ? r.board === b.id : Array.isArray(r.initiative_ids) && r.initiative_ids.some((id) => byId.has(id))));
|
|
28
|
-
const statusOf = (r, past) => r.status || (r.accepted_at ? 'Released' : past ? 'Past' : 'Planned');
|
|
29
|
-
const up = mine.filter((r) => !whenOf(r) || whenOf(r) >= ctx.today).sort((a, c) => (!whenOf(a)) - (!whenOf(c)) || whenOf(a).localeCompare(whenOf(c)));
|
|
30
|
-
const past = mine.filter((r) => whenOf(r) && whenOf(r) < ctx.today).sort((a, c) => whenOf(c).localeCompare(whenOf(a)));
|
|
31
|
-
const row = (r, isPast) => {
|
|
32
|
-
const scope = (r.initiative_ids || []).map((id) => byId.get(id) || { id, title: '', progress: null, status: '' });
|
|
33
|
-
const known = scope.filter((i) => i.progress != null);
|
|
34
|
-
const prog = known.length ? known.reduce((n, i) => n + (Number(i.progress) || 0), 0) / known.length : 0;
|
|
35
|
-
const status = statusOf(r, isPast); const w = whenOf(r); const gaps = Array.isArray(r.gapFlags) ? r.gapFlags.length : 0;
|
|
36
|
-
return nrow({ ic: isPast ? 'check' : 'out', hot: /at risk/i.test(status), tone: isPast ? 'ok' : '', title: r.name || r.id, titleAttrs: { 'data-inb-relopen': r.id },
|
|
37
|
-
chips: [relSt(status), chip(icon('cal', 'sm'), w ? day(w) + (isPast ? '' : ' · ' + plural(daysBetween(ctx.today, w), 'day')) : 'No date yet'),
|
|
38
|
-
known.length ? chip(Math.round(prog * 100) + '% of scope done') : null, gaps ? st('warn', 'alert', plural(gaps, 'gap')) : null, tag(icon('jira', 'sm'), 'fix version')],
|
|
39
|
-
xp: [hbs([hbr('Scope done', Math.round(prog * 100) + '%', prog, /at risk/i.test(status) ? 'warn' : 'ok')]),
|
|
40
|
-
el('div', { class: 'chips', 'data-inb': 'release-scope' }, el('span', { class: 'dim ini-note' }, 'Scope:'),
|
|
41
|
-
...(scope.length ? scope.map((i) => el('span', { class: 'chips2' }, byId.has(i.id) ? lk({ onclick: () => ctx.openInitiative(i.id), 'data-inb-scope': i.id }, i.id + (i.title ? ' ' + i.title : '')) : chip(i.id), i.status ? statusChip(i.status) : null))
|
|
42
|
-
: [el('span', { class: 'dim' }, 'No initiatives in scope')]))],
|
|
43
|
-
attrs: { 'data-inb-release': r.id, 'data-inb-when': isPast ? 'past' : r === up[0] ? 'next' : 'later' } });
|
|
44
|
-
};
|
|
45
|
-
put(host, ...[sect({ ic: 'out', title: 'Unreleased', count: up.length, right: lk({ 'data-inb': 'open-calendar', title: 'Releases mirror Jira ' + jiraLabel(b) + ' fix versions. Their dates live on the Calendar.', onclick: () => ctx.showTab('cal') }, icon('cal', 'sm'), 'On the Calendar'), attrs: { 'data-inb': 'release-next' } }, up.length ? list(up.map((r) => row(r, false))) : empty('No release planned for ' + b.name + '.', { 'data-inb': 'release-none-next' })),
|
|
46
|
-
past.length ? sect({ ic: 'check', title: 'Released', count: past.length, attrs: { 'data-inb': 'release-past' } }, list(past.map((r) => row(r, true)))) : null].filter(Boolean));
|
|
47
|
-
return () => { dead = true; };
|
|
48
|
-
});
|