@procore/saved-views 1.1.0-alpha.4 → 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 +267 -191
- package/dist/legacy/index.mjs +294 -219
- package/dist/modern/index.js +266 -191
- package/dist/modern/index.mjs +293 -219
- 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
|
|
|
@@ -9896,27 +9908,31 @@ var groupIcon = (group) => {
|
|
|
9896
9908
|
return /* @__PURE__ */ import_react7.default.createElement(Building_default, null);
|
|
9897
9909
|
}
|
|
9898
9910
|
};
|
|
9899
|
-
var
|
|
9900
|
-
width: 100%;
|
|
9911
|
+
var StyledButton2 = styled_components_esm_default(import_core_react6.Button)`
|
|
9901
9912
|
&:hover {
|
|
9902
9913
|
background-color: ${import_core_react6.colors.gray98};
|
|
9903
9914
|
}
|
|
9904
9915
|
`;
|
|
9905
9916
|
var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
9906
9917
|
const I18n = (0, import_core_react6.useI18nContext)();
|
|
9907
|
-
return /* @__PURE__ */ import_react7.default.createElement(
|
|
9908
|
-
|
|
9918
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_core_react6.Box, { style: { width: "100%" } }, /* @__PURE__ */ import_react7.default.createElement(
|
|
9919
|
+
StyledButton2,
|
|
9909
9920
|
{
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
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" })
|
|
9915
9932
|
},
|
|
9916
|
-
expanded ? /* @__PURE__ */ import_react7.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ import_react7.default.createElement(ChevronRight_default, { size: "sm" }),
|
|
9917
9933
|
groupIcon(group),
|
|
9918
9934
|
/* @__PURE__ */ import_react7.default.createElement(import_core_react6.Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
|
|
9919
|
-
);
|
|
9935
|
+
));
|
|
9920
9936
|
};
|
|
9921
9937
|
var ViewLevelHeader_default = ViewLevelHeader;
|
|
9922
9938
|
|
|
@@ -9934,7 +9950,7 @@ var useScrollToRef = (dependency) => {
|
|
|
9934
9950
|
|
|
9935
9951
|
// src/components/panels/PanelContent.styles.ts
|
|
9936
9952
|
var import_core_react7 = require("@procore/core-react");
|
|
9937
|
-
var Row = styled_components_esm_default(import_core_react7.
|
|
9953
|
+
var Row = styled_components_esm_default(import_core_react7.MenuImperative.Item)`
|
|
9938
9954
|
width: 100%;
|
|
9939
9955
|
padding-left: 35px;
|
|
9940
9956
|
padding-right: 4px;
|
|
@@ -9952,6 +9968,11 @@ var Panel2 = styled_components_esm_default(import_core_react7.DetailPage.Card)`
|
|
|
9952
9968
|
`;
|
|
9953
9969
|
|
|
9954
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
|
+
`;
|
|
9955
9976
|
var PanelContent = (props) => {
|
|
9956
9977
|
const { queryInput, selectedSavedView, tableConfig } = props;
|
|
9957
9978
|
const { showToast } = (0, import_toast_alert2.useToastAlertContext)();
|
|
@@ -9992,40 +10013,52 @@ var PanelContent = (props) => {
|
|
|
9992
10013
|
}
|
|
9993
10014
|
});
|
|
9994
10015
|
};
|
|
9995
|
-
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(
|
|
9996
|
-
|
|
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,
|
|
9997
10018
|
{
|
|
9998
|
-
|
|
9999
|
-
|
|
10000
|
-
|
|
10019
|
+
role: "listbox",
|
|
10020
|
+
onSelect: (selection) => {
|
|
10021
|
+
if (selectedSavedView?.id !== selection.item.id) {
|
|
10022
|
+
props.onSelect({ item: selection.item });
|
|
10023
|
+
}
|
|
10024
|
+
}
|
|
10001
10025
|
},
|
|
10002
|
-
/* @__PURE__ */ import_react9.default.createElement(
|
|
10003
|
-
|
|
10026
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react8.MenuImperative.Options, null, temporaryView && /* @__PURE__ */ import_react9.default.createElement(
|
|
10027
|
+
Row,
|
|
10004
10028
|
{
|
|
10029
|
+
key: temporaryView.id,
|
|
10005
10030
|
item: temporaryView,
|
|
10006
10031
|
selected: isTemporarySelected,
|
|
10007
|
-
|
|
10008
|
-
}
|
|
10009
|
-
)
|
|
10010
|
-
), presetViews.map((presetView) => {
|
|
10011
|
-
const isSelected = selectedSavedView?.id === presetView.id;
|
|
10012
|
-
return /* @__PURE__ */ import_react9.default.createElement(
|
|
10013
|
-
Row,
|
|
10014
|
-
{
|
|
10015
|
-
key: presetView.id,
|
|
10016
|
-
selected: isSelected,
|
|
10017
|
-
onClick: () => props.onSelect({ item: presetView }),
|
|
10018
|
-
ref: isSelected ? selectedRowRef : null
|
|
10032
|
+
ref: isTemporarySelected ? selectedRowRef : null
|
|
10019
10033
|
},
|
|
10020
10034
|
/* @__PURE__ */ import_react9.default.createElement(
|
|
10021
10035
|
SavedViewCollectionMenuItem,
|
|
10022
10036
|
{
|
|
10023
|
-
item:
|
|
10024
|
-
selected:
|
|
10037
|
+
item: temporaryView,
|
|
10038
|
+
selected: isTemporarySelected,
|
|
10039
|
+
onClearTemporary: props.onClearTemporary
|
|
10025
10040
|
}
|
|
10026
10041
|
)
|
|
10027
|
-
)
|
|
10028
|
-
|
|
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) => {
|
|
10029
10062
|
const isExpanded = groups[level];
|
|
10030
10063
|
const views = isExpanded && savedViews ? savedViews.filter(
|
|
10031
10064
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
@@ -10037,48 +10070,60 @@ var PanelContent = (props) => {
|
|
|
10037
10070
|
toggleGroup,
|
|
10038
10071
|
expanded: isExpanded
|
|
10039
10072
|
}
|
|
10040
|
-
), views.
|
|
10041
|
-
|
|
10042
|
-
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
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,
|
|
10062
10098
|
{
|
|
10063
|
-
item: view,
|
|
10064
10099
|
key: view.id,
|
|
10100
|
+
item: view,
|
|
10065
10101
|
selected: isSelected,
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
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
|
+
));
|
|
10077
10122
|
})));
|
|
10078
10123
|
};
|
|
10079
10124
|
|
|
10080
10125
|
// src/components/saved-views/SavedViews.tsx
|
|
10081
|
-
var
|
|
10126
|
+
var import_core_react15 = require("@procore/core-react");
|
|
10082
10127
|
var import_react13 = __toESM(require("react"));
|
|
10083
10128
|
var import_react_query3 = require("@tanstack/react-query");
|
|
10084
10129
|
var import_toast_alert3 = require("@procore/toast-alert");
|
|
@@ -10111,8 +10156,8 @@ var SavedViewsDeleteConfirmationModalShared = ({
|
|
|
10111
10156
|
var import_react11 = __toESM(require("react"));
|
|
10112
10157
|
|
|
10113
10158
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10114
|
-
var
|
|
10115
|
-
var
|
|
10159
|
+
var import_core_react11 = require("@procore/core-react");
|
|
10160
|
+
var React20 = __toESM(require("react"));
|
|
10116
10161
|
var yup = __toESM(require("yup"));
|
|
10117
10162
|
|
|
10118
10163
|
// src/components/modals/form-modal/FormModalBaseUtils.ts
|
|
@@ -10149,6 +10194,36 @@ function extractMessage(error, I18n) {
|
|
|
10149
10194
|
return { form: I18n.t("savedViews.modal.errors.unknown") };
|
|
10150
10195
|
}
|
|
10151
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
|
+
|
|
10152
10227
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10153
10228
|
var ScrollContainer = styled_components_esm_default("div")`
|
|
10154
10229
|
overflow: auto;
|
|
@@ -10168,7 +10243,7 @@ var FormModalBase = ({
|
|
|
10168
10243
|
setOpenEditCreateModal,
|
|
10169
10244
|
onSelect
|
|
10170
10245
|
}) => {
|
|
10171
|
-
const I18n = (0,
|
|
10246
|
+
const I18n = (0, import_core_react11.useI18nContext)();
|
|
10172
10247
|
const NAME_MAX_LENGTH = 150;
|
|
10173
10248
|
const {
|
|
10174
10249
|
mutate: createSavedView,
|
|
@@ -10227,24 +10302,17 @@ var FormModalBase = ({
|
|
|
10227
10302
|
I18n,
|
|
10228
10303
|
isProjectLevelTool
|
|
10229
10304
|
);
|
|
10230
|
-
return /* @__PURE__ */
|
|
10231
|
-
|
|
10305
|
+
return /* @__PURE__ */ React20.createElement(
|
|
10306
|
+
import_core_react11.Modal,
|
|
10232
10307
|
{
|
|
10233
|
-
"
|
|
10234
|
-
|
|
10308
|
+
howToClose: ["x", "scrim"],
|
|
10309
|
+
onClose,
|
|
10235
10310
|
open,
|
|
10236
|
-
|
|
10311
|
+
width: "md",
|
|
10237
10312
|
"data-testid": "create-update-modal"
|
|
10238
10313
|
},
|
|
10239
|
-
/* @__PURE__ */
|
|
10240
|
-
|
|
10241
|
-
{
|
|
10242
|
-
onClose,
|
|
10243
|
-
style: { borderBottom: `1px solid ${import_core_react10.colors.gray85}` }
|
|
10244
|
-
},
|
|
10245
|
-
/* @__PURE__ */ React19.createElement(import_core_react10.H2, null, header)
|
|
10246
|
-
), /* @__PURE__ */ React19.createElement(
|
|
10247
|
-
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,
|
|
10248
10316
|
{
|
|
10249
10317
|
initialValues: {
|
|
10250
10318
|
name: initialName,
|
|
@@ -10269,30 +10337,26 @@ var FormModalBase = ({
|
|
|
10269
10337
|
onReset: onCancel,
|
|
10270
10338
|
validateOnChange: true
|
|
10271
10339
|
},
|
|
10272
|
-
/* @__PURE__ */
|
|
10273
|
-
|
|
10340
|
+
/* @__PURE__ */ React20.createElement(import_core_react11.Form.Form, { name: header }, /* @__PURE__ */ React20.createElement(
|
|
10341
|
+
import_core_react11.Modal.Body,
|
|
10274
10342
|
{
|
|
10275
|
-
style: { paddingTop: 0, paddingBottom: 0, marginTop:
|
|
10343
|
+
style: { paddingTop: 0, paddingBottom: 0, marginTop: import_core_react11.spacing.lg }
|
|
10276
10344
|
},
|
|
10277
|
-
errors && /* @__PURE__ */
|
|
10278
|
-
/* @__PURE__ */
|
|
10279
|
-
|
|
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,
|
|
10280
10348
|
{
|
|
10281
|
-
name: "name",
|
|
10282
10349
|
error: errors?.name,
|
|
10283
|
-
|
|
10284
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10285
|
-
colWidth: 12,
|
|
10286
|
-
onChange: () => resetMutations()
|
|
10350
|
+
onResetMutations: resetMutations
|
|
10287
10351
|
}
|
|
10288
10352
|
)),
|
|
10289
|
-
/* @__PURE__ */
|
|
10290
|
-
|
|
10353
|
+
/* @__PURE__ */ React20.createElement(
|
|
10354
|
+
import_core_react11.Form.Row,
|
|
10291
10355
|
{
|
|
10292
|
-
style: { marginTop: errors?.name ?
|
|
10356
|
+
style: { marginTop: errors?.name ? import_core_react11.spacing.xl : import_core_react11.spacing.none }
|
|
10293
10357
|
},
|
|
10294
|
-
/* @__PURE__ */
|
|
10295
|
-
|
|
10358
|
+
/* @__PURE__ */ React20.createElement(
|
|
10359
|
+
import_core_react11.Form.TextArea,
|
|
10296
10360
|
{
|
|
10297
10361
|
name: "description",
|
|
10298
10362
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10302,8 +10366,8 @@ var FormModalBase = ({
|
|
|
10302
10366
|
}
|
|
10303
10367
|
)
|
|
10304
10368
|
),
|
|
10305
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
10306
|
-
|
|
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,
|
|
10307
10371
|
{
|
|
10308
10372
|
name: "view_level",
|
|
10309
10373
|
options: viewLevelOptions,
|
|
@@ -10312,9 +10376,9 @@ var FormModalBase = ({
|
|
|
10312
10376
|
onSearch: false,
|
|
10313
10377
|
onClear: false
|
|
10314
10378
|
}
|
|
10315
|
-
)) : /* @__PURE__ */
|
|
10316
|
-
), /* @__PURE__ */
|
|
10317
|
-
|
|
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,
|
|
10318
10382
|
{
|
|
10319
10383
|
"data-testid": "create-update-modal-button",
|
|
10320
10384
|
type: "submit",
|
|
@@ -10329,7 +10393,7 @@ var FormModalBase = ({
|
|
|
10329
10393
|
};
|
|
10330
10394
|
|
|
10331
10395
|
// src/components/modals/form-modal/FormModal.tsx
|
|
10332
|
-
var
|
|
10396
|
+
var import_core_react12 = require("@procore/core-react");
|
|
10333
10397
|
var FormModal = ({
|
|
10334
10398
|
open,
|
|
10335
10399
|
mode,
|
|
@@ -10342,7 +10406,7 @@ var FormModal = ({
|
|
|
10342
10406
|
onSelect,
|
|
10343
10407
|
defaultView
|
|
10344
10408
|
}) => {
|
|
10345
|
-
const i18n = (0,
|
|
10409
|
+
const i18n = (0, import_core_react12.useI18nContext)();
|
|
10346
10410
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
10347
10411
|
FormModalBase,
|
|
10348
10412
|
{
|
|
@@ -10364,8 +10428,8 @@ var FormModal = ({
|
|
|
10364
10428
|
};
|
|
10365
10429
|
|
|
10366
10430
|
// src/components/modals/form-modal/SharedViewFormModal.tsx
|
|
10367
|
-
var
|
|
10368
|
-
var
|
|
10431
|
+
var import_core_react13 = require("@procore/core-react");
|
|
10432
|
+
var React22 = __toESM(require("react"));
|
|
10369
10433
|
var yup2 = __toESM(require("yup"));
|
|
10370
10434
|
var SharedViewFormModal = ({
|
|
10371
10435
|
open,
|
|
@@ -10377,7 +10441,7 @@ var SharedViewFormModal = ({
|
|
|
10377
10441
|
isCreating,
|
|
10378
10442
|
resetCreateError
|
|
10379
10443
|
}) => {
|
|
10380
|
-
const I18n = (0,
|
|
10444
|
+
const I18n = (0, import_core_react13.useI18nContext)();
|
|
10381
10445
|
const NAME_MAX_LENGTH = 150;
|
|
10382
10446
|
const errors = extractMessage(createError, I18n);
|
|
10383
10447
|
const handleNameChange = () => {
|
|
@@ -10388,44 +10452,45 @@ var SharedViewFormModal = ({
|
|
|
10388
10452
|
const handleOnSubmit = (data) => {
|
|
10389
10453
|
onCreateView(data.name, data.description);
|
|
10390
10454
|
};
|
|
10391
|
-
return /* @__PURE__ */
|
|
10392
|
-
|
|
10455
|
+
return /* @__PURE__ */ React22.createElement(
|
|
10456
|
+
import_core_react13.Modal,
|
|
10393
10457
|
{
|
|
10394
10458
|
"data-testid": "shared-view-form-modal",
|
|
10395
10459
|
open,
|
|
10396
|
-
|
|
10460
|
+
howToClose: ["x", "scrim"],
|
|
10461
|
+
onClose,
|
|
10397
10462
|
style: { width: "540px" }
|
|
10398
10463
|
},
|
|
10399
|
-
/* @__PURE__ */
|
|
10400
|
-
|
|
10464
|
+
/* @__PURE__ */ React22.createElement(
|
|
10465
|
+
import_core_react13.Modal.Header,
|
|
10401
10466
|
{
|
|
10402
10467
|
onClose,
|
|
10403
10468
|
style: {
|
|
10404
|
-
paddingTop:
|
|
10405
|
-
paddingBottom:
|
|
10406
|
-
paddingLeft:
|
|
10407
|
-
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
|
|
10408
10473
|
}
|
|
10409
10474
|
},
|
|
10410
|
-
I18n.t("savedViews.modal.create.title")
|
|
10475
|
+
/* @__PURE__ */ React22.createElement(import_core_react13.Modal.Heading, null, I18n.t("savedViews.modal.create.title"))
|
|
10411
10476
|
),
|
|
10412
|
-
/* @__PURE__ */
|
|
10413
|
-
|
|
10477
|
+
/* @__PURE__ */ React22.createElement(
|
|
10478
|
+
import_core_react13.P,
|
|
10414
10479
|
{
|
|
10415
10480
|
style: {
|
|
10416
|
-
paddingLeft:
|
|
10417
|
-
paddingRight:
|
|
10418
|
-
paddingBottom:
|
|
10419
|
-
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,
|
|
10420
10485
|
margin: 0,
|
|
10421
|
-
color:
|
|
10486
|
+
color: import_core_react13.colors.gray45,
|
|
10422
10487
|
whiteSpace: "pre-line"
|
|
10423
10488
|
}
|
|
10424
10489
|
},
|
|
10425
10490
|
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
10426
10491
|
),
|
|
10427
|
-
/* @__PURE__ */
|
|
10428
|
-
|
|
10492
|
+
/* @__PURE__ */ React22.createElement(
|
|
10493
|
+
import_core_react13.Form,
|
|
10429
10494
|
{
|
|
10430
10495
|
initialValues: {
|
|
10431
10496
|
name: fetchedView.name,
|
|
@@ -10443,36 +10508,32 @@ var SharedViewFormModal = ({
|
|
|
10443
10508
|
onSubmit: handleOnSubmit,
|
|
10444
10509
|
validateOnChange: true
|
|
10445
10510
|
},
|
|
10446
|
-
/* @__PURE__ */
|
|
10447
|
-
|
|
10511
|
+
/* @__PURE__ */ React22.createElement(import_core_react13.Form.Form, { name: "share-view-form" }, /* @__PURE__ */ React22.createElement(
|
|
10512
|
+
import_core_react13.Modal.Body,
|
|
10448
10513
|
{
|
|
10449
10514
|
style: {
|
|
10450
|
-
paddingTop:
|
|
10515
|
+
paddingTop: import_core_react13.spacing.lg,
|
|
10451
10516
|
paddingBottom: 0,
|
|
10452
|
-
borderTop: `1px solid ${
|
|
10517
|
+
borderTop: `1px solid ${import_core_react13.colors.gray85}`
|
|
10453
10518
|
}
|
|
10454
10519
|
},
|
|
10455
|
-
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", {
|
|
10456
10521
|
mode: "create"
|
|
10457
|
-
})), /* @__PURE__ */
|
|
10458
|
-
/* @__PURE__ */
|
|
10459
|
-
|
|
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,
|
|
10460
10525
|
{
|
|
10461
|
-
name: "name",
|
|
10462
10526
|
error: errors?.name,
|
|
10463
|
-
|
|
10464
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10465
|
-
colWidth: 12,
|
|
10466
|
-
onChange: handleNameChange
|
|
10527
|
+
onResetMutations: handleNameChange
|
|
10467
10528
|
}
|
|
10468
10529
|
)),
|
|
10469
|
-
/* @__PURE__ */
|
|
10470
|
-
|
|
10530
|
+
/* @__PURE__ */ React22.createElement(
|
|
10531
|
+
import_core_react13.Form.Row,
|
|
10471
10532
|
{
|
|
10472
|
-
style: { marginTop: errors?.name ?
|
|
10533
|
+
style: { marginTop: errors?.name ? import_core_react13.spacing.xl : import_core_react13.spacing.none }
|
|
10473
10534
|
},
|
|
10474
|
-
/* @__PURE__ */
|
|
10475
|
-
|
|
10535
|
+
/* @__PURE__ */ React22.createElement(
|
|
10536
|
+
import_core_react13.Form.TextArea,
|
|
10476
10537
|
{
|
|
10477
10538
|
name: "description",
|
|
10478
10539
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10482,8 +10543,8 @@ var SharedViewFormModal = ({
|
|
|
10482
10543
|
}
|
|
10483
10544
|
)
|
|
10484
10545
|
)
|
|
10485
|
-
), /* @__PURE__ */
|
|
10486
|
-
|
|
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,
|
|
10487
10548
|
{
|
|
10488
10549
|
variant: "secondary",
|
|
10489
10550
|
onClick: onCreateTemporaryView,
|
|
@@ -10491,8 +10552,8 @@ var SharedViewFormModal = ({
|
|
|
10491
10552
|
disabled: isCreating
|
|
10492
10553
|
},
|
|
10493
10554
|
I18n.t("savedViews.actions.viewTemporarily")
|
|
10494
|
-
), /* @__PURE__ */
|
|
10495
|
-
|
|
10555
|
+
), /* @__PURE__ */ React22.createElement(
|
|
10556
|
+
import_core_react13.Button,
|
|
10496
10557
|
{
|
|
10497
10558
|
type: "submit",
|
|
10498
10559
|
variant: "primary",
|
|
@@ -10509,7 +10570,7 @@ var SharedViewFormModal = ({
|
|
|
10509
10570
|
// src/utils/hooks/useViewSelection.ts
|
|
10510
10571
|
var import_react12 = require("react");
|
|
10511
10572
|
var import_react_router_dom = require("react-router-dom");
|
|
10512
|
-
var
|
|
10573
|
+
var import_core_react14 = require("@procore/core-react");
|
|
10513
10574
|
|
|
10514
10575
|
// src/utils/viewStorage.ts
|
|
10515
10576
|
var ViewStorage = {
|
|
@@ -10572,7 +10633,7 @@ var restoreUrlParameter = (currentParam, previousParam, setSearchParams) => {
|
|
|
10572
10633
|
}
|
|
10573
10634
|
};
|
|
10574
10635
|
var useViewSelection = (config, savedViews, presetViews, openSharedViewModal) => {
|
|
10575
|
-
const I18n = (0,
|
|
10636
|
+
const I18n = (0, import_core_react14.useI18nContext)();
|
|
10576
10637
|
const projectIdSegment = config.projectId ?? "company";
|
|
10577
10638
|
const storageKey = `savedView_${config.domain}_${config.tableName}_${config.companyId}_${projectIdSegment}_${config.userId}`;
|
|
10578
10639
|
const temporaryStorageKey = `${storageKey}-temporary`;
|
|
@@ -10688,7 +10749,7 @@ var SavedViewsContent = (props) => {
|
|
|
10688
10749
|
const { data: savedViews } = useSavedViewsQuery(queryInput);
|
|
10689
10750
|
const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
|
|
10690
10751
|
const { showToast } = (0, import_toast_alert3.useToastAlertContext)();
|
|
10691
|
-
const i18n = (0,
|
|
10752
|
+
const i18n = (0, import_core_react15.useI18nContext)();
|
|
10692
10753
|
const [activeModal, setActiveModal] = (0, import_react13.useState)(null);
|
|
10693
10754
|
const [modalData, setModalData] = (0, import_react13.useState)(null);
|
|
10694
10755
|
const openModal = (type, data) => {
|
|
@@ -10788,14 +10849,28 @@ var SavedViewsContent = (props) => {
|
|
|
10788
10849
|
"data-testid": "saved-view-expanded-panel",
|
|
10789
10850
|
provider: props.provider
|
|
10790
10851
|
},
|
|
10791
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10792
|
-
|
|
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,
|
|
10793
10868
|
{
|
|
10794
10869
|
overlay: i18n.t("savedViews.actions.create"),
|
|
10795
10870
|
showDelay: 1e3
|
|
10796
10871
|
},
|
|
10797
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10798
|
-
|
|
10872
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10873
|
+
import_core_react15.Button,
|
|
10799
10874
|
{
|
|
10800
10875
|
icon: /* @__PURE__ */ import_react13.default.createElement(Plus_default, null),
|
|
10801
10876
|
variant: "secondary",
|
|
@@ -10804,9 +10879,9 @@ var SavedViewsContent = (props) => {
|
|
|
10804
10879
|
"aria-label": i18n.t("savedViews.actions.create")
|
|
10805
10880
|
},
|
|
10806
10881
|
i18n.t("savedViews.actions.create")
|
|
10807
|
-
)
|
|
10882
|
+
)
|
|
10808
10883
|
)),
|
|
10809
|
-
/* @__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(
|
|
10810
10885
|
PanelContent,
|
|
10811
10886
|
{
|
|
10812
10887
|
onSelect: ({ item }) => selectView(item),
|