@procore/saved-views 1.1.0-alpha.3 → 1.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/legacy/index.js +295 -195
- package/dist/legacy/index.mjs +322 -223
- package/dist/modern/index.js +294 -195
- package/dist/modern/index.mjs +321 -223
- package/package.json +3 -2
package/dist/modern/index.js
CHANGED
|
@@ -109,7 +109,7 @@ var require_react_is_production_min = __commonJS({
|
|
|
109
109
|
var E2 = n2;
|
|
110
110
|
var F2 = c2;
|
|
111
111
|
var G2 = f2;
|
|
112
|
-
var
|
|
112
|
+
var H2 = e2;
|
|
113
113
|
var I = l2;
|
|
114
114
|
exports.ContextConsumer = h;
|
|
115
115
|
exports.ContextProvider = z2;
|
|
@@ -120,7 +120,7 @@ var require_react_is_production_min = __commonJS({
|
|
|
120
120
|
exports.Memo = E2;
|
|
121
121
|
exports.Portal = F2;
|
|
122
122
|
exports.Profiler = G2;
|
|
123
|
-
exports.StrictMode =
|
|
123
|
+
exports.StrictMode = H2;
|
|
124
124
|
exports.Suspense = I;
|
|
125
125
|
exports.isAsyncMode = function() {
|
|
126
126
|
return false;
|
|
@@ -7881,7 +7881,7 @@ function __rest(s2, e2) {
|
|
|
7881
7881
|
return t2;
|
|
7882
7882
|
}
|
|
7883
7883
|
|
|
7884
|
-
//
|
|
7884
|
+
// node_modules/@procore/core-icons/dist/Icon.js
|
|
7885
7885
|
var React = __toESM(require("react"));
|
|
7886
7886
|
function getSize(size) {
|
|
7887
7887
|
if (size === "sm") {
|
|
@@ -7900,7 +7900,7 @@ function Icon(_a) {
|
|
|
7900
7900
|
return React.isValidElement(children) ? React.cloneElement(children, __assign(__assign({ "aria-hidden": true, "data-qa": "ci-".concat(props.name) }, props), { width: getSize(props.size), height: getSize(props.size), focusable: false, style: __assign(__assign({}, props.style), { flex: "0 0 auto" }) })) : null;
|
|
7901
7901
|
}
|
|
7902
7902
|
|
|
7903
|
-
//
|
|
7903
|
+
// node_modules/@procore/core-icons/dist/icons/Building.js
|
|
7904
7904
|
var React2 = __toESM(require("react"));
|
|
7905
7905
|
var Building = React2.forwardRef(function Building2(props, ref) {
|
|
7906
7906
|
return React2.createElement(
|
|
@@ -7916,7 +7916,7 @@ var Building = React2.forwardRef(function Building2(props, ref) {
|
|
|
7916
7916
|
Building.displayName = "Building";
|
|
7917
7917
|
var Building_default = Building;
|
|
7918
7918
|
|
|
7919
|
-
//
|
|
7919
|
+
// node_modules/@procore/core-icons/dist/icons/ChevronDown.js
|
|
7920
7920
|
var React3 = __toESM(require("react"));
|
|
7921
7921
|
var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
|
|
7922
7922
|
return React3.createElement(
|
|
@@ -7932,7 +7932,7 @@ var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
|
|
|
7932
7932
|
ChevronDown.displayName = "ChevronDown";
|
|
7933
7933
|
var ChevronDown_default = ChevronDown;
|
|
7934
7934
|
|
|
7935
|
-
//
|
|
7935
|
+
// node_modules/@procore/core-icons/dist/icons/ChevronRight.js
|
|
7936
7936
|
var React4 = __toESM(require("react"));
|
|
7937
7937
|
var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
|
|
7938
7938
|
return React4.createElement(
|
|
@@ -7948,7 +7948,7 @@ var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
|
|
|
7948
7948
|
ChevronRight.displayName = "ChevronRight";
|
|
7949
7949
|
var ChevronRight_default = ChevronRight;
|
|
7950
7950
|
|
|
7951
|
-
//
|
|
7951
|
+
// node_modules/@procore/core-icons/dist/icons/Clear.js
|
|
7952
7952
|
var React5 = __toESM(require("react"));
|
|
7953
7953
|
var Clear = React5.forwardRef(function Clear2(props, ref) {
|
|
7954
7954
|
return React5.createElement(
|
|
@@ -7964,7 +7964,7 @@ var Clear = React5.forwardRef(function Clear2(props, ref) {
|
|
|
7964
7964
|
Clear.displayName = "Clear";
|
|
7965
7965
|
var Clear_default = Clear;
|
|
7966
7966
|
|
|
7967
|
-
//
|
|
7967
|
+
// node_modules/@procore/core-icons/dist/icons/Excavator.js
|
|
7968
7968
|
var React6 = __toESM(require("react"));
|
|
7969
7969
|
var Excavator = React6.forwardRef(function Excavator2(props, ref) {
|
|
7970
7970
|
return React6.createElement(
|
|
@@ -7981,7 +7981,7 @@ var Excavator = React6.forwardRef(function Excavator2(props, ref) {
|
|
|
7981
7981
|
Excavator.displayName = "Excavator";
|
|
7982
7982
|
var Excavator_default = Excavator;
|
|
7983
7983
|
|
|
7984
|
-
//
|
|
7984
|
+
// node_modules/@procore/core-icons/dist/icons/ExpandSidebar.js
|
|
7985
7985
|
var React7 = __toESM(require("react"));
|
|
7986
7986
|
var ExpandSidebar = React7.forwardRef(function ExpandSidebar2(props, ref) {
|
|
7987
7987
|
return React7.createElement(
|
|
@@ -7999,7 +7999,7 @@ var ExpandSidebar = React7.forwardRef(function ExpandSidebar2(props, ref) {
|
|
|
7999
7999
|
ExpandSidebar.displayName = "ExpandSidebar";
|
|
8000
8000
|
var ExpandSidebar_default = ExpandSidebar;
|
|
8001
8001
|
|
|
8002
|
-
//
|
|
8002
|
+
// node_modules/@procore/core-icons/dist/icons/Help.js
|
|
8003
8003
|
var React8 = __toESM(require("react"));
|
|
8004
8004
|
var Help = React8.forwardRef(function Help2(props, ref) {
|
|
8005
8005
|
return React8.createElement(
|
|
@@ -8015,7 +8015,7 @@ var Help = React8.forwardRef(function Help2(props, ref) {
|
|
|
8015
8015
|
Help.displayName = "Help";
|
|
8016
8016
|
var Help_default = Help;
|
|
8017
8017
|
|
|
8018
|
-
//
|
|
8018
|
+
// node_modules/@procore/core-icons/dist/icons/Link.js
|
|
8019
8019
|
var React9 = __toESM(require("react"));
|
|
8020
8020
|
var Link = React9.forwardRef(function Link2(props, ref) {
|
|
8021
8021
|
return React9.createElement(
|
|
@@ -8032,7 +8032,7 @@ var Link = React9.forwardRef(function Link2(props, ref) {
|
|
|
8032
8032
|
Link.displayName = "Link";
|
|
8033
8033
|
var Link_default = Link;
|
|
8034
8034
|
|
|
8035
|
-
//
|
|
8035
|
+
// node_modules/@procore/core-icons/dist/icons/Person.js
|
|
8036
8036
|
var React10 = __toESM(require("react"));
|
|
8037
8037
|
var Person = React10.forwardRef(function Person2(props, ref) {
|
|
8038
8038
|
return React10.createElement(
|
|
@@ -8048,7 +8048,7 @@ var Person = React10.forwardRef(function Person2(props, ref) {
|
|
|
8048
8048
|
Person.displayName = "Person";
|
|
8049
8049
|
var Person_default = Person;
|
|
8050
8050
|
|
|
8051
|
-
//
|
|
8051
|
+
// node_modules/@procore/core-icons/dist/icons/Plus.js
|
|
8052
8052
|
var React11 = __toESM(require("react"));
|
|
8053
8053
|
var Plus = React11.forwardRef(function Plus2(props, ref) {
|
|
8054
8054
|
return React11.createElement(
|
|
@@ -8161,7 +8161,7 @@ function stylis_min(W2) {
|
|
|
8161
8161
|
}
|
|
8162
8162
|
k2 = M2(c2, r2, k2, g2, a2 + 1);
|
|
8163
8163
|
t2 = k2.length;
|
|
8164
|
-
0 < A2 && (r2 = X2(O2, f2, I), C2 =
|
|
8164
|
+
0 < A2 && (r2 = X2(O2, f2, I), C2 = H2(3, k2, r2, c2, D2, z2, t2, g2, a2, h), f2 = r2.join(""), void 0 !== C2 && 0 === (t2 = (k2 = C2.trim()).length) && (g2 = 0, k2 = ""));
|
|
8165
8165
|
if (0 < t2)
|
|
8166
8166
|
switch (g2) {
|
|
8167
8167
|
case 115:
|
|
@@ -8194,7 +8194,7 @@ function stylis_min(W2) {
|
|
|
8194
8194
|
case 59:
|
|
8195
8195
|
f2 = (0 < r2 ? f2.replace(N, "") : f2).trim();
|
|
8196
8196
|
if (1 < (t2 = f2.length))
|
|
8197
|
-
switch (0 === u2 && (q2 = f2.charCodeAt(0), 45 === q2 || 96 < q2 && 123 > q2) && (t2 = (f2 = f2.replace(" ", ":")).length), 0 < A2 && void 0 !== (C2 =
|
|
8197
|
+
switch (0 === u2 && (q2 = f2.charCodeAt(0), 45 === q2 || 96 < q2 && 123 > q2) && (t2 = (f2 = f2.replace(" ", ":")).length), 0 < A2 && void 0 !== (C2 = H2(1, f2, c2, d, D2, z2, p.length, h, a2, h)) && 0 === (t2 = (f2 = C2.trim()).length) && (f2 = "\0\0"), q2 = f2.charCodeAt(0), g2 = f2.charCodeAt(1), q2) {
|
|
8198
8198
|
case 0:
|
|
8199
8199
|
break;
|
|
8200
8200
|
case 64:
|
|
@@ -8214,7 +8214,7 @@ function stylis_min(W2) {
|
|
|
8214
8214
|
case 13:
|
|
8215
8215
|
case 10:
|
|
8216
8216
|
47 === b2 ? b2 = 0 : 0 === 1 + q2 && 107 !== h && 0 < f2.length && (r2 = 1, f2 += "\0");
|
|
8217
|
-
0 < A2 * Y2 &&
|
|
8217
|
+
0 < A2 * Y2 && H2(0, f2, c2, d, D2, z2, p.length, h, a2, h);
|
|
8218
8218
|
z2 = 1;
|
|
8219
8219
|
D2++;
|
|
8220
8220
|
break;
|
|
@@ -8323,7 +8323,7 @@ function stylis_min(W2) {
|
|
|
8323
8323
|
t2 = p.length;
|
|
8324
8324
|
if (0 < t2) {
|
|
8325
8325
|
r2 = c2;
|
|
8326
|
-
if (0 < A2 && (C2 =
|
|
8326
|
+
if (0 < A2 && (C2 = H2(2, p, r2, d, D2, z2, t2, h, a2, h), void 0 !== C2 && 0 === (p = C2).length))
|
|
8327
8327
|
return G3 + p + F3;
|
|
8328
8328
|
p = r2.join(",") + "{" + p + "}";
|
|
8329
8329
|
if (0 !== w2 * E2) {
|
|
@@ -8500,7 +8500,7 @@ function stylis_min(W2) {
|
|
|
8500
8500
|
var e2 = P4(c2, c2.charCodeAt(0), c2.charCodeAt(1), c2.charCodeAt(2));
|
|
8501
8501
|
return e2 !== c2 + ";" ? e2.replace(oa, " or ($1)").substring(4) : "(" + c2 + ")";
|
|
8502
8502
|
}
|
|
8503
|
-
function
|
|
8503
|
+
function H2(d, c2, e2, h, a2, m2, b2, v2, n2, q2) {
|
|
8504
8504
|
for (var g2 = 0, x2 = c2, w3; g2 < A2; ++g2) {
|
|
8505
8505
|
switch (w3 = S2[g2].call(B2, d, x2, e2, h, a2, m2, b2, v2, n2, q2)) {
|
|
8506
8506
|
case void 0:
|
|
@@ -8544,11 +8544,11 @@ function stylis_min(W2) {
|
|
|
8544
8544
|
V2 = e2;
|
|
8545
8545
|
e2 = [V2];
|
|
8546
8546
|
if (0 < A2) {
|
|
8547
|
-
var h =
|
|
8547
|
+
var h = H2(-1, c2, e2, e2, D2, z2, 0, 0, 0, 0);
|
|
8548
8548
|
void 0 !== h && "string" === typeof h && (c2 = h);
|
|
8549
8549
|
}
|
|
8550
8550
|
var a2 = M2(O2, e2, c2, 0, 0);
|
|
8551
|
-
0 < A2 && (h =
|
|
8551
|
+
0 < A2 && (h = H2(-2, a2, e2, e2, D2, z2, a2.length, 0, 0, 0), void 0 !== h && (a2 = h));
|
|
8552
8552
|
V2 = "";
|
|
8553
8553
|
E2 = 0;
|
|
8554
8554
|
z2 = D2 = 1;
|
|
@@ -9356,8 +9356,8 @@ var useSavedViewsPanel = (domain, tableName) => {
|
|
|
9356
9356
|
setIsOpen(!isOpen);
|
|
9357
9357
|
localStorage.setItem(key(domain, tableName), JSON.stringify(!isOpen));
|
|
9358
9358
|
};
|
|
9359
|
-
const
|
|
9360
|
-
return { isOpen, SavedViewsButton:
|
|
9359
|
+
const Button8 = () => /* @__PURE__ */ import_react5.default.createElement(SavedViewsButton, { handleClick, isOpen });
|
|
9360
|
+
return { isOpen, SavedViewsButton: Button8 };
|
|
9361
9361
|
};
|
|
9362
9362
|
var useSavedViewsPanel_default = useSavedViewsPanel;
|
|
9363
9363
|
|
|
@@ -9431,6 +9431,17 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9431
9431
|
label: i18n.t("savedViews.actions.delete")
|
|
9432
9432
|
}
|
|
9433
9433
|
];
|
|
9434
|
+
const preventEventBubbleToNotTriggerViewSelectEvent = React15.useCallback(
|
|
9435
|
+
(e2) => {
|
|
9436
|
+
e2.stopPropagation();
|
|
9437
|
+
},
|
|
9438
|
+
[]
|
|
9439
|
+
);
|
|
9440
|
+
const hasUpdateButton = props.item.view_level !== "default" && props.canUpdate;
|
|
9441
|
+
const hasCopyShareLinkButton = props.item.view_level !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary";
|
|
9442
|
+
const hasClearTemporaryButton = props.item.id === "temporary";
|
|
9443
|
+
const hasOverflowMenu = props.item.view_level !== "default" && props.canEditOrDelete;
|
|
9444
|
+
const hasActions = hasUpdateButton || hasCopyShareLinkButton || hasClearTemporaryButton || hasOverflowMenu;
|
|
9434
9445
|
return /* @__PURE__ */ React15.createElement(
|
|
9435
9446
|
Container2,
|
|
9436
9447
|
{
|
|
@@ -9440,7 +9451,8 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9440
9451
|
"aria-label": i18n.t("savedViews.ariaLabels.menuItem", {
|
|
9441
9452
|
name: props.item.name
|
|
9442
9453
|
}),
|
|
9443
|
-
"data-testid": "saved-view-collection-menu-item"
|
|
9454
|
+
"data-testid": "saved-view-collection-menu-item",
|
|
9455
|
+
onKeyDown: preventEventBubbleToNotTriggerViewSelectEvent
|
|
9444
9456
|
},
|
|
9445
9457
|
/* @__PURE__ */ React15.createElement(
|
|
9446
9458
|
"span",
|
|
@@ -9450,7 +9462,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9450
9462
|
},
|
|
9451
9463
|
props.item.name
|
|
9452
9464
|
),
|
|
9453
|
-
/* @__PURE__ */ React15.createElement(RowActionsBox, null, /* @__PURE__ */ React15.createElement(import_core_react3.Box, { justifyContent: "space-between" },
|
|
9465
|
+
hasActions && /* @__PURE__ */ React15.createElement(RowActionsBox, null, /* @__PURE__ */ React15.createElement(import_core_react3.Box, { justifyContent: "space-between" }, hasUpdateButton && /* @__PURE__ */ React15.createElement(
|
|
9454
9466
|
import_core_react3.Button,
|
|
9455
9467
|
{
|
|
9456
9468
|
onClick: updateItem,
|
|
@@ -9461,7 +9473,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9461
9473
|
loading: props.isUpdateProcessing
|
|
9462
9474
|
},
|
|
9463
9475
|
i18n.t("savedViews.actions.update")
|
|
9464
|
-
)
|
|
9476
|
+
), hasCopyShareLinkButton && /* @__PURE__ */ React15.createElement(
|
|
9465
9477
|
import_core_react3.Button,
|
|
9466
9478
|
{
|
|
9467
9479
|
onClick: copyShareLink,
|
|
@@ -9471,7 +9483,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9471
9483
|
"data-testid": "copy-share-link-button"
|
|
9472
9484
|
},
|
|
9473
9485
|
/* @__PURE__ */ React15.createElement(IconWrapper, null, /* @__PURE__ */ React15.createElement(Link_default, { size: "sm" }))
|
|
9474
|
-
)
|
|
9486
|
+
), hasClearTemporaryButton && /* @__PURE__ */ React15.createElement(
|
|
9475
9487
|
import_core_react3.Button,
|
|
9476
9488
|
{
|
|
9477
9489
|
onClick: (e2) => {
|
|
@@ -9485,7 +9497,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9485
9497
|
"data-testid": "clear-temporary-view-button"
|
|
9486
9498
|
},
|
|
9487
9499
|
/* @__PURE__ */ React15.createElement(IconWrapper, null, /* @__PURE__ */ React15.createElement(Clear_default, { size: "sm" }))
|
|
9488
|
-
))
|
|
9500
|
+
)), /* @__PURE__ */ React15.createElement(import_core_react3.Box, null, hasOverflowMenu && /* @__PURE__ */ React15.createElement(
|
|
9489
9501
|
import_core_react3.DropdownFlyout,
|
|
9490
9502
|
{
|
|
9491
9503
|
"data-testid": "saved-view-overflow-button",
|
|
@@ -9496,7 +9508,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9496
9508
|
variant: "tertiary",
|
|
9497
9509
|
disabled: props.isUpdateProcessing
|
|
9498
9510
|
}
|
|
9499
|
-
)))
|
|
9511
|
+
)))
|
|
9500
9512
|
);
|
|
9501
9513
|
};
|
|
9502
9514
|
|
|
@@ -9776,18 +9788,40 @@ var getOrderedVisibleColumns = (columns, idKey) => {
|
|
|
9776
9788
|
});
|
|
9777
9789
|
return [leftAction, ...middleColumns, rightAction].filter(Boolean);
|
|
9778
9790
|
};
|
|
9791
|
+
var SMART_GRID_COLUMN_COMPARE_KEYS = [
|
|
9792
|
+
"colId",
|
|
9793
|
+
"hide",
|
|
9794
|
+
"width",
|
|
9795
|
+
"sort",
|
|
9796
|
+
"sortIndex",
|
|
9797
|
+
"pinned",
|
|
9798
|
+
"rowGroup",
|
|
9799
|
+
"rowGroupIndex",
|
|
9800
|
+
"pivot",
|
|
9801
|
+
"pivotIndex"
|
|
9802
|
+
];
|
|
9803
|
+
var DATA_TABLE_COLUMN_COMPARE_KEYS = [
|
|
9804
|
+
"field",
|
|
9805
|
+
"hidden",
|
|
9806
|
+
"width",
|
|
9807
|
+
"sort",
|
|
9808
|
+
"sortIndex",
|
|
9809
|
+
"pinned",
|
|
9810
|
+
"rowGroup",
|
|
9811
|
+
"rowGroupIndex"
|
|
9812
|
+
];
|
|
9779
9813
|
var cleanObject = (table_config, provider) => {
|
|
9780
9814
|
if (provider === "smart-grid") {
|
|
9781
9815
|
const smartGridConfig = table_config;
|
|
9782
|
-
if (!smartGridConfig.filterState)
|
|
9783
|
-
return table_config;
|
|
9784
9816
|
const orderedColumns = getOrderedVisibleColumns(
|
|
9785
9817
|
smartGridConfig.columnState,
|
|
9786
9818
|
"colId"
|
|
9787
9819
|
);
|
|
9788
9820
|
return {
|
|
9789
9821
|
...smartGridConfig,
|
|
9790
|
-
columnState: orderedColumns
|
|
9822
|
+
columnState: orderedColumns.map(
|
|
9823
|
+
(col) => import_lodash.default.pick(col, SMART_GRID_COLUMN_COMPARE_KEYS)
|
|
9824
|
+
)
|
|
9791
9825
|
};
|
|
9792
9826
|
} else {
|
|
9793
9827
|
const dataTableConfig = table_config;
|
|
@@ -9799,7 +9833,9 @@ var cleanObject = (table_config, provider) => {
|
|
|
9799
9833
|
);
|
|
9800
9834
|
return {
|
|
9801
9835
|
...dataTableConfig,
|
|
9802
|
-
columnState: orderedColumns
|
|
9836
|
+
columnState: orderedColumns.map(
|
|
9837
|
+
(col) => import_lodash.default.pick(col, DATA_TABLE_COLUMN_COMPARE_KEYS)
|
|
9838
|
+
),
|
|
9803
9839
|
serverFilters: dataTableConfig.serverFilters.map(
|
|
9804
9840
|
(filter) => import_lodash.default.omit(filter, "filterRenderer")
|
|
9805
9841
|
)
|
|
@@ -9872,27 +9908,31 @@ var groupIcon = (group) => {
|
|
|
9872
9908
|
return /* @__PURE__ */ import_react7.default.createElement(Building_default, null);
|
|
9873
9909
|
}
|
|
9874
9910
|
};
|
|
9875
|
-
var
|
|
9876
|
-
width: 100%;
|
|
9911
|
+
var StyledButton2 = styled_components_esm_default(import_core_react6.Button)`
|
|
9877
9912
|
&:hover {
|
|
9878
9913
|
background-color: ${import_core_react6.colors.gray98};
|
|
9879
9914
|
}
|
|
9880
9915
|
`;
|
|
9881
9916
|
var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
9882
9917
|
const I18n = (0, import_core_react6.useI18nContext)();
|
|
9883
|
-
return /* @__PURE__ */ import_react7.default.createElement(
|
|
9884
|
-
|
|
9918
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_core_react6.Box, { style: { width: "100%" } }, /* @__PURE__ */ import_react7.default.createElement(
|
|
9919
|
+
StyledButton2,
|
|
9885
9920
|
{
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9921
|
+
block: true,
|
|
9922
|
+
style: {
|
|
9923
|
+
justifyContent: "start",
|
|
9924
|
+
height: "40px"
|
|
9925
|
+
},
|
|
9926
|
+
variant: "tertiary",
|
|
9927
|
+
size: "sm",
|
|
9928
|
+
onClick: () => toggleGroup(group),
|
|
9929
|
+
"aria-controls": `saved-views-collections-${group}`,
|
|
9930
|
+
"aria-expanded": expanded,
|
|
9931
|
+
icon: expanded ? /* @__PURE__ */ import_react7.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ import_react7.default.createElement(ChevronRight_default, { size: "sm" })
|
|
9891
9932
|
},
|
|
9892
|
-
expanded ? /* @__PURE__ */ import_react7.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ import_react7.default.createElement(ChevronRight_default, { size: "sm" }),
|
|
9893
9933
|
groupIcon(group),
|
|
9894
9934
|
/* @__PURE__ */ import_react7.default.createElement(import_core_react6.Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
|
|
9895
|
-
);
|
|
9935
|
+
));
|
|
9896
9936
|
};
|
|
9897
9937
|
var ViewLevelHeader_default = ViewLevelHeader;
|
|
9898
9938
|
|
|
@@ -9910,7 +9950,7 @@ var useScrollToRef = (dependency) => {
|
|
|
9910
9950
|
|
|
9911
9951
|
// src/components/panels/PanelContent.styles.ts
|
|
9912
9952
|
var import_core_react7 = require("@procore/core-react");
|
|
9913
|
-
var Row = styled_components_esm_default(import_core_react7.
|
|
9953
|
+
var Row = styled_components_esm_default(import_core_react7.MenuImperative.Item)`
|
|
9914
9954
|
width: 100%;
|
|
9915
9955
|
padding-left: 35px;
|
|
9916
9956
|
padding-right: 4px;
|
|
@@ -9928,6 +9968,11 @@ var Panel2 = styled_components_esm_default(import_core_react7.DetailPage.Card)`
|
|
|
9928
9968
|
`;
|
|
9929
9969
|
|
|
9930
9970
|
// src/components/panels/PanelContent.tsx
|
|
9971
|
+
var StyledMenuImperative = styled_components_esm_default(import_core_react8.MenuImperative)`
|
|
9972
|
+
div[role='listbox'] {
|
|
9973
|
+
padding: 0;
|
|
9974
|
+
}
|
|
9975
|
+
`;
|
|
9931
9976
|
var PanelContent = (props) => {
|
|
9932
9977
|
const { queryInput, selectedSavedView, tableConfig } = props;
|
|
9933
9978
|
const { showToast } = (0, import_toast_alert2.useToastAlertContext)();
|
|
@@ -9968,40 +10013,52 @@ var PanelContent = (props) => {
|
|
|
9968
10013
|
}
|
|
9969
10014
|
});
|
|
9970
10015
|
};
|
|
9971
|
-
return /* @__PURE__ */ import_react9.default.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ import_react9.default.createElement(import_core_react8.Flex, { direction: "column", style: { height: "100%", width: "100%" } }, temporaryView && /* @__PURE__ */ import_react9.default.createElement(
|
|
9972
|
-
|
|
10016
|
+
return /* @__PURE__ */ import_react9.default.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ import_react9.default.createElement(import_core_react8.Flex, { direction: "column", style: { height: "100%", width: "100%" } }, (temporaryView || presetViews) && /* @__PURE__ */ import_react9.default.createElement(
|
|
10017
|
+
StyledMenuImperative,
|
|
9973
10018
|
{
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
10019
|
+
role: "listbox",
|
|
10020
|
+
onSelect: (selection) => {
|
|
10021
|
+
if (selectedSavedView?.id !== selection.item.id) {
|
|
10022
|
+
props.onSelect({ item: selection.item });
|
|
10023
|
+
}
|
|
10024
|
+
}
|
|
9977
10025
|
},
|
|
9978
|
-
/* @__PURE__ */ import_react9.default.createElement(
|
|
9979
|
-
|
|
10026
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react8.MenuImperative.Options, null, temporaryView && /* @__PURE__ */ import_react9.default.createElement(
|
|
10027
|
+
Row,
|
|
9980
10028
|
{
|
|
10029
|
+
key: temporaryView.id,
|
|
9981
10030
|
item: temporaryView,
|
|
9982
10031
|
selected: isTemporarySelected,
|
|
9983
|
-
|
|
9984
|
-
}
|
|
9985
|
-
)
|
|
9986
|
-
), presetViews.map((presetView) => {
|
|
9987
|
-
const isSelected = selectedSavedView?.id === presetView.id;
|
|
9988
|
-
return /* @__PURE__ */ import_react9.default.createElement(
|
|
9989
|
-
Row,
|
|
9990
|
-
{
|
|
9991
|
-
key: presetView.id,
|
|
9992
|
-
selected: isSelected,
|
|
9993
|
-
onClick: () => props.onSelect({ item: presetView }),
|
|
9994
|
-
ref: isSelected ? selectedRowRef : null
|
|
10032
|
+
ref: isTemporarySelected ? selectedRowRef : null
|
|
9995
10033
|
},
|
|
9996
10034
|
/* @__PURE__ */ import_react9.default.createElement(
|
|
9997
10035
|
SavedViewCollectionMenuItem,
|
|
9998
10036
|
{
|
|
9999
|
-
item:
|
|
10000
|
-
selected:
|
|
10037
|
+
item: temporaryView,
|
|
10038
|
+
selected: isTemporarySelected,
|
|
10039
|
+
onClearTemporary: props.onClearTemporary
|
|
10001
10040
|
}
|
|
10002
10041
|
)
|
|
10003
|
-
)
|
|
10004
|
-
|
|
10042
|
+
), presetViews.map((presetView) => {
|
|
10043
|
+
const isSelected = selectedSavedView?.id === presetView.id;
|
|
10044
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
10045
|
+
Row,
|
|
10046
|
+
{
|
|
10047
|
+
key: presetView.id,
|
|
10048
|
+
item: presetView,
|
|
10049
|
+
selected: isSelected,
|
|
10050
|
+
ref: isSelected ? selectedRowRef : null
|
|
10051
|
+
},
|
|
10052
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
10053
|
+
SavedViewCollectionMenuItem,
|
|
10054
|
+
{
|
|
10055
|
+
item: presetView,
|
|
10056
|
+
selected: isSelected
|
|
10057
|
+
}
|
|
10058
|
+
)
|
|
10059
|
+
);
|
|
10060
|
+
}))
|
|
10061
|
+
), viewLevels.map((level) => {
|
|
10005
10062
|
const isExpanded = groups[level];
|
|
10006
10063
|
const views = isExpanded && savedViews ? savedViews.filter(
|
|
10007
10064
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
@@ -10013,48 +10070,60 @@ var PanelContent = (props) => {
|
|
|
10013
10070
|
toggleGroup,
|
|
10014
10071
|
expanded: isExpanded
|
|
10015
10072
|
}
|
|
10016
|
-
), views.
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10073
|
+
), isExpanded && views.length > 0 && /* @__PURE__ */ import_react9.default.createElement(
|
|
10074
|
+
StyledMenuImperative,
|
|
10075
|
+
{
|
|
10076
|
+
id: `saved-views-collections-${level}`,
|
|
10077
|
+
role: "listbox",
|
|
10078
|
+
onSelect: (selection) => {
|
|
10079
|
+
if (selectedSavedView?.id !== selection.item.id) {
|
|
10080
|
+
props.onSelect({ item: selection.item });
|
|
10081
|
+
}
|
|
10082
|
+
}
|
|
10083
|
+
},
|
|
10084
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react8.MenuImperative.Options, null, views.map((view) => {
|
|
10085
|
+
const isSelected = selectedSavedView?.id === view.id;
|
|
10086
|
+
const canUpdate = isSelected && hasPermissionForViewLevel(
|
|
10087
|
+
view.view_level,
|
|
10088
|
+
permissions
|
|
10089
|
+
) && !isEqual(
|
|
10090
|
+
view.table_config,
|
|
10091
|
+
tableConfig,
|
|
10092
|
+
props.defaultView.table_config,
|
|
10093
|
+
props.provider
|
|
10094
|
+
);
|
|
10095
|
+
const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
|
|
10096
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
10097
|
+
Row,
|
|
10038
10098
|
{
|
|
10039
|
-
item: view,
|
|
10040
10099
|
key: view.id,
|
|
10100
|
+
item: view,
|
|
10041
10101
|
selected: isSelected,
|
|
10042
|
-
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10102
|
+
ref: isSelected ? selectedRowRef : null
|
|
10103
|
+
},
|
|
10104
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
10105
|
+
SavedViewCollectionMenuItem,
|
|
10106
|
+
{
|
|
10107
|
+
item: view,
|
|
10108
|
+
key: view.id,
|
|
10109
|
+
selected: isSelected,
|
|
10110
|
+
canUpdate,
|
|
10111
|
+
canEditOrDelete,
|
|
10112
|
+
onUpdate: (data) => onUpdate(data),
|
|
10113
|
+
isUpdateProcessing: isUpdateLoading,
|
|
10114
|
+
onEdit: () => props.openModal("update" /* UPDATE */),
|
|
10115
|
+
onDelete: props.onDelete,
|
|
10116
|
+
permissions
|
|
10117
|
+
}
|
|
10118
|
+
)
|
|
10119
|
+
);
|
|
10120
|
+
}))
|
|
10121
|
+
));
|
|
10053
10122
|
})));
|
|
10054
10123
|
};
|
|
10055
10124
|
|
|
10056
10125
|
// src/components/saved-views/SavedViews.tsx
|
|
10057
|
-
var
|
|
10126
|
+
var import_core_react15 = require("@procore/core-react");
|
|
10058
10127
|
var import_react13 = __toESM(require("react"));
|
|
10059
10128
|
var import_react_query3 = require("@tanstack/react-query");
|
|
10060
10129
|
var import_toast_alert3 = require("@procore/toast-alert");
|
|
@@ -10087,8 +10156,8 @@ var SavedViewsDeleteConfirmationModalShared = ({
|
|
|
10087
10156
|
var import_react11 = __toESM(require("react"));
|
|
10088
10157
|
|
|
10089
10158
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10090
|
-
var
|
|
10091
|
-
var
|
|
10159
|
+
var import_core_react11 = require("@procore/core-react");
|
|
10160
|
+
var React20 = __toESM(require("react"));
|
|
10092
10161
|
var yup = __toESM(require("yup"));
|
|
10093
10162
|
|
|
10094
10163
|
// src/components/modals/form-modal/FormModalBaseUtils.ts
|
|
@@ -10125,6 +10194,36 @@ function extractMessage(error, I18n) {
|
|
|
10125
10194
|
return { form: I18n.t("savedViews.modal.errors.unknown") };
|
|
10126
10195
|
}
|
|
10127
10196
|
|
|
10197
|
+
// src/components/modals/form-modal/NameInputField.tsx
|
|
10198
|
+
var import_core_react10 = require("@procore/core-react");
|
|
10199
|
+
var React19 = __toESM(require("react"));
|
|
10200
|
+
var NAME_INPUT_ID = "saved-view-form-name-input";
|
|
10201
|
+
var NameInputField = ({
|
|
10202
|
+
error,
|
|
10203
|
+
onResetMutations
|
|
10204
|
+
}) => {
|
|
10205
|
+
const I18n = (0, import_core_react10.useI18nContext)();
|
|
10206
|
+
const label = I18n.t("savedViews.modal.fields.name");
|
|
10207
|
+
const { errors: formErrors, submitCount } = (0, import_core_react10.useFormContext)();
|
|
10208
|
+
React19.useEffect(() => {
|
|
10209
|
+
if (submitCount > 0 && formErrors?.name) {
|
|
10210
|
+
document.getElementById(NAME_INPUT_ID)?.focus();
|
|
10211
|
+
}
|
|
10212
|
+
}, [formErrors?.name, submitCount]);
|
|
10213
|
+
return /* @__PURE__ */ React19.createElement(
|
|
10214
|
+
import_core_react10.Form.Text,
|
|
10215
|
+
{
|
|
10216
|
+
id: NAME_INPUT_ID,
|
|
10217
|
+
name: "name",
|
|
10218
|
+
error,
|
|
10219
|
+
placeholder: label,
|
|
10220
|
+
label,
|
|
10221
|
+
colWidth: 12,
|
|
10222
|
+
onChange: onResetMutations
|
|
10223
|
+
}
|
|
10224
|
+
);
|
|
10225
|
+
};
|
|
10226
|
+
|
|
10128
10227
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10129
10228
|
var ScrollContainer = styled_components_esm_default("div")`
|
|
10130
10229
|
overflow: auto;
|
|
@@ -10144,7 +10243,7 @@ var FormModalBase = ({
|
|
|
10144
10243
|
setOpenEditCreateModal,
|
|
10145
10244
|
onSelect
|
|
10146
10245
|
}) => {
|
|
10147
|
-
const I18n = (0,
|
|
10246
|
+
const I18n = (0, import_core_react11.useI18nContext)();
|
|
10148
10247
|
const NAME_MAX_LENGTH = 150;
|
|
10149
10248
|
const {
|
|
10150
10249
|
mutate: createSavedView,
|
|
@@ -10203,24 +10302,17 @@ var FormModalBase = ({
|
|
|
10203
10302
|
I18n,
|
|
10204
10303
|
isProjectLevelTool
|
|
10205
10304
|
);
|
|
10206
|
-
return /* @__PURE__ */
|
|
10207
|
-
|
|
10305
|
+
return /* @__PURE__ */ React20.createElement(
|
|
10306
|
+
import_core_react11.Modal,
|
|
10208
10307
|
{
|
|
10209
|
-
"
|
|
10210
|
-
|
|
10308
|
+
howToClose: ["x", "scrim"],
|
|
10309
|
+
onClose,
|
|
10211
10310
|
open,
|
|
10212
|
-
|
|
10311
|
+
width: "md",
|
|
10213
10312
|
"data-testid": "create-update-modal"
|
|
10214
10313
|
},
|
|
10215
|
-
/* @__PURE__ */
|
|
10216
|
-
|
|
10217
|
-
{
|
|
10218
|
-
onClose,
|
|
10219
|
-
style: { borderBottom: `1px solid ${import_core_react10.colors.gray85}` }
|
|
10220
|
-
},
|
|
10221
|
-
/* @__PURE__ */ React19.createElement(import_core_react10.H2, null, header)
|
|
10222
|
-
), /* @__PURE__ */ React19.createElement(
|
|
10223
|
-
import_core_react10.Form,
|
|
10314
|
+
/* @__PURE__ */ React20.createElement(ScrollContainer, null, /* @__PURE__ */ React20.createElement(import_core_react11.Modal.Header, { style: { borderBottom: `1px solid ${import_core_react11.colors.gray85}` } }, /* @__PURE__ */ React20.createElement(import_core_react11.Modal.Heading, null, header)), /* @__PURE__ */ React20.createElement(
|
|
10315
|
+
import_core_react11.Form,
|
|
10224
10316
|
{
|
|
10225
10317
|
initialValues: {
|
|
10226
10318
|
name: initialName,
|
|
@@ -10245,30 +10337,26 @@ var FormModalBase = ({
|
|
|
10245
10337
|
onReset: onCancel,
|
|
10246
10338
|
validateOnChange: true
|
|
10247
10339
|
},
|
|
10248
|
-
/* @__PURE__ */
|
|
10249
|
-
|
|
10340
|
+
/* @__PURE__ */ React20.createElement(import_core_react11.Form.Form, { name: header }, /* @__PURE__ */ React20.createElement(
|
|
10341
|
+
import_core_react11.Modal.Body,
|
|
10250
10342
|
{
|
|
10251
|
-
style: { paddingTop: 0, paddingBottom: 0, marginTop:
|
|
10343
|
+
style: { paddingTop: 0, paddingBottom: 0, marginTop: import_core_react11.spacing.lg }
|
|
10252
10344
|
},
|
|
10253
|
-
errors && /* @__PURE__ */
|
|
10254
|
-
/* @__PURE__ */
|
|
10255
|
-
|
|
10345
|
+
errors && /* @__PURE__ */ React20.createElement(import_core_react11.ErrorBanner, { style: { marginBottom: import_core_react11.spacing.xl } }, /* @__PURE__ */ React20.createElement(import_core_react11.Banner.Content, null, /* @__PURE__ */ React20.createElement(import_core_react11.Banner.Title, null, I18n.t("savedViews.modal.errors.title", { mode })), /* @__PURE__ */ React20.createElement(import_core_react11.Banner.Body, null, errors?.form || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
|
|
10346
|
+
/* @__PURE__ */ React20.createElement(import_core_react11.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10347
|
+
NameInputField,
|
|
10256
10348
|
{
|
|
10257
|
-
name: "name",
|
|
10258
10349
|
error: errors?.name,
|
|
10259
|
-
|
|
10260
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10261
|
-
colWidth: 12,
|
|
10262
|
-
onChange: () => resetMutations()
|
|
10350
|
+
onResetMutations: resetMutations
|
|
10263
10351
|
}
|
|
10264
10352
|
)),
|
|
10265
|
-
/* @__PURE__ */
|
|
10266
|
-
|
|
10353
|
+
/* @__PURE__ */ React20.createElement(
|
|
10354
|
+
import_core_react11.Form.Row,
|
|
10267
10355
|
{
|
|
10268
|
-
style: { marginTop: errors?.name ?
|
|
10356
|
+
style: { marginTop: errors?.name ? import_core_react11.spacing.xl : import_core_react11.spacing.none }
|
|
10269
10357
|
},
|
|
10270
|
-
/* @__PURE__ */
|
|
10271
|
-
|
|
10358
|
+
/* @__PURE__ */ React20.createElement(
|
|
10359
|
+
import_core_react11.Form.TextArea,
|
|
10272
10360
|
{
|
|
10273
10361
|
name: "description",
|
|
10274
10362
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10278,8 +10366,8 @@ var FormModalBase = ({
|
|
|
10278
10366
|
}
|
|
10279
10367
|
)
|
|
10280
10368
|
),
|
|
10281
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
10282
|
-
|
|
10369
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React20.createElement(import_core_react11.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10370
|
+
import_core_react11.Form.Select,
|
|
10283
10371
|
{
|
|
10284
10372
|
name: "view_level",
|
|
10285
10373
|
options: viewLevelOptions,
|
|
@@ -10288,9 +10376,9 @@ var FormModalBase = ({
|
|
|
10288
10376
|
onSearch: false,
|
|
10289
10377
|
onClear: false
|
|
10290
10378
|
}
|
|
10291
|
-
)) : /* @__PURE__ */
|
|
10292
|
-
), /* @__PURE__ */
|
|
10293
|
-
|
|
10379
|
+
)) : /* @__PURE__ */ React20.createElement(React20.Fragment, null)
|
|
10380
|
+
), /* @__PURE__ */ React20.createElement(import_core_react11.Modal.Footer, { style: { borderTop: `1px solid ${import_core_react11.colors.gray85}` } }, /* @__PURE__ */ React20.createElement(import_core_react11.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React20.createElement(import_core_react11.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React20.createElement(import_core_react11.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React20.createElement(import_core_react11.Modal.FooterButtons, null, /* @__PURE__ */ React20.createElement(import_core_react11.Button, { type: "reset", variant: "tertiary", disabled: isLoading }, I18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React20.createElement(
|
|
10381
|
+
import_core_react11.Button,
|
|
10294
10382
|
{
|
|
10295
10383
|
"data-testid": "create-update-modal-button",
|
|
10296
10384
|
type: "submit",
|
|
@@ -10305,7 +10393,7 @@ var FormModalBase = ({
|
|
|
10305
10393
|
};
|
|
10306
10394
|
|
|
10307
10395
|
// src/components/modals/form-modal/FormModal.tsx
|
|
10308
|
-
var
|
|
10396
|
+
var import_core_react12 = require("@procore/core-react");
|
|
10309
10397
|
var FormModal = ({
|
|
10310
10398
|
open,
|
|
10311
10399
|
mode,
|
|
@@ -10318,7 +10406,7 @@ var FormModal = ({
|
|
|
10318
10406
|
onSelect,
|
|
10319
10407
|
defaultView
|
|
10320
10408
|
}) => {
|
|
10321
|
-
const i18n = (0,
|
|
10409
|
+
const i18n = (0, import_core_react12.useI18nContext)();
|
|
10322
10410
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
10323
10411
|
FormModalBase,
|
|
10324
10412
|
{
|
|
@@ -10340,8 +10428,8 @@ var FormModal = ({
|
|
|
10340
10428
|
};
|
|
10341
10429
|
|
|
10342
10430
|
// src/components/modals/form-modal/SharedViewFormModal.tsx
|
|
10343
|
-
var
|
|
10344
|
-
var
|
|
10431
|
+
var import_core_react13 = require("@procore/core-react");
|
|
10432
|
+
var React22 = __toESM(require("react"));
|
|
10345
10433
|
var yup2 = __toESM(require("yup"));
|
|
10346
10434
|
var SharedViewFormModal = ({
|
|
10347
10435
|
open,
|
|
@@ -10353,7 +10441,7 @@ var SharedViewFormModal = ({
|
|
|
10353
10441
|
isCreating,
|
|
10354
10442
|
resetCreateError
|
|
10355
10443
|
}) => {
|
|
10356
|
-
const I18n = (0,
|
|
10444
|
+
const I18n = (0, import_core_react13.useI18nContext)();
|
|
10357
10445
|
const NAME_MAX_LENGTH = 150;
|
|
10358
10446
|
const errors = extractMessage(createError, I18n);
|
|
10359
10447
|
const handleNameChange = () => {
|
|
@@ -10364,44 +10452,45 @@ var SharedViewFormModal = ({
|
|
|
10364
10452
|
const handleOnSubmit = (data) => {
|
|
10365
10453
|
onCreateView(data.name, data.description);
|
|
10366
10454
|
};
|
|
10367
|
-
return /* @__PURE__ */
|
|
10368
|
-
|
|
10455
|
+
return /* @__PURE__ */ React22.createElement(
|
|
10456
|
+
import_core_react13.Modal,
|
|
10369
10457
|
{
|
|
10370
10458
|
"data-testid": "shared-view-form-modal",
|
|
10371
10459
|
open,
|
|
10372
|
-
|
|
10460
|
+
howToClose: ["x", "scrim"],
|
|
10461
|
+
onClose,
|
|
10373
10462
|
style: { width: "540px" }
|
|
10374
10463
|
},
|
|
10375
|
-
/* @__PURE__ */
|
|
10376
|
-
|
|
10464
|
+
/* @__PURE__ */ React22.createElement(
|
|
10465
|
+
import_core_react13.Modal.Header,
|
|
10377
10466
|
{
|
|
10378
10467
|
onClose,
|
|
10379
10468
|
style: {
|
|
10380
|
-
paddingTop:
|
|
10381
|
-
paddingBottom:
|
|
10382
|
-
paddingLeft:
|
|
10383
|
-
paddingRight:
|
|
10469
|
+
paddingTop: import_core_react13.spacing.lg,
|
|
10470
|
+
paddingBottom: import_core_react13.spacing.xs,
|
|
10471
|
+
paddingLeft: import_core_react13.spacing.xl,
|
|
10472
|
+
paddingRight: import_core_react13.spacing.xl
|
|
10384
10473
|
}
|
|
10385
10474
|
},
|
|
10386
|
-
I18n.t("savedViews.modal.create.title")
|
|
10475
|
+
/* @__PURE__ */ React22.createElement(import_core_react13.Modal.Heading, null, I18n.t("savedViews.modal.create.title"))
|
|
10387
10476
|
),
|
|
10388
|
-
/* @__PURE__ */
|
|
10389
|
-
|
|
10477
|
+
/* @__PURE__ */ React22.createElement(
|
|
10478
|
+
import_core_react13.P,
|
|
10390
10479
|
{
|
|
10391
10480
|
style: {
|
|
10392
|
-
paddingLeft:
|
|
10393
|
-
paddingRight:
|
|
10394
|
-
paddingBottom:
|
|
10395
|
-
paddingTop:
|
|
10481
|
+
paddingLeft: import_core_react13.spacing.xl,
|
|
10482
|
+
paddingRight: import_core_react13.spacing.xl,
|
|
10483
|
+
paddingBottom: import_core_react13.spacing.lg,
|
|
10484
|
+
paddingTop: import_core_react13.spacing.none,
|
|
10396
10485
|
margin: 0,
|
|
10397
|
-
color:
|
|
10486
|
+
color: import_core_react13.colors.gray45,
|
|
10398
10487
|
whiteSpace: "pre-line"
|
|
10399
10488
|
}
|
|
10400
10489
|
},
|
|
10401
10490
|
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
10402
10491
|
),
|
|
10403
|
-
/* @__PURE__ */
|
|
10404
|
-
|
|
10492
|
+
/* @__PURE__ */ React22.createElement(
|
|
10493
|
+
import_core_react13.Form,
|
|
10405
10494
|
{
|
|
10406
10495
|
initialValues: {
|
|
10407
10496
|
name: fetchedView.name,
|
|
@@ -10419,36 +10508,32 @@ var SharedViewFormModal = ({
|
|
|
10419
10508
|
onSubmit: handleOnSubmit,
|
|
10420
10509
|
validateOnChange: true
|
|
10421
10510
|
},
|
|
10422
|
-
/* @__PURE__ */
|
|
10423
|
-
|
|
10511
|
+
/* @__PURE__ */ React22.createElement(import_core_react13.Form.Form, { name: "share-view-form" }, /* @__PURE__ */ React22.createElement(
|
|
10512
|
+
import_core_react13.Modal.Body,
|
|
10424
10513
|
{
|
|
10425
10514
|
style: {
|
|
10426
|
-
paddingTop:
|
|
10515
|
+
paddingTop: import_core_react13.spacing.lg,
|
|
10427
10516
|
paddingBottom: 0,
|
|
10428
|
-
borderTop: `1px solid ${
|
|
10517
|
+
borderTop: `1px solid ${import_core_react13.colors.gray85}`
|
|
10429
10518
|
}
|
|
10430
10519
|
},
|
|
10431
|
-
errors && /* @__PURE__ */
|
|
10520
|
+
errors && /* @__PURE__ */ React22.createElement(import_core_react13.ErrorBanner, { style: { marginBottom: import_core_react13.spacing.xl } }, /* @__PURE__ */ React22.createElement(import_core_react13.Banner.Content, null, /* @__PURE__ */ React22.createElement(import_core_react13.Banner.Title, null, I18n.t("savedViews.modal.errors.title", {
|
|
10432
10521
|
mode: "create"
|
|
10433
|
-
})), /* @__PURE__ */
|
|
10434
|
-
/* @__PURE__ */
|
|
10435
|
-
|
|
10522
|
+
})), /* @__PURE__ */ React22.createElement(import_core_react13.Banner.Body, null, errors?.form || I18n.t("savedViews.modal.errors.description.create")))),
|
|
10523
|
+
/* @__PURE__ */ React22.createElement(import_core_react13.Form.Row, null, /* @__PURE__ */ React22.createElement(
|
|
10524
|
+
NameInputField,
|
|
10436
10525
|
{
|
|
10437
|
-
name: "name",
|
|
10438
10526
|
error: errors?.name,
|
|
10439
|
-
|
|
10440
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10441
|
-
colWidth: 12,
|
|
10442
|
-
onChange: handleNameChange
|
|
10527
|
+
onResetMutations: handleNameChange
|
|
10443
10528
|
}
|
|
10444
10529
|
)),
|
|
10445
|
-
/* @__PURE__ */
|
|
10446
|
-
|
|
10530
|
+
/* @__PURE__ */ React22.createElement(
|
|
10531
|
+
import_core_react13.Form.Row,
|
|
10447
10532
|
{
|
|
10448
|
-
style: { marginTop: errors?.name ?
|
|
10533
|
+
style: { marginTop: errors?.name ? import_core_react13.spacing.xl : import_core_react13.spacing.none }
|
|
10449
10534
|
},
|
|
10450
|
-
/* @__PURE__ */
|
|
10451
|
-
|
|
10535
|
+
/* @__PURE__ */ React22.createElement(
|
|
10536
|
+
import_core_react13.Form.TextArea,
|
|
10452
10537
|
{
|
|
10453
10538
|
name: "description",
|
|
10454
10539
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10458,8 +10543,8 @@ var SharedViewFormModal = ({
|
|
|
10458
10543
|
}
|
|
10459
10544
|
)
|
|
10460
10545
|
)
|
|
10461
|
-
), /* @__PURE__ */
|
|
10462
|
-
|
|
10546
|
+
), /* @__PURE__ */ React22.createElement(import_core_react13.Modal.Footer, { style: { borderTop: `1px solid ${import_core_react13.colors.gray85}` } }, /* @__PURE__ */ React22.createElement(import_core_react13.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_core_react13.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React22.createElement(import_core_react13.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React22.createElement(import_core_react13.Modal.FooterButtons, null, /* @__PURE__ */ React22.createElement(
|
|
10547
|
+
import_core_react13.Button,
|
|
10463
10548
|
{
|
|
10464
10549
|
variant: "secondary",
|
|
10465
10550
|
onClick: onCreateTemporaryView,
|
|
@@ -10467,8 +10552,8 @@ var SharedViewFormModal = ({
|
|
|
10467
10552
|
disabled: isCreating
|
|
10468
10553
|
},
|
|
10469
10554
|
I18n.t("savedViews.actions.viewTemporarily")
|
|
10470
|
-
), /* @__PURE__ */
|
|
10471
|
-
|
|
10555
|
+
), /* @__PURE__ */ React22.createElement(
|
|
10556
|
+
import_core_react13.Button,
|
|
10472
10557
|
{
|
|
10473
10558
|
type: "submit",
|
|
10474
10559
|
variant: "primary",
|
|
@@ -10485,7 +10570,7 @@ var SharedViewFormModal = ({
|
|
|
10485
10570
|
// src/utils/hooks/useViewSelection.ts
|
|
10486
10571
|
var import_react12 = require("react");
|
|
10487
10572
|
var import_react_router_dom = require("react-router-dom");
|
|
10488
|
-
var
|
|
10573
|
+
var import_core_react14 = require("@procore/core-react");
|
|
10489
10574
|
|
|
10490
10575
|
// src/utils/viewStorage.ts
|
|
10491
10576
|
var ViewStorage = {
|
|
@@ -10548,7 +10633,7 @@ var restoreUrlParameter = (currentParam, previousParam, setSearchParams) => {
|
|
|
10548
10633
|
}
|
|
10549
10634
|
};
|
|
10550
10635
|
var useViewSelection = (config, savedViews, presetViews, openSharedViewModal) => {
|
|
10551
|
-
const I18n = (0,
|
|
10636
|
+
const I18n = (0, import_core_react14.useI18nContext)();
|
|
10552
10637
|
const projectIdSegment = config.projectId ?? "company";
|
|
10553
10638
|
const storageKey = `savedView_${config.domain}_${config.tableName}_${config.companyId}_${projectIdSegment}_${config.userId}`;
|
|
10554
10639
|
const temporaryStorageKey = `${storageKey}-temporary`;
|
|
@@ -10664,7 +10749,7 @@ var SavedViewsContent = (props) => {
|
|
|
10664
10749
|
const { data: savedViews } = useSavedViewsQuery(queryInput);
|
|
10665
10750
|
const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
|
|
10666
10751
|
const { showToast } = (0, import_toast_alert3.useToastAlertContext)();
|
|
10667
|
-
const i18n = (0,
|
|
10752
|
+
const i18n = (0, import_core_react15.useI18nContext)();
|
|
10668
10753
|
const [activeModal, setActiveModal] = (0, import_react13.useState)(null);
|
|
10669
10754
|
const [modalData, setModalData] = (0, import_react13.useState)(null);
|
|
10670
10755
|
const openModal = (type, data) => {
|
|
@@ -10764,14 +10849,28 @@ var SavedViewsContent = (props) => {
|
|
|
10764
10849
|
"data-testid": "saved-view-expanded-panel",
|
|
10765
10850
|
provider: props.provider
|
|
10766
10851
|
},
|
|
10767
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10768
|
-
|
|
10852
|
+
/* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Header, { id: "saved-views-collections-panel-header" }, /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Title, null, /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Flex, { alignItems: "center" }, /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Box, { paddingRight: "sm" }, i18n.t("savedViews.title")), /* @__PURE__ */ import_react13.default.createElement(
|
|
10853
|
+
import_core_react15.Tooltip,
|
|
10854
|
+
{
|
|
10855
|
+
showDelay: 200,
|
|
10856
|
+
overlay: /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Tooltip.Content, null, i18n.t("savedViews.tooltip"))
|
|
10857
|
+
},
|
|
10858
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10859
|
+
Help_default,
|
|
10860
|
+
{
|
|
10861
|
+
tabIndex: 0,
|
|
10862
|
+
size: "sm",
|
|
10863
|
+
"aria-label": i18n.t("savedViews.tooltip")
|
|
10864
|
+
}
|
|
10865
|
+
)
|
|
10866
|
+
))), /* @__PURE__ */ import_react13.default.createElement(
|
|
10867
|
+
import_core_react15.Tooltip,
|
|
10769
10868
|
{
|
|
10770
10869
|
overlay: i18n.t("savedViews.actions.create"),
|
|
10771
10870
|
showDelay: 1e3
|
|
10772
10871
|
},
|
|
10773
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10774
|
-
|
|
10872
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10873
|
+
import_core_react15.Button,
|
|
10775
10874
|
{
|
|
10776
10875
|
icon: /* @__PURE__ */ import_react13.default.createElement(Plus_default, null),
|
|
10777
10876
|
variant: "secondary",
|
|
@@ -10780,9 +10879,9 @@ var SavedViewsContent = (props) => {
|
|
|
10780
10879
|
"aria-label": i18n.t("savedViews.actions.create")
|
|
10781
10880
|
},
|
|
10782
10881
|
i18n.t("savedViews.actions.create")
|
|
10783
|
-
)
|
|
10882
|
+
)
|
|
10784
10883
|
)),
|
|
10785
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10884
|
+
/* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ import_react13.default.createElement(
|
|
10786
10885
|
PanelContent,
|
|
10787
10886
|
{
|
|
10788
10887
|
onSelect: ({ item }) => selectView(item),
|