@riboseinc/paneron-registry-kit 2.2.16 → 2.2.17
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 +1 -1
- package/views/ItemDrawer.js +3 -2
- package/views/ItemDrawer.js.map +1 -1
- package/views/change-request/Proposals.d.ts +3 -2
- package/views/change-request/Proposals.js +124 -146
- package/views/change-request/Proposals.js.map +1 -1
- package/views/detail/ChangeRequest/index.js +4 -1
- package/views/detail/ChangeRequest/index.js.map +1 -1
- package/views/detail/RegisterHome/index.js +10 -3
- package/views/detail/RegisterHome/index.js.map +1 -1
- package/views/detail/RegisterItem/index.js +1 -10
- package/views/detail/RegisterItem/index.js.map +1 -1
- package/views/index.js +27 -20
- package/views/index.js.map +1 -1
package/package.json
CHANGED
package/views/ItemDrawer.js
CHANGED
|
@@ -47,6 +47,7 @@ const ItemSearchDrawer = function ({
|
|
|
47
47
|
isOpen: isOpen,
|
|
48
48
|
onClose: onClose,
|
|
49
49
|
enforceFocus: false,
|
|
50
|
+
size: "50vw",
|
|
50
51
|
style: {
|
|
51
52
|
padding: '0',
|
|
52
53
|
width: 'unset'
|
|
@@ -54,9 +55,9 @@ const ItemSearchDrawer = function ({
|
|
|
54
55
|
}, (0, _react.jsx)(_Search.default, {
|
|
55
56
|
style: {
|
|
56
57
|
height: '100vh',
|
|
57
|
-
width: '
|
|
58
|
+
width: '50vw',
|
|
58
59
|
minWidth: '500px',
|
|
59
|
-
maxWidth: '
|
|
60
|
+
maxWidth: '90vw'
|
|
60
61
|
},
|
|
61
62
|
availableClassIDs: availableClassIDs,
|
|
62
63
|
implicitCriteria: implicitCriteria,
|
package/views/ItemDrawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemDrawer.js","sourceRoot":"","sources":["../../src/views/ItemDrawer.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,8BAA8B;AAE9B,OAAO,EAAE,GAAG,EAAE,MAAM,g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AAE,aAAa;SACxB;QACH,CAAC,CAAC,SAAS,CACd,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,QAAQ,EAAE,EAAE;QAC9C,YAAY,CAAC,iBAAiB,CAAC,YAAY,KAAK,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;QACtE,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;IAE5B,OAAO,CACL,IAAC,MAAM,IACH,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,KAAK,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE;QACzC,IAAC,MAAM,IACL,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAC9E,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAC,kCAAkC,EAC5C,UAAU,EAAE,cAAc,GAC1B,CACK,CACV,CAAC;AACJ,CAAC,CAAC;AAGF,eAAe,gBAAgB,CAAC","sourcesContent":["/** @jsx jsx */\n/** @jsxFrag React.Fragment */\n\nimport { jsx } from '@emotion/react';\nimport React, { useContext, useMemo, useCallback } from 'react';\nimport { Drawer } from '@blueprintjs/core';\nimport type { InternalItemReference } from '../types';\nimport type { Criterion, CriteriaGroup } from './FilterCriteria/models';\nimport { BrowserCtx } from './BrowserCtx';\nimport Search from './sidebar/Search';\nimport { itemPathToItemRef } from './itemPathUtils';\n\n\nconst ItemSearchDrawer: React.FC<{\n isOpen: boolean\n onClose: () => void\n onChooseItem: (itemRef: InternalItemReference) => void\n availableClassIDs: string[]\n}> = function ({\n isOpen, onClose, onChooseItem,\n availableClassIDs,\n}) {\n const { subregisters } = useContext(BrowserCtx);\n\n const classCriteria: Criterion[] = useMemo(() => (\n availableClassIDs.map(clsID => ({\n key: 'item-class',\n query: `objPath.indexOf(\\\"/${clsID}/\\\") >= 0`,\n }))\n ), [availableClassIDs.toString()]);\n\n const implicitCriteria: CriteriaGroup | undefined = useMemo(() => (\n classCriteria.length > 0\n ? {\n require: 'any',\n criteria: classCriteria,\n }\n : undefined\n ), [classCriteria]);\n\n const handleOpenItem = useCallback((itemPath) => {\n onChooseItem(itemPathToItemRef(subregisters !== undefined, itemPath));\n onClose();\n }, [onChooseItem, onClose]);\n\n return (\n <Drawer\n isOpen={isOpen}\n onClose={onClose}\n enforceFocus={false}\n size=\"50vw\"\n style={{ padding: '0', width: 'unset' }}>\n <Search\n style={{ height: '100vh', width: '50vw', minWidth: '500px', maxWidth: '90vw' }}\n availableClassIDs={availableClassIDs}\n implicitCriteria={implicitCriteria}\n stateName=\"superseding-item-selector-search\"\n onOpenItem={handleOpenItem}\n />\n </Drawer>\n );\n};\n\n\nexport default ItemSearchDrawer;\n"]}
|
|
@@ -6,12 +6,13 @@ import type { ChangeProposal, Clarification, InternalItemReference, Payload, Reg
|
|
|
6
6
|
import type { Drafted } from '../../types/cr';
|
|
7
7
|
interface ProposalBrowserProps<CR extends Drafted> {
|
|
8
8
|
proposals: CR['items'];
|
|
9
|
+
selectedItem?: (string & keyof CR['items']) | null;
|
|
10
|
+
onSelectItem: (selectedItem: (string & keyof CR['items']) | null) => void;
|
|
9
11
|
/**
|
|
10
12
|
* If provided, button to delete each proposed change
|
|
11
13
|
* is shown in change card list mode.
|
|
12
14
|
*/
|
|
13
15
|
onDeleteProposalForItemAtPath?: (itemPath: string) => void;
|
|
14
|
-
className?: string;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* Shows a list of individual proposed changes as cards by default,
|
|
@@ -19,7 +20,7 @@ interface ProposalBrowserProps<CR extends Drafted> {
|
|
|
19
20
|
*
|
|
20
21
|
* If no proposals exist, returns null.
|
|
21
22
|
*/
|
|
22
|
-
export declare function Proposals<CR extends Drafted>({ proposals, onDeleteProposalForItemAtPath,
|
|
23
|
+
export declare function Proposals<CR extends Drafted>({ proposals, onDeleteProposalForItemAtPath, selectedItem, onSelectItem: selectProposal }: ProposalBrowserProps<CR>): jsx.JSX.Element;
|
|
23
24
|
interface ProposalProps<P extends ChangeProposal> {
|
|
24
25
|
proposal: P;
|
|
25
26
|
/** Highlight changes. */
|
|
@@ -59,12 +59,13 @@ function stringifiedJSONEqual(i1, i2) {
|
|
|
59
59
|
function Proposals({
|
|
60
60
|
proposals,
|
|
61
61
|
onDeleteProposalForItemAtPath,
|
|
62
|
-
|
|
62
|
+
selectedItem,
|
|
63
|
+
onSelectItem: selectProposal
|
|
63
64
|
}) {
|
|
64
|
-
var _a
|
|
65
|
+
var _a;
|
|
65
66
|
|
|
66
|
-
const [
|
|
67
|
-
const
|
|
67
|
+
const [preferDiff, setPreferDiff] = (0, _react.useState)(false);
|
|
68
|
+
const selectedProposal = selectedItem !== null && selectedItem !== void 0 ? selectedItem : null; // TODO: Temporarily unsupported
|
|
68
69
|
// (limitations of current change annotation implementation)
|
|
69
70
|
//const [ showOnlyChanged, setShowOnlyChanged ] = useState(true);
|
|
70
71
|
|
|
@@ -150,156 +151,133 @@ function Proposals({
|
|
|
150
151
|
};
|
|
151
152
|
}), [proposals, getCurrentItem, getProposedItem]);
|
|
152
153
|
const haveSelectedItem = selectedProposal && selectedItemRef && proposals[selectedProposal] && (selectedItemProposed || selectedItemCurrent);
|
|
153
|
-
const proposalCount = Object.keys(proposals).length;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}, [selectedProposal === null]);
|
|
154
|
+
const proposalCount = Object.keys(proposals).length; //useEffect(() => {
|
|
155
|
+
// // if (!selectedProposal) {
|
|
156
|
+
// // const firstProposal = Object.keys(proposals)[0];
|
|
157
|
+
// // if (firstProposal) {
|
|
158
|
+
// // if (getCurrentItem(firstProposal) || getProposedItem(firstProposal)) {
|
|
159
|
+
// // selectProposal(firstProposal);
|
|
160
|
+
// // }
|
|
161
|
+
// // }
|
|
162
|
+
// // }
|
|
163
|
+
// if (selectedProposal) {
|
|
164
|
+
// if (selectedProposalDetailRef.current) {
|
|
165
|
+
// selectedProposalDetailRef.current.scrollIntoView({ block: 'center' });
|
|
166
|
+
// }
|
|
167
|
+
// }
|
|
168
|
+
//}, [selectedProposal === null]);
|
|
169
|
+
|
|
172
170
|
const canShowDiff = haveSelectedItem && ((_a = proposals[selectedProposal]) === null || _a === void 0 ? void 0 : _a.type) === 'clarification' ? true : false;
|
|
173
171
|
const showDiff = canShowDiff && preferDiff;
|
|
172
|
+
const selectedItemSummary = haveSelectedItem ? (0, _react2.jsx)(ProposalSummary, {
|
|
173
|
+
itemRef: selectedItemRef,
|
|
174
|
+
item: selectedItemProposed !== null && selectedItemProposed !== void 0 ? selectedItemProposed : selectedItemCurrent,
|
|
175
|
+
itemBefore: selectedItemCurrent !== null && selectedItemCurrent !== void 0 ? selectedItemCurrent : undefined,
|
|
176
|
+
proposal: proposals[selectedProposal]
|
|
177
|
+
}) : (0, _react2.jsx)(_react.default.Fragment, null, "Select item\u2026");
|
|
178
|
+
const icon = haveSelectedItem ? getProposalIcon(proposals[selectedProposal]) : undefined;
|
|
179
|
+
const selectedItemDrawer = (0, _react.useMemo)(() => {
|
|
180
|
+
var _a;
|
|
174
181
|
|
|
175
|
-
|
|
176
|
-
|
|
182
|
+
return (0, _react2.jsx)(_core.Drawer, {
|
|
183
|
+
isOpen: proposalCount > 0 && haveSelectedItem ? true : false,
|
|
184
|
+
onClose: () => selectProposal(null),
|
|
185
|
+
size: _core.DrawerSize.LARGE,
|
|
186
|
+
enforceFocus: false
|
|
187
|
+
}, proposalCount > 0 && haveSelectedItem ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_core.ButtonGroup, null, (0, _react2.jsx)(_core.Button, {
|
|
188
|
+
disabled: !jumpTo || ((_a = proposals[selectedProposal]) === null || _a === void 0 ? void 0 : _a.type) === 'addition',
|
|
189
|
+
icon: 'open-application',
|
|
190
|
+
onClick: () => jumpTo === null || jumpTo === void 0 ? void 0 : jumpTo(`${_protocolRegistry.Protocols.ITEM_DETAILS}:${selectedProposal}`),
|
|
191
|
+
title: "Open selected item in a new tab (not applicable to proposed additions)"
|
|
192
|
+
}), (0, _react2.jsx)(_core.Button, {
|
|
193
|
+
active: preferDiff,
|
|
194
|
+
onClick: () => setPreferDiff(v => !v),
|
|
195
|
+
// Diffing only makes sense for clarifications.
|
|
196
|
+
// Additions are entire new items, and for amendments
|
|
197
|
+
// item data is unchanged.
|
|
198
|
+
disabled: !canShowDiff,
|
|
199
|
+
text: "Compare",
|
|
200
|
+
title: "Annotate proposed clarifications for this item"
|
|
201
|
+
}), (0, _react2.jsx)(_react2.ClassNames, null, ({
|
|
202
|
+
css: css2
|
|
203
|
+
}) => (0, _react2.jsx)(_select.Select2, {
|
|
204
|
+
filterable: false,
|
|
205
|
+
itemsEqual: stringifiedJSONEqual,
|
|
206
|
+
menuProps: {
|
|
207
|
+
className: css2(`max-height: 50vh; overflow-y: auto;`)
|
|
208
|
+
},
|
|
209
|
+
activeItem: activeItem,
|
|
210
|
+
items: allItems,
|
|
211
|
+
popoverProps: {
|
|
212
|
+
minimal: true,
|
|
213
|
+
matchTargetWidth: true
|
|
214
|
+
},
|
|
215
|
+
fill: true,
|
|
216
|
+
itemRenderer: ChangeProposalItemView,
|
|
217
|
+
onItemSelect: handleItemSelect
|
|
218
|
+
}, (0, _react2.jsx)(_core.Button, {
|
|
219
|
+
fill: true,
|
|
220
|
+
rightIcon: "chevron-down",
|
|
221
|
+
icon: icon,
|
|
222
|
+
css: (0, _react2.css)`white-space: nowrap;`
|
|
223
|
+
}, selectedItemSummary))), (0, _react2.jsx)(_core.Button, {
|
|
224
|
+
onClick: () => selectProposal(null),
|
|
225
|
+
icon: "minimize",
|
|
226
|
+
title: "Minimize proposed change view",
|
|
227
|
+
text: "Minimize"
|
|
228
|
+
})), (0, _react2.jsx)("div", {
|
|
229
|
+
css: (0, _react2.css)`position: relative; flex: 1;`
|
|
230
|
+
}, (0, _react2.jsx)(_BrowserCtx.BrowserCtx.Provider, {
|
|
231
|
+
value: proposalBrowserCtx
|
|
232
|
+
}, (0, _react2.jsx)(_ErrorBoundary.default, {
|
|
233
|
+
viewName: "Proposal detail"
|
|
234
|
+
}, (0, _react2.jsx)(ProposalDetail, {
|
|
177
235
|
itemRef: selectedItemRef,
|
|
236
|
+
showDiff: showDiff,
|
|
237
|
+
//showOnlyChanged={showOnlyChanged}
|
|
178
238
|
item: selectedItemProposed !== null && selectedItemProposed !== void 0 ? selectedItemProposed : selectedItemCurrent,
|
|
179
239
|
itemBefore: selectedItemCurrent !== null && selectedItemCurrent !== void 0 ? selectedItemCurrent : undefined,
|
|
180
240
|
proposal: proposals[selectedProposal]
|
|
181
|
-
}) :
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
flex-flow: column nowrap;
|
|
199
|
-
transition:
|
|
200
|
-
width .5s linear
|
|
201
|
-
height .5s linear;
|
|
202
|
-
`,
|
|
203
|
-
className: className
|
|
204
|
-
}, (0, _react2.jsx)(_core.ButtonGroup, null, (0, _react2.jsx)(_core.Button, {
|
|
205
|
-
disabled: !jumpTo || ((_b = proposals[selectedProposal]) === null || _b === void 0 ? void 0 : _b.type) === 'addition',
|
|
206
|
-
icon: 'open-application',
|
|
207
|
-
onClick: () => jumpTo === null || jumpTo === void 0 ? void 0 : jumpTo(`${_protocolRegistry.Protocols.ITEM_DETAILS}:${selectedProposal}`),
|
|
208
|
-
title: "Open selected item in a new tab (not applicable to proposed additions)"
|
|
209
|
-
}), (0, _react2.jsx)(_core.Button, {
|
|
210
|
-
active: preferDiff,
|
|
211
|
-
onClick: () => setPreferDiff(v => !v),
|
|
212
|
-
// Diffing only makes sense for clarifications.
|
|
213
|
-
// Additions are entire new items, and for amendments
|
|
214
|
-
// item data is unchanged.
|
|
215
|
-
disabled: !canShowDiff,
|
|
216
|
-
text: "Compare",
|
|
217
|
-
title: "Annotate proposed clarifications for this item"
|
|
218
|
-
}), (0, _react2.jsx)(_react2.ClassNames, null, ({
|
|
219
|
-
css: css2
|
|
220
|
-
}) => (0, _react2.jsx)(_select.Select2, {
|
|
221
|
-
filterable: false,
|
|
222
|
-
itemsEqual: stringifiedJSONEqual,
|
|
223
|
-
menuProps: {
|
|
224
|
-
className: css2(`max-height: 50vh; overflow-y: auto;`)
|
|
225
|
-
},
|
|
226
|
-
activeItem: activeItem,
|
|
227
|
-
items: allItems,
|
|
228
|
-
popoverProps: {
|
|
229
|
-
minimal: true,
|
|
230
|
-
matchTargetWidth: true
|
|
231
|
-
},
|
|
232
|
-
fill: true,
|
|
233
|
-
itemRenderer: ChangeProposalItemView,
|
|
234
|
-
onItemSelect: handleItemSelect
|
|
235
|
-
}, (0, _react2.jsx)(_core.Button, {
|
|
236
|
-
fill: true,
|
|
237
|
-
rightIcon: "chevron-down",
|
|
238
|
-
icon: icon,
|
|
239
|
-
css: (0, _react2.css)`white-space: nowrap;`
|
|
240
|
-
}, selectedItemSummary))), (0, _react2.jsx)(_core.Button, {
|
|
241
|
-
onClick: () => selectProposal(null),
|
|
242
|
-
icon: "minimize",
|
|
243
|
-
title: "Minimize proposed change view",
|
|
244
|
-
text: "Minimize"
|
|
245
|
-
})), (0, _react2.jsx)("div", {
|
|
246
|
-
css: (0, _react2.css)`position: relative; flex: 1;`,
|
|
247
|
-
ref: selectedProposalDetailRef
|
|
248
|
-
}, (0, _react2.jsx)(_BrowserCtx.BrowserCtx.Provider, {
|
|
249
|
-
value: proposalBrowserCtx
|
|
250
|
-
}, (0, _react2.jsx)(_ErrorBoundary.default, {
|
|
251
|
-
viewName: "Proposal detail"
|
|
252
|
-
}, (0, _react2.jsx)(ProposalDetail, {
|
|
253
|
-
itemRef: selectedItemRef,
|
|
254
|
-
showDiff: showDiff,
|
|
255
|
-
//showOnlyChanged={showOnlyChanged}
|
|
256
|
-
item: selectedItemProposed !== null && selectedItemProposed !== void 0 ? selectedItemProposed : selectedItemCurrent,
|
|
257
|
-
itemBefore: selectedItemCurrent !== null && selectedItemCurrent !== void 0 ? selectedItemCurrent : undefined,
|
|
258
|
-
proposal: proposals[selectedProposal]
|
|
259
|
-
})))));
|
|
260
|
-
} else {
|
|
261
|
-
return (0, _react2.jsx)(_react.default.Fragment, null, allItems.map(cpi => {
|
|
262
|
-
const actions = [{
|
|
263
|
-
onClick: () => selectProposal(cpi.itemPath),
|
|
264
|
-
text: "Expand",
|
|
265
|
-
title: "Expand proposed change to see item details",
|
|
266
|
-
icon: 'maximize'
|
|
267
|
-
}];
|
|
268
|
-
|
|
269
|
-
if (onDeleteProposalForItemAtPath) {
|
|
270
|
-
actions.push({
|
|
271
|
-
text: "Delete this proposal",
|
|
272
|
-
intent: 'danger',
|
|
273
|
-
onClick: () => onDeleteProposalForItemAtPath(cpi.itemPath),
|
|
274
|
-
icon: 'trash'
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return (0, _react2.jsx)(_Block.HomeBlockCard, {
|
|
279
|
-
css: (0, _react2.css)`
|
|
280
|
-
flex-basis: calc(33.33% - 10px*2/3);
|
|
281
|
-
`,
|
|
282
|
-
description: `${cpi.proposal.type} proposal`,
|
|
283
|
-
key: cpi.itemPath
|
|
284
|
-
}, (0, _react2.jsx)(ProposalType, {
|
|
285
|
-
item: cpi
|
|
286
|
-
}), (0, _react2.jsx)("div", {
|
|
287
|
-
css: (0, _react2.css)`padding: 5px; flex-grow: 1;`
|
|
288
|
-
}, cpi.item !== null ? (0, _react2.jsx)(_core.H5, {
|
|
289
|
-
css: (0, _react2.css)`margin: 0; overflow: hidden; text-overflow: ellipsis;`
|
|
290
|
-
}, (0, _react2.jsx)(ProposalSummary, {
|
|
291
|
-
itemRef: cpi.itemRef,
|
|
292
|
-
proposal: cpi.proposal,
|
|
293
|
-
itemBefore: cpi.itemBefore,
|
|
294
|
-
item: cpi.item
|
|
295
|
-
})) : (0, _react2.jsx)(_react.default.Fragment, null, "Problem reading proposed item data.")), actions.length > 0 ? (0, _react2.jsx)(_Block.HomeBlockActions, {
|
|
296
|
-
actions: actions
|
|
297
|
-
}) : null);
|
|
298
|
-
}));
|
|
241
|
+
}))))) : null);
|
|
242
|
+
}, [proposalCount > 0, haveSelectedItem, selectedItemProposed, selectedItemCurrent, preferDiff, jumpTo, handleItemSelect, selectedProposal && proposals[selectedProposal]]);
|
|
243
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, selectedItemDrawer, allItems.map(cpi => {
|
|
244
|
+
const actions = [{
|
|
245
|
+
onClick: () => selectProposal(cpi.itemPath),
|
|
246
|
+
text: "Expand",
|
|
247
|
+
title: "Expand proposed change to see item details",
|
|
248
|
+
icon: 'maximize'
|
|
249
|
+
}];
|
|
250
|
+
|
|
251
|
+
if (onDeleteProposalForItemAtPath) {
|
|
252
|
+
actions.push({
|
|
253
|
+
text: "Delete this proposal",
|
|
254
|
+
intent: 'danger',
|
|
255
|
+
onClick: () => onDeleteProposalForItemAtPath(cpi.itemPath),
|
|
256
|
+
icon: 'trash'
|
|
257
|
+
});
|
|
299
258
|
}
|
|
300
|
-
|
|
301
|
-
return
|
|
302
|
-
|
|
259
|
+
|
|
260
|
+
return (0, _react2.jsx)(_Block.HomeBlockCard, {
|
|
261
|
+
css: (0, _react2.css)`
|
|
262
|
+
flex-basis: calc(33.33% - 10px*2/3);
|
|
263
|
+
`,
|
|
264
|
+
description: `${cpi.proposal.type} proposal`,
|
|
265
|
+
key: cpi.itemPath
|
|
266
|
+
}, (0, _react2.jsx)(ProposalType, {
|
|
267
|
+
item: cpi
|
|
268
|
+
}), (0, _react2.jsx)("div", {
|
|
269
|
+
css: (0, _react2.css)`padding: 5px; flex-grow: 1;`
|
|
270
|
+
}, cpi.item !== null ? (0, _react2.jsx)(_core.H5, {
|
|
271
|
+
css: (0, _react2.css)`margin: 0; overflow: hidden; text-overflow: ellipsis;`
|
|
272
|
+
}, (0, _react2.jsx)(ProposalSummary, {
|
|
273
|
+
itemRef: cpi.itemRef,
|
|
274
|
+
proposal: cpi.proposal,
|
|
275
|
+
itemBefore: cpi.itemBefore,
|
|
276
|
+
item: cpi.item
|
|
277
|
+
})) : (0, _react2.jsx)(_react.default.Fragment, null, "Problem reading proposed item data.")), actions.length > 0 ? (0, _react2.jsx)(_Block.HomeBlockActions, {
|
|
278
|
+
actions: actions
|
|
279
|
+
}) : null);
|
|
280
|
+
}));
|
|
303
281
|
}
|
|
304
282
|
|
|
305
283
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Proposals.js","sourceRoot":"","sources":["../../../src/views/change-request/Proposals.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,8BAA8B;AAE9B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EACL,IAAI,EACJ,WAAW,EACX,MAAM,EACN,OAAO,EACP,MAAM,EACN,QAAQ,EAER,GAAG,EACH,EAAE,GACH,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAqB,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,W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AAE,GAAG,EAAE,CAAC,IAAI,CAAC;CAC1E,CAAC;AAGF,MAAM,UAAU,GAAmC;IACjD,IAAI,EAAE,6IAGH;IACH,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,uCAAe,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC;CAC5E,CAAC;AAGF,MAAM,YAAY,GAAqC;IACrD,IAAI,EAAE,sPAIH;IACH,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,yCAAiB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC;CAC9E,CAAC;AAGF,MAAM,YAAY,GAAqC;IACrD,IAAI,EAAE,2GAEH;IACH,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,yCAAiB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC;CAC9E,CAAA;AAQD,MAAM,cAAc,GAAmE;IACrF,aAAa;IACb,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,YAAY;CACJ,CAAC;AAGX,SAAS,eAAe,CAAC,QAAwB;IAC/C,OAAO,QAAQ,CAAC,IAAI,KAAK,UAAU;QAC/B,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,eAAe;YACjC,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,YAAY,CAAC;AACvB,CAAC;AAGD,eAAe,SAAS,CAAC","sourcesContent":["/** @jsx jsx */\n/** @jsxFrag React.Fragment */\n\nimport React, { useEffect, useRef, useContext, useState, useCallback, memo, useMemo } from 'react';\nimport { ClassNames, jsx, css } from '@emotion/react';\nimport {\n Card,\n ButtonGroup,\n Button,\n Classes,\n Colors,\n MenuItem, type MenuItemProps, type MenuDividerProps,\n type IconName,\n Tag,\n H5,\n} from '@blueprintjs/core';\nimport { type ItemRenderer, Select2 as Select } from '@blueprintjs/select';\nimport HelpTooltip from '@riboseinc/paneron-extension-kit/widgets/HelpTooltip';\nimport type {\n Addition,\n ChangeProposal,\n Clarification,\n InternalItemReference,\n Retirement,\n Supersession,\n Invalidation,\n Payload,\n RegisterItem,\n} from '../../types';\nimport ErrorBoundary from '@riboseinc/paneron-extension-kit/widgets/ErrorBoundary';\nimport ErrorState from '@riboseinc/paneron-extension-kit/widgets/ErrorState';\nimport type { Drafted } from '../../types/cr';\nimport { Protocols, type Protocol } from '../protocolRegistry';\nimport { PROPOSAL_TYPES, AMENDMENT_TYPES } from '../../types/proposal';\nimport { BrowserCtx, type BrowserCtx as BrowserCtxType } from '../BrowserCtx';\nimport { useItemRef, itemPathToItemRef } from '../itemPathUtils';\nimport useItemClassConfig from '../hooks/useItemClassConfig';\nimport { InlineDiffGeneric } from '../diffing/InlineDiff';\nimport { proposalToTagProps } from './util';\nimport { HomeBlockCard, HomeBlockActions } from '../detail/RegisterHome/Block';\nimport { ItemDetail } from '../detail/RegisterItem';\n\n\ninterface ChangeProposalItem {\n itemPath: string\n itemRef: InternalItemReference\n proposal: ChangeProposal\n item: RegisterItem<Payload> | null\n itemBefore: RegisterItem<Payload> | undefined\n}\nfunction stringifiedJSONEqual(i1: any, i2: any): boolean {\n return JSON.stringify(i1) === JSON.stringify(i2);\n}\n\n\ninterface ProposalBrowserProps<CR extends Drafted> {\n proposals: CR['items']\n /**\n * If provided, button to delete each proposed change\n * is shown in change card list mode.\n */\n onDeleteProposalForItemAtPath?: (itemPath: string) => void\n className?: string\n}\n/**\n * Shows a list of individual proposed changes as cards by default,\n * allowing to expand a proposal and view item details.\n *\n * If no proposals exist, returns null.\n */\nexport function Proposals<CR extends Drafted>\n({ proposals, onDeleteProposalForItemAtPath, className }: ProposalBrowserProps<CR>) {\n const [ selectedProposal, selectProposal ] = useState<string | null>(null);\n const [ preferDiff, setPreferDiff ] = useState(false);\n\n // TODO: Temporarily unsupported\n // (limitations of current change annotation implementation)\n //const [ showOnlyChanged, setShowOnlyChanged ] = useState(true);\n\n const outerBrowserCtx = useContext(BrowserCtx);\n const { jumpTo, subregisters, useRegisterItemData } = outerBrowserCtx;\n\n /**\n * When jumping to an item affected by current CR,\n * jump in-CR instead of spawning tab.\n */\n const handleCRJump = useCallback(function _handleCRJump(uri: `${Protocol}:${string}`): void {\n if (uri.startsWith(Protocols.ITEM_DETAILS)) {\n const itemPath = uri.split(':')[1];\n if (proposals[itemPath]) {\n selectProposal(itemPath);\n } else {\n jumpTo?.(uri);\n }\n }\n }, [Object.keys(proposals), jumpTo]);\n\n const proposalBrowserCtx: BrowserCtxType = useMemo((() => ({\n ...outerBrowserCtx,\n jumpTo: handleCRJump,\n })), [handleCRJump, outerBrowserCtx]);\n\n /** Paths of register items in proposal. */\n const proposedItemPaths = Object.entries(proposals).map(([itemPath, proposal]) => {\n if (proposal.type === 'clarification' || proposal.type === 'addition') {\n return itemPath;\n } else {\n return undefined;\n }\n }).filter(s => s !== undefined) as string[];\n\n /** Proposed data of register items in proposal. */\n const proposedItemDataReq = useRegisterItemData({\n itemPaths: proposedItemPaths,\n });\n\n /** Pre-existing data of register items in proposal. */\n const currentItemDataReq = useRegisterItemData({\n itemPaths: Object.keys(proposals),\n ignoreActiveCR: true,\n });\n\n const getCurrentItem = useCallback(\n ((itemPath: string) => currentItemDataReq.value[itemPath] ?? null),\n [currentItemDataReq.value]);\n const getProposedItem = useCallback(\n ((itemPath: string) => proposedItemDataReq.value[itemPath] ?? null),\n [proposedItemDataReq.value]);\n\n /** Current register item (if any) corresponding to selected proposal. */\n const selectedItemCurrent = selectedProposal ? getCurrentItem(selectedProposal) : null;\n\n /** Proposed register item corresponding to selected proposal. */\n const selectedItemProposed = selectedProposal ? getProposedItem(selectedProposal) : null;\n\n const selectedItemRef = useItemRef(subregisters !== undefined, selectedProposal);\n\n const handleItemSelect = useCallback(\n ((item: ChangeProposalItem) => selectProposal(item.itemPath)),\n [selectProposal]);\n\n const activeItem: ChangeProposalItem | null = useMemo((() =>\n selectedProposal\n ? ({\n itemPath: selectedProposal,\n proposal: proposals[selectedProposal],\n item: (selectedItemProposed ?? selectedItemCurrent)!,\n itemBefore: selectedItemCurrent ?? undefined,\n itemRef: itemPathToItemRef(subregisters !== undefined, selectedProposal),\n })\n : null\n ), [selectedProposal, proposals, subregisters]);\n\n const allItems: ChangeProposalItem[] = useMemo((() =>\n Object.entries(proposals).map(([itemPath, proposal]) => ({\n itemPath,\n proposal,\n item: (getProposedItem(itemPath) ?? getCurrentItem(itemPath))! ?? null,\n itemBefore: undefined,\n itemRef: itemPathToItemRef(subregisters !== undefined, itemPath),\n }))\n ), [proposals, getCurrentItem, getProposedItem]);\n\n const haveSelectedItem =\n selectedProposal\n && selectedItemRef\n && proposals[selectedProposal]\n && (selectedItemProposed || selectedItemCurrent);\n\n const proposalCount = Object.keys(proposals).length;\n\n const selectedProposalDetailRef = useRef<HTMLDivElement | null>(null);\n\n useEffect(() => {\n // if (!selectedProposal) {\n // const firstProposal = Object.keys(proposals)[0];\n // if (firstProposal) {\n // if (getCurrentItem(firstProposal) || getProposedItem(firstProposal)) {\n // selectProposal(firstProposal);\n // }\n // }\n // }\n if (selectedProposal) {\n if (selectedProposalDetailRef.current) {\n selectedProposalDetailRef.current.scrollIntoView({ block: 'center' });\n }\n }\n }, [selectedProposal === null]);\n\n const canShowDiff: boolean =\n haveSelectedItem && proposals[selectedProposal]?.type === 'clarification'\n ? true\n : false;\n const showDiff = canShowDiff && preferDiff;\n\n if (!currentItemDataReq.isUpdating && !proposedItemDataReq.isUpdating) {\n const selectedItemSummary = haveSelectedItem\n ? <ProposalSummary\n itemRef={selectedItemRef}\n item={(selectedItemProposed ?? selectedItemCurrent)!}\n itemBefore={selectedItemCurrent ?? undefined}\n proposal={proposals[selectedProposal]}\n />\n : <>Select item…</>;\n const icon = haveSelectedItem\n ? getProposalIcon(proposals[selectedProposal])\n : undefined;\n\n if (proposalCount > 0 && haveSelectedItem) {\n return (\n <Card\n key={selectedProposal}\n elevation={0}\n css={css`\n flex: 100%;\n background: ${Colors.LIGHT_GRAY3};\n padding: 0;\n min-height: 70vh;\n\n overflow: hidden;\n\n border-radius: 5px;\n display: flex;\n flex-flow: column nowrap;\n transition:\n width .5s linear\n height .5s linear;\n `}\n className={className}>\n <ButtonGroup>\n <Button\n disabled={!jumpTo || proposals[selectedProposal]?.type === 'addition'}\n icon='open-application'\n onClick={() => jumpTo?.(`${Protocols.ITEM_DETAILS}:${selectedProposal}`)}\n title=\"Open selected item in a new tab (not applicable to proposed additions)\"\n />\n <Button\n active={preferDiff}\n onClick={() => setPreferDiff(v => !v)}\n // Diffing only makes sense for clarifications.\n // Additions are entire new items, and for amendments\n // item data is unchanged.\n disabled={!canShowDiff}\n text=\"Compare\"\n title=\"Annotate proposed clarifications for this item\"\n />\n <ClassNames>\n {(({ css: css2 }) =>\n <Select<ChangeProposalItem>\n filterable={false}\n itemsEqual={stringifiedJSONEqual}\n menuProps={{ className: css2(`max-height: 50vh; overflow-y: auto;`) }}\n activeItem={activeItem}\n items={allItems}\n popoverProps={{ minimal: true, matchTargetWidth: true }}\n fill\n itemRenderer={ChangeProposalItemView}\n onItemSelect={handleItemSelect}>\n <Button fill rightIcon=\"chevron-down\" icon={icon} css={css`white-space: nowrap;`}>\n {selectedItemSummary}\n </Button>\n </Select>\n )}\n </ClassNames>\n <Button\n onClick={() => selectProposal(null)}\n icon=\"minimize\"\n title=\"Minimize proposed change view\"\n text=\"Minimize\"\n />\n </ButtonGroup>\n <div css={css`position: relative; flex: 1;`} ref={selectedProposalDetailRef}>\n <BrowserCtx.Provider value={proposalBrowserCtx}>\n <ErrorBoundary viewName=\"Proposal detail\">\n <ProposalDetail\n itemRef={selectedItemRef}\n showDiff={showDiff}\n //showOnlyChanged={showOnlyChanged}\n item={(selectedItemProposed ?? selectedItemCurrent)!}\n itemBefore={selectedItemCurrent ?? undefined}\n proposal={proposals[selectedProposal]}\n />\n </ErrorBoundary>\n </BrowserCtx.Provider>\n </div>\n </Card>\n );\n } else {\n return (\n <>\n {allItems.map(cpi => {\n const actions: (MenuItemProps | MenuDividerProps)[] = [{\n onClick: () => selectProposal(cpi.itemPath),\n text: \"Expand\",\n title: \"Expand proposed change to see item details\",\n icon: 'maximize',\n }];\n if (onDeleteProposalForItemAtPath) {\n actions.push({\n text: \"Delete this proposal\",\n intent: 'danger',\n onClick: () => onDeleteProposalForItemAtPath(cpi.itemPath),\n icon: 'trash',\n });\n }\n return <HomeBlockCard\n css={css`\n flex-basis: calc(33.33% - 10px*2/3);\n `}\n description={`${cpi.proposal.type} proposal`}\n key={cpi.itemPath}>\n <ProposalType item={cpi as any} />\n <div css={css`padding: 5px; flex-grow: 1;`}>\n {cpi.item !== null\n ? <H5 css={css`margin: 0; overflow: hidden; text-overflow: ellipsis;`}>\n <ProposalSummary\n itemRef={cpi.itemRef}\n proposal={cpi.proposal}\n itemBefore={cpi.itemBefore}\n item={cpi.item}\n />\n </H5>\n : <>Problem reading proposed item data.</>}\n </div>\n {actions.length > 0\n ? <HomeBlockActions actions={actions} />\n : null}\n </HomeBlockCard>\n })}\n </>\n );\n }\n } else {\n return null;\n }\n};\n\n\nfunction ProposalType({ item }: { item: ChangeProposalItem & { item: RegisterItem<any> } }) {\n const proposalConfig = \n item.proposal.type === 'amendment'\n ? PROPOSAL_VIEWS[item.proposal.amendmentType]\n : PROPOSAL_VIEWS[item.proposal.type];\n //const ProposalTypeLabel: React.FC<ProposalProps<any>> = proposalConfig.summary;\n const tagProps = proposalToTagProps(item.proposal);\n return (\n <Tag\n minimal\n {...tagProps}\n rightIcon={<HelpTooltip content={<>Proposed to be {proposalConfig.hint}</>} />}\n />\n \n );\n}\n\n\nconst ChangeProposalItemView: ItemRenderer<ChangeProposalItem> =\n(item, { handleClick, modifiers, query }) => {\n if (item.item !== null) {\n const i = item as ChangeProposalItem & { item: RegisterItem<any> };\n return (\n <MenuItem\n active={modifiers.active}\n disabled={modifiers.disabled}\n labelElement={<ProposalType item={i} />}\n key={item.itemPath}\n onClick={handleClick}\n icon={getProposalIcon(item.proposal)}\n text={<ProposalSummary {...i} />} />\n );\n } else {\n return <MenuItem\n disabled\n icon=\"heart-broken\"\n onClick={handleClick}\n text={`Broken proposal entry at path ${item.itemPath}`}\n />\n }\n};\n\n\ninterface ProposalProps<P extends ChangeProposal> {\n proposal: P\n\n /** Highlight changes. */\n showDiff?: boolean\n\n /** In diff mode, only show changed data. (Provisional.) */\n showOnlyChanged?: boolean\n\n itemRef: InternalItemReference\n item: RegisterItem<Payload>\n itemBefore: P extends Clarification ? RegisterItem<Payload> : undefined\n onChange?: (newProposal: P) => void\n}\nexport const ProposalDetail: React.FC<ProposalProps<ChangeProposal>> =\nmemo(function ({ proposal, showDiff, showOnlyChanged, itemRef, item, itemBefore, onChange }) {\n const itemClass = useItemClassConfig(itemRef.classID ?? 'NONEXISTENT_CLASS_ID');\n\n if (!itemClass) {\n throw new Error(`Unknown item class “${itemRef.classID}”!`);\n }\n\n const view: JSX.Element = showDiff\n ? <InlineDiffGeneric\n item1={itemBefore ?? {}}\n item2={item}\n css={css`\n position: absolute; inset: 0; padding: 10px; overflow: auto;\n background-color: white;\n .bp4-dark & {\n background-color: ${Colors.DARK_GRAY2};\n }\n `}\n className={`${Classes.ELEVATION_2} ${Classes.RUNNING_TEXT}`}\n />\n : <ItemDetail\n itemRef={itemRef}\n item={item}\n itemClass={itemClass}\n key={JSON.stringify(itemRef)}\n compactHeader\n />;\n\n return <div css={css`position: absolute; inset: 0; display: flex; flex-flow: column;`}>\n {view}\n </div>;\n});\nexport const ProposalSummary: React.FC<ProposalProps<ChangeProposal>> =\nfunction ({ proposal, itemRef, item, itemBefore, onChange }) {\n const { itemClasses } = useContext(BrowserCtx);\n const { classID } = itemRef;\n const cls = itemClasses[classID];\n const ListItemView = cls?.views?.listItemView;\n\n if (ListItemView) {\n return <>\n <ListItemView\n itemRef={itemRef}\n itemData={item.data}\n css={css`text-overflow: ellipsis; overflow: hidden;`}\n />\n  \n <small>{cls.meta.title}</small>\n </>;\n } else {\n return <ErrorState\n viewName=\"list item view\"\n inline\n error=\"unable to load list item view\"\n />;\n }\n};\n\n\ninterface ProposalViewConfig<P extends ChangeProposal> {\n summary: React.FC<ProposalProps<P>>\n hint: JSX.Element | string\n}\n\n\nconst clarification: ProposalViewConfig<Clarification> = {\n hint: <>\n altered to represent the same concept more clearly.\n </>,\n summary: memo(({ proposal, item, itemRef }) => <>Clarification</>, () => true),\n};\n\n\nconst addition: ProposalViewConfig<Addition> = {\n hint: <>added to this register.</>,\n summary: memo(({ proposal, item, itemRef }) => <>Addition</>, () => true),\n};\n\n\nconst retirement: ProposalViewConfig<Retirement> = {\n hint: <>\n marked as no longer current.\n (Note that this register is append-only, so the item cannot be removed altogether.)\n </>,\n summary: memo(({ proposal, itemRef, item }) => <>Retirement</>, () => true),\n};\n\n\nconst supersession: ProposalViewConfig<Supersession> = {\n hint: <>\n removed from the register with another item recommended for use in its place.\n A relation between the superseding and superseded item will be created,\n though the exact semantics of that relation depend on the register.\n </>,\n summary: memo(({ proposal, itemRef, item }) => <>Supersession</>, () => true),\n};\n\n\nconst invalidation: ProposalViewConfig<Invalidation> = {\n hint: <>\n marked as invalid. The exact semantics of invalidation depend on the register.\n </>,\n summary: memo(({ proposal, itemRef, item }) => <>Invalidation</>, () => true),\n}\n\n\ntype ProposalOrAmendmentType =\n | Exclude<typeof PROPOSAL_TYPES[number], 'amendment'>\n | typeof AMENDMENT_TYPES[number];\n\n\nconst PROPOSAL_VIEWS: { [type in ProposalOrAmendmentType]: ProposalViewConfig<any> } = {\n clarification,\n addition,\n retirement,\n supersession,\n invalidation,\n} as const;\n\n\nfunction getProposalIcon(proposal: ChangeProposal): IconName {\n return proposal.type === 'addition'\n ? 'add'\n : proposal.type === 'clarification'\n ? 'edit'\n : 'ban-circle';\n}\n\n\nexport default Proposals;\n"]}
|
|
1
|
+
{"version":3,"file":"Proposals.js","sourceRoot":"","sources":["../../../src/views/change-request/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IAC/C,OAAO,QAAQ,CAAC,IAAI,KAAK,UAAU;QAC/B,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,eAAe;YACjC,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,YAAY,CAAC;AACvB,CAAC;AAGD,eAAe,SAAS,CAAC","sourcesContent":["/** @jsx jsx */\n/** @jsxFrag React.Fragment */\n\nimport React, { useContext, useState, useCallback, memo, useMemo } from 'react';\nimport { ClassNames, jsx, css } from '@emotion/react';\nimport {\n ButtonGroup,\n Button,\n Drawer, DrawerSize,\n Classes,\n Colors,\n MenuItem, type MenuItemProps, type MenuDividerProps,\n type IconName,\n Tag,\n H5,\n} from '@blueprintjs/core';\nimport { type ItemRenderer, Select2 as Select } from '@blueprintjs/select';\nimport HelpTooltip from '@riboseinc/paneron-extension-kit/widgets/HelpTooltip';\nimport type {\n Addition,\n ChangeProposal,\n Clarification,\n InternalItemReference,\n Retirement,\n Supersession,\n Invalidation,\n Payload,\n RegisterItem,\n} from '../../types';\nimport ErrorBoundary from '@riboseinc/paneron-extension-kit/widgets/ErrorBoundary';\nimport ErrorState from '@riboseinc/paneron-extension-kit/widgets/ErrorState';\nimport type { Drafted } from '../../types/cr';\nimport { Protocols, type Protocol } from '../protocolRegistry';\nimport { PROPOSAL_TYPES, AMENDMENT_TYPES } from '../../types/proposal';\nimport { BrowserCtx, type BrowserCtx as BrowserCtxType } from '../BrowserCtx';\nimport { useItemRef, itemPathToItemRef } from '../itemPathUtils';\nimport useItemClassConfig from '../hooks/useItemClassConfig';\nimport { InlineDiffGeneric } from '../diffing/InlineDiff';\nimport { proposalToTagProps } from './util';\nimport { HomeBlockCard, HomeBlockActions } from '../detail/RegisterHome/Block';\nimport { ItemDetail } from '../detail/RegisterItem';\n\n\ninterface ChangeProposalItem {\n itemPath: string\n itemRef: InternalItemReference\n proposal: ChangeProposal\n item: RegisterItem<Payload> | null\n itemBefore: RegisterItem<Payload> | undefined\n}\nfunction stringifiedJSONEqual(i1: any, i2: any): boolean {\n return JSON.stringify(i1) === JSON.stringify(i2);\n}\n\n\ninterface ProposalBrowserProps<CR extends Drafted> {\n proposals: CR['items']\n\n selectedItem?: (string & keyof CR['items']) | null\n onSelectItem: (selectedItem: (string & keyof CR['items']) | null) => void\n\n /**\n * If provided, button to delete each proposed change\n * is shown in change card list mode.\n */\n onDeleteProposalForItemAtPath?: (itemPath: string) => void\n}\n/**\n * Shows a list of individual proposed changes as cards by default,\n * allowing to expand a proposal and view item details.\n *\n * If no proposals exist, returns null.\n */\nexport function Proposals<CR extends Drafted>\n({ proposals, onDeleteProposalForItemAtPath, selectedItem, onSelectItem: selectProposal }:\nProposalBrowserProps<CR>) {\n const [ preferDiff, setPreferDiff ] = useState(false);\n\n const selectedProposal = selectedItem ?? null;\n\n // TODO: Temporarily unsupported\n // (limitations of current change annotation implementation)\n //const [ showOnlyChanged, setShowOnlyChanged ] = useState(true);\n\n const outerBrowserCtx = useContext(BrowserCtx);\n const { jumpTo, subregisters, useRegisterItemData } = outerBrowserCtx;\n\n /**\n * When jumping to an item affected by current CR,\n * jump in-CR instead of spawning tab.\n */\n const handleCRJump = useCallback(function _handleCRJump(uri: `${Protocol}:${string}`): void {\n if (uri.startsWith(Protocols.ITEM_DETAILS)) {\n const itemPath = uri.split(':')[1];\n if (proposals[itemPath]) {\n selectProposal(itemPath);\n } else {\n jumpTo?.(uri);\n }\n }\n }, [Object.keys(proposals), jumpTo]);\n\n const proposalBrowserCtx: BrowserCtxType = useMemo((() => ({\n ...outerBrowserCtx,\n jumpTo: handleCRJump,\n })), [handleCRJump, outerBrowserCtx]);\n\n /** Paths of register items in proposal. */\n const proposedItemPaths = Object.entries(proposals).map(([itemPath, proposal]) => {\n if (proposal.type === 'clarification' || proposal.type === 'addition') {\n return itemPath;\n } else {\n return undefined;\n }\n }).filter(s => s !== undefined) as string[];\n\n /** Proposed data of register items in proposal. */\n const proposedItemDataReq = useRegisterItemData({\n itemPaths: proposedItemPaths,\n });\n\n /** Pre-existing data of register items in proposal. */\n const currentItemDataReq = useRegisterItemData({\n itemPaths: Object.keys(proposals),\n ignoreActiveCR: true,\n });\n\n const getCurrentItem = useCallback(\n ((itemPath: string) => currentItemDataReq.value[itemPath] ?? null),\n [currentItemDataReq.value]);\n const getProposedItem = useCallback(\n ((itemPath: string) => proposedItemDataReq.value[itemPath] ?? null),\n [proposedItemDataReq.value]);\n\n /** Current register item (if any) corresponding to selected proposal. */\n const selectedItemCurrent = selectedProposal ? getCurrentItem(selectedProposal) : null;\n\n /** Proposed register item corresponding to selected proposal. */\n const selectedItemProposed = selectedProposal ? getProposedItem(selectedProposal) : null;\n\n const selectedItemRef = useItemRef(subregisters !== undefined, selectedProposal);\n\n const handleItemSelect = useCallback(\n ((item: ChangeProposalItem) => selectProposal(item.itemPath)),\n [selectProposal]);\n\n const activeItem: ChangeProposalItem | null = useMemo((() =>\n selectedProposal\n ? ({\n itemPath: selectedProposal,\n proposal: proposals[selectedProposal],\n item: (selectedItemProposed ?? selectedItemCurrent)!,\n itemBefore: selectedItemCurrent ?? undefined,\n itemRef: itemPathToItemRef(subregisters !== undefined, selectedProposal),\n })\n : null\n ), [selectedProposal, proposals, subregisters]);\n\n const allItems: ChangeProposalItem[] = useMemo((() =>\n Object.entries(proposals).map(([itemPath, proposal]) => ({\n itemPath,\n proposal,\n item: (getProposedItem(itemPath) ?? getCurrentItem(itemPath))! ?? null,\n itemBefore: undefined,\n itemRef: itemPathToItemRef(subregisters !== undefined, itemPath),\n }))\n ), [proposals, getCurrentItem, getProposedItem]);\n\n const haveSelectedItem =\n selectedProposal\n && selectedItemRef\n && proposals[selectedProposal]\n && (selectedItemProposed || selectedItemCurrent);\n\n const proposalCount = Object.keys(proposals).length;\n\n //useEffect(() => {\n // // if (!selectedProposal) {\n // // const firstProposal = Object.keys(proposals)[0];\n // // if (firstProposal) {\n // // if (getCurrentItem(firstProposal) || getProposedItem(firstProposal)) {\n // // selectProposal(firstProposal);\n // // }\n // // }\n // // }\n // if (selectedProposal) {\n // if (selectedProposalDetailRef.current) {\n // selectedProposalDetailRef.current.scrollIntoView({ block: 'center' });\n // }\n // }\n //}, [selectedProposal === null]);\n\n const canShowDiff: boolean =\n haveSelectedItem && proposals[selectedProposal]?.type === 'clarification'\n ? true\n : false;\n const showDiff = canShowDiff && preferDiff;\n\n const selectedItemSummary = haveSelectedItem\n ? <ProposalSummary\n itemRef={selectedItemRef}\n item={(selectedItemProposed ?? selectedItemCurrent)!}\n itemBefore={selectedItemCurrent ?? undefined}\n proposal={proposals[selectedProposal]}\n />\n : <>Select item…</>;\n const icon = haveSelectedItem\n ? getProposalIcon(proposals[selectedProposal])\n : undefined;\n\n const selectedItemDrawer = useMemo((() =>\n <Drawer\n isOpen={proposalCount > 0 && haveSelectedItem ? true : false}\n onClose={() => selectProposal(null)}\n size={DrawerSize.LARGE}\n enforceFocus={false}>\n {proposalCount > 0 && haveSelectedItem\n ? <>\n <ButtonGroup>\n <Button\n disabled={!jumpTo || proposals[selectedProposal]?.type === 'addition'}\n icon='open-application'\n onClick={() => jumpTo?.(`${Protocols.ITEM_DETAILS}:${selectedProposal}`)}\n title=\"Open selected item in a new tab (not applicable to proposed additions)\"\n />\n <Button\n active={preferDiff}\n onClick={() => setPreferDiff(v => !v)}\n // Diffing only makes sense for clarifications.\n // Additions are entire new items, and for amendments\n // item data is unchanged.\n disabled={!canShowDiff}\n text=\"Compare\"\n title=\"Annotate proposed clarifications for this item\"\n />\n <ClassNames>\n {(({ css: css2 }) =>\n <Select<ChangeProposalItem>\n filterable={false}\n itemsEqual={stringifiedJSONEqual}\n menuProps={{ className: css2(`max-height: 50vh; overflow-y: auto;`) }}\n activeItem={activeItem}\n items={allItems}\n popoverProps={{ minimal: true, matchTargetWidth: true }}\n fill\n itemRenderer={ChangeProposalItemView}\n onItemSelect={handleItemSelect}>\n <Button fill rightIcon=\"chevron-down\" icon={icon} css={css`white-space: nowrap;`}>\n {selectedItemSummary}\n </Button>\n </Select>\n )}\n </ClassNames>\n <Button\n onClick={() => selectProposal(null)}\n icon=\"minimize\"\n title=\"Minimize proposed change view\"\n text=\"Minimize\"\n />\n </ButtonGroup>\n <div css={css`position: relative; flex: 1;`}>\n <BrowserCtx.Provider value={proposalBrowserCtx}>\n <ErrorBoundary viewName=\"Proposal detail\">\n <ProposalDetail\n itemRef={selectedItemRef}\n showDiff={showDiff}\n //showOnlyChanged={showOnlyChanged}\n item={(selectedItemProposed ?? selectedItemCurrent)!}\n itemBefore={selectedItemCurrent ?? undefined}\n proposal={proposals[selectedProposal]}\n />\n </ErrorBoundary>\n </BrowserCtx.Provider>\n </div>\n </>\n : null}\n </Drawer>\n ), [proposalCount > 0, haveSelectedItem, selectedItemProposed, selectedItemCurrent, preferDiff, jumpTo, handleItemSelect, selectedProposal && proposals[selectedProposal]]);\n\n return (\n <>\n {selectedItemDrawer}\n {allItems.map(cpi => {\n const actions: (MenuItemProps | MenuDividerProps)[] = [{\n onClick: () => selectProposal(cpi.itemPath),\n text: \"Expand\",\n title: \"Expand proposed change to see item details\",\n icon: 'maximize',\n }];\n if (onDeleteProposalForItemAtPath) {\n actions.push({\n text: \"Delete this proposal\",\n intent: 'danger',\n onClick: () => onDeleteProposalForItemAtPath(cpi.itemPath),\n icon: 'trash',\n });\n }\n return <HomeBlockCard\n css={css`\n flex-basis: calc(33.33% - 10px*2/3);\n `}\n description={`${cpi.proposal.type} proposal`}\n key={cpi.itemPath}>\n <ProposalType item={cpi as any} />\n <div css={css`padding: 5px; flex-grow: 1;`}>\n {cpi.item !== null\n ? <H5 css={css`margin: 0; overflow: hidden; text-overflow: ellipsis;`}>\n <ProposalSummary\n itemRef={cpi.itemRef}\n proposal={cpi.proposal}\n itemBefore={cpi.itemBefore}\n item={cpi.item}\n />\n </H5>\n : <>Problem reading proposed item data.</>}\n </div>\n {actions.length > 0\n ? <HomeBlockActions actions={actions} />\n : null}\n </HomeBlockCard>\n })}\n </>\n );\n};\n\n\nfunction ProposalType({ item }: { item: ChangeProposalItem & { item: RegisterItem<any> } }) {\n const proposalConfig = \n item.proposal.type === 'amendment'\n ? PROPOSAL_VIEWS[item.proposal.amendmentType]\n : PROPOSAL_VIEWS[item.proposal.type];\n //const ProposalTypeLabel: React.FC<ProposalProps<any>> = proposalConfig.summary;\n const tagProps = proposalToTagProps(item.proposal);\n return (\n <Tag\n minimal\n {...tagProps}\n rightIcon={<HelpTooltip content={<>Proposed to be {proposalConfig.hint}</>} />}\n />\n \n );\n}\n\n\nconst ChangeProposalItemView: ItemRenderer<ChangeProposalItem> =\n(item, { handleClick, modifiers, query }) => {\n if (item.item !== null) {\n const i = item as ChangeProposalItem & { item: RegisterItem<any> };\n return (\n <MenuItem\n active={modifiers.active}\n disabled={modifiers.disabled}\n labelElement={<ProposalType item={i} />}\n key={item.itemPath}\n onClick={handleClick}\n icon={getProposalIcon(item.proposal)}\n text={<ProposalSummary {...i} />} />\n );\n } else {\n return <MenuItem\n disabled\n icon=\"heart-broken\"\n onClick={handleClick}\n text={`Broken proposal entry at path ${item.itemPath}`}\n />\n }\n};\n\n\ninterface ProposalProps<P extends ChangeProposal> {\n proposal: P\n\n /** Highlight changes. */\n showDiff?: boolean\n\n /** In diff mode, only show changed data. (Provisional.) */\n showOnlyChanged?: boolean\n\n itemRef: InternalItemReference\n item: RegisterItem<Payload>\n itemBefore: P extends Clarification ? RegisterItem<Payload> : undefined\n onChange?: (newProposal: P) => void\n}\nexport const ProposalDetail: React.FC<ProposalProps<ChangeProposal>> =\nmemo(function ({ proposal, showDiff, showOnlyChanged, itemRef, item, itemBefore, onChange }) {\n const itemClass = useItemClassConfig(itemRef.classID ?? 'NONEXISTENT_CLASS_ID');\n\n if (!itemClass) {\n throw new Error(`Unknown item class “${itemRef.classID}”!`);\n }\n\n const view: JSX.Element = showDiff\n ? <InlineDiffGeneric\n item1={itemBefore ?? {}}\n item2={item}\n css={css`\n position: absolute; inset: 0; padding: 10px; overflow: auto;\n background-color: white;\n .bp4-dark & {\n background-color: ${Colors.DARK_GRAY2};\n }\n `}\n className={`${Classes.ELEVATION_2} ${Classes.RUNNING_TEXT}`}\n />\n : <ItemDetail\n itemRef={itemRef}\n item={item}\n itemClass={itemClass}\n key={JSON.stringify(itemRef)}\n compactHeader\n />;\n\n return <div css={css`position: absolute; inset: 0; display: flex; flex-flow: column;`}>\n {view}\n </div>;\n});\nexport const ProposalSummary: React.FC<ProposalProps<ChangeProposal>> =\nfunction ({ proposal, itemRef, item, itemBefore, onChange }) {\n const { itemClasses } = useContext(BrowserCtx);\n const { classID } = itemRef;\n const cls = itemClasses[classID];\n const ListItemView = cls?.views?.listItemView;\n\n if (ListItemView) {\n return <>\n <ListItemView\n itemRef={itemRef}\n itemData={item.data}\n css={css`text-overflow: ellipsis; overflow: hidden;`}\n />\n  \n <small>{cls.meta.title}</small>\n </>;\n } else {\n return <ErrorState\n viewName=\"list item view\"\n inline\n error=\"unable to load list item view\"\n />;\n }\n};\n\n\ninterface ProposalViewConfig<P extends ChangeProposal> {\n summary: React.FC<ProposalProps<P>>\n hint: JSX.Element | string\n}\n\n\nconst clarification: ProposalViewConfig<Clarification> = {\n hint: <>\n altered to represent the same concept more clearly.\n </>,\n summary: memo(({ proposal, item, itemRef }) => <>Clarification</>, () => true),\n};\n\n\nconst addition: ProposalViewConfig<Addition> = {\n hint: <>added to this register.</>,\n summary: memo(({ proposal, item, itemRef }) => <>Addition</>, () => true),\n};\n\n\nconst retirement: ProposalViewConfig<Retirement> = {\n hint: <>\n marked as no longer current.\n (Note that this register is append-only, so the item cannot be removed altogether.)\n </>,\n summary: memo(({ proposal, itemRef, item }) => <>Retirement</>, () => true),\n};\n\n\nconst supersession: ProposalViewConfig<Supersession> = {\n hint: <>\n removed from the register with another item recommended for use in its place.\n A relation between the superseding and superseded item will be created,\n though the exact semantics of that relation depend on the register.\n </>,\n summary: memo(({ proposal, itemRef, item }) => <>Supersession</>, () => true),\n};\n\n\nconst invalidation: ProposalViewConfig<Invalidation> = {\n hint: <>\n marked as invalid. The exact semantics of invalidation depend on the register.\n </>,\n summary: memo(({ proposal, itemRef, item }) => <>Invalidation</>, () => true),\n}\n\n\ntype ProposalOrAmendmentType =\n | Exclude<typeof PROPOSAL_TYPES[number], 'amendment'>\n | typeof AMENDMENT_TYPES[number];\n\n\nconst PROPOSAL_VIEWS: { [type in ProposalOrAmendmentType]: ProposalViewConfig<any> } = {\n clarification,\n addition,\n retirement,\n supersession,\n invalidation,\n} as const;\n\n\nfunction getProposalIcon(proposal: ChangeProposal): IconName {\n return proposal.type === 'addition'\n ? 'add'\n : proposal.type === 'clarification'\n ? 'edit'\n : 'ban-circle';\n}\n\n\nexport default Proposals;\n"]}
|
|
@@ -121,8 +121,11 @@ const ChangeRequestDetails = (0, _react.memo)(function ({
|
|
|
121
121
|
const anotherIsActive = activeChangeRequestID && activeChangeRequestID !== cr.id;
|
|
122
122
|
const crItemEntries = Object.entries(cr.items).map(i => JSON.stringify(i));
|
|
123
123
|
const hasItems = crItemEntries.length > 0;
|
|
124
|
+
const [selectedProposal, selectProposal] = (0, _react.useState)(null);
|
|
124
125
|
const proposals = (0, _react.useMemo)(() => hasItems ? (0, _react2.jsx)(_Proposals.default, {
|
|
125
126
|
proposals: cr.items,
|
|
127
|
+
selectedItem: selectedProposal,
|
|
128
|
+
onSelectItem: selectProposal,
|
|
126
129
|
onDeleteProposalForItemAtPath: onDeleteProposalForItemAtPath
|
|
127
130
|
}) : (0, _react2.jsx)(_core.NonIdealState, {
|
|
128
131
|
icon: "clean",
|
|
@@ -130,7 +133,7 @@ const ChangeRequestDetails = (0, _react.memo)(function ({
|
|
|
130
133
|
description: onDelete ? (0, _react2.jsx)(_core.Button, {
|
|
131
134
|
onClick: onDelete
|
|
132
135
|
}, "Delete this CR draft") : undefined
|
|
133
|
-
}), [onDelete, onDeleteProposalForItemAtPath, hasItems]);
|
|
136
|
+
}), [onDelete, onDeleteProposalForItemAtPath, selectedProposal, selectProposal, hasItems]);
|
|
134
137
|
const classification = (0, _react.useMemo)(() => {
|
|
135
138
|
var _a;
|
|
136
139
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/views/detail/ChangeRequest/index.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,8BAA8B;AAE9B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,MAAM,EACN,IAAI,EACJ,aAAa,EACb,OAAO,EACP,EAAE,GACH,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,2CAA2C,CAAC;AACnD,OAAO,SAAS,MAAM,gCAAgC,CAAC;AACvD,OAAO,iBAAiB,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACzG,OAAO,oBAAoB,EAAE,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,EAAe,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EACL,qBAAqB,EAErB,cAAc,IAAI,MAAM,EACxB,oBAAoB,EACpB,SAAS,GACV,MAAM,YAAY,CAAC;AAGpB,MA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AiB,IAChB,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,EAC/D,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,EAAE,GACN,CACG;YACT,CAAC,CAAC,IAAI,CACc,CACzB,CAAC;AACJ,CAAC,CAAC,CAAC;AAGH,MAAM,OAAO,GAA8B,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE;;IAC/D,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IACrD,MAAM,aAAa,GAAG,MAAA,MAAA,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,0CAAG,GAAG,CAAC,0CAAE,aAAa,CAAC;IAC7F,OAAO;;QAAa,oBAAoB,CAAC,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,GAAG,CAAC;iBAAK,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC","sourcesContent":["/** @jsx jsx */\n/** @jsxFrag React.Fragment */\n\nimport React, { useContext, useMemo, memo, useCallback } from 'react';\nimport { jsx, css } from '@emotion/react';\nimport {\n Button,\n Card,\n NonIdealState,\n Spinner,\n UL,\n} from '@blueprintjs/core';\nimport { DatasetContext } from '@riboseinc/paneron-extension-kit/context';\nimport { TabbedWorkspaceContext } from '@riboseinc/paneron-extension-kit/widgets/TabbedWorkspace/context';\nimport { toJSONNormalized } from '@riboseinc/paneron-extension-kit/util';\nimport DL from '@riboseinc/paneron-extension-kit/widgets/DL';\nimport { BrowserCtx } from '../../BrowserCtx';\nimport { crPathToCRID } from '../../itemPathUtils';\nimport {\n ChangeRequestContextProvider,\n ChangeRequestContext,\n} from '../../change-request/ChangeRequestContext';\nimport Proposals from '../../change-request/Proposals';\nimport TransitionOptions, { isFinalState, getTransitions } from '../../change-request/TransitionOptions';\nimport TransitionsAndStatus, { getTransitionHistory } from '../../change-request/TransitionHistory';\nimport Summary from '../../change-request/Summary';\nimport { type SomeCR, hadBeenProposed, isDisposed } from '../../../types/cr';\nimport { Protocols } from '../../protocolRegistry';\nimport {\n TabContentsWithHeader,\n type TabContentsWithHeaderProps,\n RegisterHelmet as Helmet,\n maybeEllipsizeString,\n Datestamp,\n} from '../../util';\n\n\nconst View: React.VoidFunctionComponent<{ uri: string }> =\nmemo(function ({ uri }) {\n const crID = crPathToCRID(uri);\n return (\n <ChangeRequestContextProvider changeRequestID={crID}>\n <MaybeChangeRequest uri={uri} />\n </ChangeRequestContextProvider>\n );\n});\n\n\nconst MaybeChangeRequest: React.VoidFunctionComponent<{ uri: string }> =\nmemo(function ({ uri }) {\n const { closeTabWithURI } = useContext(TabbedWorkspaceContext);\n const {\n changeRequest: cr,\n canTransition,\n deleteCR,\n updateItemProposal,\n } = useContext(ChangeRequestContext);\n\n const handleDelete = useCallback(\n (async () => {\n if (deleteCR) {\n await deleteCR();\n closeTabWithURI(`${Protocols.CHANGE_REQUEST}:${uri}`);\n }\n }),\n [deleteCR, closeTabWithURI]);\n\n const handleDeleteProposalAtItemPath = useCallback(\n async function handleDeleteProposalAtItemPath(itemPath: string) {\n return await updateItemProposal?.(\"remove proposed change from proposal draft\", null, itemPath);\n },\n [updateItemProposal],\n );\n\n return (cr\n ? <ChangeRequestDetails\n cr={cr}\n canTransition={canTransition}\n onDelete={deleteCR\n ? handleDelete\n : undefined}\n onDeleteProposalForItemAtPath={updateItemProposal\n ? handleDeleteProposalAtItemPath\n : undefined}\n css={css`\n position: absolute;\n inset: 0;\n overflow-y: auto;\n `}\n />\n : <NonIdealState\n icon={<Spinner />}\n css={css`\n position: absolute;\n inset: 0;\n overflow-y: auto;\n `}\n description={\"Unable to load proposal\"}\n />\n );\n});\n\n\nconst ChangeRequestDetails: React.VoidFunctionComponent<{\n cr: SomeCR,\n canTransition: boolean,\n onDelete?: () => void,\n onDeleteProposalForItemAtPath?: (itemPath: string) => void,\n className?: string,\n}> = memo(function ({ cr, canTransition, onDelete, onDeleteProposalForItemAtPath, className }) {\n const {\n activeChangeRequestID,\n setActiveChangeRequestID,\n stakeholder,\n registerMetadata,\n } = useContext(BrowserCtx);\n\n const helmet = useMemo((() =>\n <Helmet>\n <title>Viewing proposal: {cr.justification ?? \"N/A\"}</title>\n </Helmet>\n ), [cr.justification]);\n\n const isActive = activeChangeRequestID === cr.id;\n const anotherIsActive = activeChangeRequestID && activeChangeRequestID !== cr.id;\n\n const crItemEntries = Object.entries(cr.items).map(i => JSON.stringify(i));\n const hasItems = crItemEntries.length > 0;\n\n const proposals = useMemo((() =>\n hasItems\n ? <Proposals\n proposals={cr.items}\n onDeleteProposalForItemAtPath={onDeleteProposalForItemAtPath}\n />\n : <NonIdealState\n icon=\"clean\"\n title=\"Nothing is proposed here yet.\"\n description={onDelete\n ? <Button onClick={onDelete}>\n Delete this CR draft\n </Button>\n : undefined}\n />\n ), [onDelete, onDeleteProposalForItemAtPath, hasItems]);\n\n const classification = useMemo(() => {\n const classification: TabContentsWithHeaderProps[\"classification\"] = [];\n classification.push({\n icon: 'lightbulb',\n children: \"Proposal\",\n tooltip: {\n icon: 'info-sign',\n content: <UL css={css`margin: 0;`}><li>Proposal ID: {cr.id}</li></UL>,\n },\n });\n classification.push({\n children: cr.state?.replaceAll('-', ' ') || 'N/A',\n tooltip: {\n icon: 'history',\n content: <UL css={css`margin: 0;`}>\n <li>Edited: <Datestamp date={cr.timeEdited} /></li>\n <li>Proposed: {hadBeenProposed(cr) ? <Datestamp date={cr.timeProposed} /> : 'not yet'}</li>\n <li>Disposed: {isDisposed(cr) ? <Datestamp date={cr.timeDisposed} /> : 'not yet'}</li>\n </UL>,\n },\n intent: cr.state === 'accepted'\n ? 'success'\n : cr.state === 'returned-for-clarification'\n ? 'warning'\n : cr.state === 'withdrawn' || cr.state === 'rejected'\n ? 'danger'\n : cr.state === 'draft'\n ? undefined\n : 'primary',\n });\n return classification;\n }, [toJSONNormalized(cr)]);\n\n const actions = useMemo(() => {\n const actions: TabContentsWithHeaderProps[\"actions\"] = [];\n const handleChangeActiveStatus = !anotherIsActive && setActiveChangeRequestID\n ? ((active: boolean) => active\n ? setActiveChangeRequestID?.(cr.id)\n : setActiveChangeRequestID?.(null)\n )\n : undefined;\n //const htmlTitle = anotherIsActive\n // ? \"You are in another proposal so you can’t enter this one. \"\n // : canEdit && !isActive\n // ? \"Enter proposal to preview or add to proposed changes. \"\n // : !isActive\n // ? \"Enter proposal to preview the register as proposed.\"\n // : \"You’re previewing the register with this proposal applied.\"\n if (handleChangeActiveStatus && isActive) {\n actions.push({\n children: \"Exit proposal\",\n intent: 'warning',\n disabled: !handleChangeActiveStatus,\n onClick: () => handleChangeActiveStatus?.(false)\n //title: htmlTitle,\n });\n } else {\n actions.push({\n children: \"Work on this proposal\",\n intent: 'primary',\n disabled: !handleChangeActiveStatus,\n onClick: () => handleChangeActiveStatus?.(true)\n //title: htmlTitle,\n });\n }\n return actions;\n }, [isActive, anotherIsActive]);\n\n return (\n <TabContentsWithHeader\n className={className}\n title={maybeEllipsizeString(cr.justification, 70)}\n classification={classification}\n layout=\"card-grid\"\n layoutOptions={{ stretch: true }}\n actions={actions}>\n\n {helmet}\n\n {proposals}\n\n <Card elevation={1} css={css`flex: 100%; padding: 11px;`}>\n <DL>\n <Summary\n cr={cr}\n currentStakeholder={stakeholder}\n registerMetadata={registerMetadata ?? undefined}\n />\n </DL>\n </Card>\n\n <Card elevation={1} css={css`flex: calc(50% - 10px); flex-grow: 1; padding: 11px;`}>\n <TransitionsAndStatus\n pastTransitions={getTransitionHistory(cr)}\n isFinal={isFinalState(cr.state)}\n />\n </Card>\n\n {canTransition\n ? <Card elevation={3} css={css`flex: calc(50% - 10px); flex-grow: 1; padding: 11px;`}>\n <TransitionOptions\n transitions={stakeholder ? getTransitions(cr, stakeholder) : []}\n stakeholder={stakeholder}\n cr={cr}\n />\n </Card>\n : null}\n </TabContentsWithHeader>\n );\n});\n\n\nconst CRTitle: React.FC<{ uri: string }> = memo(function ({ uri }) {\n const { useObjectData } = useContext(DatasetContext);\n const justification = useObjectData({ objectPaths: [uri] }).value.data?.[uri]?.justification;\n return <>Proposal “{maybeEllipsizeString(justification ?? uri)}”</>;\n});\n\nexport default { main: View, title: CRTitle };\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/views/detail/ChangeRequest/index.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,8BAA8B;AAE9B,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EACL,MAAM,EACN,IAAI,EACJ,aAAa,EACb,OAAO,EACP,EAAE,GACH,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,MAAM,6CAA6C,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,2CAA2C,CAAC;AACnD,OAAO,SAAS,MAAM,gCAAgC,CAAC;AACvD,OAAO,iBAAiB,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACzG,OAAO,oBAAoB,EAAE,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,OAAO,MAAM,8BAA8B,CAAC;AACnD,OAAO,EAAe,eAAe,EAAE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,SAAS,GAC/C,CACC,CACA;QAEP,IAAC,IAAI,IAAC,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAA,sDAAsD;YAChF,IAAC,oBAAoB,IACnB,eAAe,EAAE,oBAAoB,CAAC,EAAE,CAAC,EACzC,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,GAC/B,CACG;QAEN,aAAa;YACZ,CAAC,CAAC,IAAC,IAAI,IAAC,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAA,sDAAsD;gBAChF,IAAC,iBAAiB,IAChB,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,EAC/D,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,EAAE,GACN,CACG;YACT,CAAC,CAAC,IAAI,CACc,CACzB,CAAC;AACJ,CAAC,CAAC,CAAC;AAGH,MAAM,OAAO,GAA8B,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE;;IAC/D,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IACrD,MAAM,aAAa,GAAG,MAAA,MAAA,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,0CAAG,GAAG,CAAC,0CAAE,aAAa,CAAC;IAC7F,OAAO;;QAAa,oBAAoB,CAAC,aAAa,aAAb,aAAa,cAAb,aAAa,GAAI,GAAG,CAAC;iBAAK,CAAC;AACtE,CAAC,CAAC,CAAC;AAEH,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC","sourcesContent":["/** @jsx jsx */\n/** @jsxFrag React.Fragment */\n\nimport React, { useState, useContext, useMemo, memo, useCallback } from 'react';\nimport { jsx, css } from '@emotion/react';\nimport {\n Button,\n Card,\n NonIdealState,\n Spinner,\n UL,\n} from '@blueprintjs/core';\nimport { DatasetContext } from '@riboseinc/paneron-extension-kit/context';\nimport { TabbedWorkspaceContext } from '@riboseinc/paneron-extension-kit/widgets/TabbedWorkspace/context';\nimport { toJSONNormalized } from '@riboseinc/paneron-extension-kit/util';\nimport DL from '@riboseinc/paneron-extension-kit/widgets/DL';\nimport { BrowserCtx } from '../../BrowserCtx';\nimport { crPathToCRID } from '../../itemPathUtils';\nimport {\n ChangeRequestContextProvider,\n ChangeRequestContext,\n} from '../../change-request/ChangeRequestContext';\nimport Proposals from '../../change-request/Proposals';\nimport TransitionOptions, { isFinalState, getTransitions } from '../../change-request/TransitionOptions';\nimport TransitionsAndStatus, { getTransitionHistory } from '../../change-request/TransitionHistory';\nimport Summary from '../../change-request/Summary';\nimport { type SomeCR, hadBeenProposed, isDisposed } from '../../../types/cr';\nimport { Protocols } from '../../protocolRegistry';\nimport {\n TabContentsWithHeader,\n type TabContentsWithHeaderProps,\n RegisterHelmet as Helmet,\n maybeEllipsizeString,\n Datestamp,\n} from '../../util';\n\n\nconst View: React.VoidFunctionComponent<{ uri: string }> =\nmemo(function ({ uri }) {\n const crID = crPathToCRID(uri);\n return (\n <ChangeRequestContextProvider changeRequestID={crID}>\n <MaybeChangeRequest uri={uri} />\n </ChangeRequestContextProvider>\n );\n});\n\n\nconst MaybeChangeRequest: React.VoidFunctionComponent<{ uri: string }> =\nmemo(function ({ uri }) {\n const { closeTabWithURI } = useContext(TabbedWorkspaceContext);\n const {\n changeRequest: cr,\n canTransition,\n deleteCR,\n updateItemProposal,\n } = useContext(ChangeRequestContext);\n\n const handleDelete = useCallback(\n (async () => {\n if (deleteCR) {\n await deleteCR();\n closeTabWithURI(`${Protocols.CHANGE_REQUEST}:${uri}`);\n }\n }),\n [deleteCR, closeTabWithURI]);\n\n const handleDeleteProposalAtItemPath = useCallback(\n async function handleDeleteProposalAtItemPath(itemPath: string) {\n return await updateItemProposal?.(\"remove proposed change from proposal draft\", null, itemPath);\n },\n [updateItemProposal],\n );\n\n return (cr\n ? <ChangeRequestDetails\n cr={cr}\n canTransition={canTransition}\n onDelete={deleteCR\n ? handleDelete\n : undefined}\n onDeleteProposalForItemAtPath={updateItemProposal\n ? handleDeleteProposalAtItemPath\n : undefined}\n css={css`\n position: absolute;\n inset: 0;\n overflow-y: auto;\n `}\n />\n : <NonIdealState\n icon={<Spinner />}\n css={css`\n position: absolute;\n inset: 0;\n overflow-y: auto;\n `}\n description={\"Unable to load proposal\"}\n />\n );\n});\n\n\nconst ChangeRequestDetails: React.VoidFunctionComponent<{\n cr: SomeCR,\n canTransition: boolean,\n onDelete?: () => void,\n onDeleteProposalForItemAtPath?: (itemPath: string) => void,\n className?: string,\n}> = memo(function ({ cr, canTransition, onDelete, onDeleteProposalForItemAtPath, className }) {\n const {\n activeChangeRequestID,\n setActiveChangeRequestID,\n stakeholder,\n registerMetadata,\n } = useContext(BrowserCtx);\n\n const helmet = useMemo((() =>\n <Helmet>\n <title>Viewing proposal: {cr.justification ?? \"N/A\"}</title>\n </Helmet>\n ), [cr.justification]);\n\n const isActive = activeChangeRequestID === cr.id;\n const anotherIsActive = activeChangeRequestID && activeChangeRequestID !== cr.id;\n\n const crItemEntries = Object.entries(cr.items).map(i => JSON.stringify(i));\n const hasItems = crItemEntries.length > 0;\n\n const [selectedProposal, selectProposal] = useState<string | null>(null);\n const proposals = useMemo((() =>\n hasItems\n ? <Proposals\n proposals={cr.items}\n selectedItem={selectedProposal}\n onSelectItem={selectProposal}\n onDeleteProposalForItemAtPath={onDeleteProposalForItemAtPath}\n />\n : <NonIdealState\n icon=\"clean\"\n title=\"Nothing is proposed here yet.\"\n description={onDelete\n ? <Button onClick={onDelete}>\n Delete this CR draft\n </Button>\n : undefined}\n />\n ), [onDelete, onDeleteProposalForItemAtPath, selectedProposal, selectProposal, hasItems]);\n\n const classification = useMemo(() => {\n const classification: TabContentsWithHeaderProps[\"classification\"] = [];\n classification.push({\n icon: 'lightbulb',\n children: \"Proposal\",\n tooltip: {\n icon: 'info-sign',\n content: <UL css={css`margin: 0;`}><li>Proposal ID: {cr.id}</li></UL>,\n },\n });\n classification.push({\n children: cr.state?.replaceAll('-', ' ') || 'N/A',\n tooltip: {\n icon: 'history',\n content: <UL css={css`margin: 0;`}>\n <li>Edited: <Datestamp date={cr.timeEdited} /></li>\n <li>Proposed: {hadBeenProposed(cr) ? <Datestamp date={cr.timeProposed} /> : 'not yet'}</li>\n <li>Disposed: {isDisposed(cr) ? <Datestamp date={cr.timeDisposed} /> : 'not yet'}</li>\n </UL>,\n },\n intent: cr.state === 'accepted'\n ? 'success'\n : cr.state === 'returned-for-clarification'\n ? 'warning'\n : cr.state === 'withdrawn' || cr.state === 'rejected'\n ? 'danger'\n : cr.state === 'draft'\n ? undefined\n : 'primary',\n });\n return classification;\n }, [toJSONNormalized(cr)]);\n\n const actions = useMemo(() => {\n const actions: TabContentsWithHeaderProps[\"actions\"] = [];\n const handleChangeActiveStatus = !anotherIsActive && setActiveChangeRequestID\n ? ((active: boolean) => active\n ? setActiveChangeRequestID?.(cr.id)\n : setActiveChangeRequestID?.(null)\n )\n : undefined;\n //const htmlTitle = anotherIsActive\n // ? \"You are in another proposal so you can’t enter this one. \"\n // : canEdit && !isActive\n // ? \"Enter proposal to preview or add to proposed changes. \"\n // : !isActive\n // ? \"Enter proposal to preview the register as proposed.\"\n // : \"You’re previewing the register with this proposal applied.\"\n if (handleChangeActiveStatus && isActive) {\n actions.push({\n children: \"Exit proposal\",\n intent: 'warning',\n disabled: !handleChangeActiveStatus,\n onClick: () => handleChangeActiveStatus?.(false)\n //title: htmlTitle,\n });\n } else {\n actions.push({\n children: \"Work on this proposal\",\n intent: 'primary',\n disabled: !handleChangeActiveStatus,\n onClick: () => handleChangeActiveStatus?.(true)\n //title: htmlTitle,\n });\n }\n return actions;\n }, [isActive, anotherIsActive]);\n\n return (\n <TabContentsWithHeader\n className={className}\n title={maybeEllipsizeString(cr.justification, 70)}\n classification={classification}\n layout=\"card-grid\"\n layoutOptions={{ stretch: true }}\n actions={actions}>\n\n {helmet}\n\n {proposals}\n\n <Card elevation={1} css={css`flex: 100%; padding: 11px;`}>\n <DL>\n <Summary\n cr={cr}\n currentStakeholder={stakeholder}\n registerMetadata={registerMetadata ?? undefined}\n />\n </DL>\n </Card>\n\n <Card elevation={1} css={css`flex: calc(50% - 10px); flex-grow: 1; padding: 11px;`}>\n <TransitionsAndStatus\n pastTransitions={getTransitionHistory(cr)}\n isFinal={isFinalState(cr.state)}\n />\n </Card>\n\n {canTransition\n ? <Card elevation={3} css={css`flex: calc(50% - 10px); flex-grow: 1; padding: 11px;`}>\n <TransitionOptions\n transitions={stakeholder ? getTransitions(cr, stakeholder) : []}\n stakeholder={stakeholder}\n cr={cr}\n />\n </Card>\n : null}\n </TabContentsWithHeader>\n );\n});\n\n\nconst CRTitle: React.FC<{ uri: string }> = memo(function ({ uri }) {\n const { useObjectData } = useContext(DatasetContext);\n const justification = useObjectData({ objectPaths: [uri] }).value.data?.[uri]?.justification;\n return <>Proposal “{maybeEllipsizeString(justification ?? uri)}”</>;\n});\n\nexport default { main: View, title: CRTitle };\n"]}
|