@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/legacy/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
|
|
|
@@ -9433,6 +9433,17 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9433
9433
|
label: i18n.t("savedViews.actions.delete")
|
|
9434
9434
|
}
|
|
9435
9435
|
];
|
|
9436
|
+
const preventEventBubbleToNotTriggerViewSelectEvent = React15.useCallback(
|
|
9437
|
+
(e2) => {
|
|
9438
|
+
e2.stopPropagation();
|
|
9439
|
+
},
|
|
9440
|
+
[]
|
|
9441
|
+
);
|
|
9442
|
+
const hasUpdateButton = props.item.view_level !== "default" && props.canUpdate;
|
|
9443
|
+
const hasCopyShareLinkButton = props.item.view_level !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary";
|
|
9444
|
+
const hasClearTemporaryButton = props.item.id === "temporary";
|
|
9445
|
+
const hasOverflowMenu = props.item.view_level !== "default" && props.canEditOrDelete;
|
|
9446
|
+
const hasActions = hasUpdateButton || hasCopyShareLinkButton || hasClearTemporaryButton || hasOverflowMenu;
|
|
9436
9447
|
return /* @__PURE__ */ React15.createElement(
|
|
9437
9448
|
Container2,
|
|
9438
9449
|
{
|
|
@@ -9442,7 +9453,8 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9442
9453
|
"aria-label": i18n.t("savedViews.ariaLabels.menuItem", {
|
|
9443
9454
|
name: props.item.name
|
|
9444
9455
|
}),
|
|
9445
|
-
"data-testid": "saved-view-collection-menu-item"
|
|
9456
|
+
"data-testid": "saved-view-collection-menu-item",
|
|
9457
|
+
onKeyDown: preventEventBubbleToNotTriggerViewSelectEvent
|
|
9446
9458
|
},
|
|
9447
9459
|
/* @__PURE__ */ React15.createElement(
|
|
9448
9460
|
"span",
|
|
@@ -9452,7 +9464,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9452
9464
|
},
|
|
9453
9465
|
props.item.name
|
|
9454
9466
|
),
|
|
9455
|
-
/* @__PURE__ */ React15.createElement(RowActionsBox, null, /* @__PURE__ */ React15.createElement(import_core_react3.Box, { justifyContent: "space-between" },
|
|
9467
|
+
hasActions && /* @__PURE__ */ React15.createElement(RowActionsBox, null, /* @__PURE__ */ React15.createElement(import_core_react3.Box, { justifyContent: "space-between" }, hasUpdateButton && /* @__PURE__ */ React15.createElement(
|
|
9456
9468
|
import_core_react3.Button,
|
|
9457
9469
|
{
|
|
9458
9470
|
onClick: updateItem,
|
|
@@ -9463,7 +9475,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9463
9475
|
loading: props.isUpdateProcessing
|
|
9464
9476
|
},
|
|
9465
9477
|
i18n.t("savedViews.actions.update")
|
|
9466
|
-
)
|
|
9478
|
+
), hasCopyShareLinkButton && /* @__PURE__ */ React15.createElement(
|
|
9467
9479
|
import_core_react3.Button,
|
|
9468
9480
|
{
|
|
9469
9481
|
onClick: copyShareLink,
|
|
@@ -9473,7 +9485,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9473
9485
|
"data-testid": "copy-share-link-button"
|
|
9474
9486
|
},
|
|
9475
9487
|
/* @__PURE__ */ React15.createElement(IconWrapper, null, /* @__PURE__ */ React15.createElement(Link_default, { size: "sm" }))
|
|
9476
|
-
)
|
|
9488
|
+
), hasClearTemporaryButton && /* @__PURE__ */ React15.createElement(
|
|
9477
9489
|
import_core_react3.Button,
|
|
9478
9490
|
{
|
|
9479
9491
|
onClick: (e2) => {
|
|
@@ -9488,7 +9500,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9488
9500
|
"data-testid": "clear-temporary-view-button"
|
|
9489
9501
|
},
|
|
9490
9502
|
/* @__PURE__ */ React15.createElement(IconWrapper, null, /* @__PURE__ */ React15.createElement(Clear_default, { size: "sm" }))
|
|
9491
|
-
))
|
|
9503
|
+
)), /* @__PURE__ */ React15.createElement(import_core_react3.Box, null, hasOverflowMenu && /* @__PURE__ */ React15.createElement(
|
|
9492
9504
|
import_core_react3.DropdownFlyout,
|
|
9493
9505
|
{
|
|
9494
9506
|
"data-testid": "saved-view-overflow-button",
|
|
@@ -9499,7 +9511,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9499
9511
|
variant: "tertiary",
|
|
9500
9512
|
disabled: props.isUpdateProcessing
|
|
9501
9513
|
}
|
|
9502
|
-
)))
|
|
9514
|
+
)))
|
|
9503
9515
|
);
|
|
9504
9516
|
};
|
|
9505
9517
|
|
|
@@ -9899,27 +9911,31 @@ var groupIcon = (group) => {
|
|
|
9899
9911
|
return /* @__PURE__ */ import_react7.default.createElement(Building_default, null);
|
|
9900
9912
|
}
|
|
9901
9913
|
};
|
|
9902
|
-
var
|
|
9903
|
-
width: 100%;
|
|
9914
|
+
var StyledButton2 = styled_components_esm_default(import_core_react6.Button)`
|
|
9904
9915
|
&:hover {
|
|
9905
9916
|
background-color: ${import_core_react6.colors.gray98};
|
|
9906
9917
|
}
|
|
9907
9918
|
`;
|
|
9908
9919
|
var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
9909
9920
|
const I18n = (0, import_core_react6.useI18nContext)();
|
|
9910
|
-
return /* @__PURE__ */ import_react7.default.createElement(
|
|
9911
|
-
|
|
9921
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_core_react6.Box, { style: { width: "100%" } }, /* @__PURE__ */ import_react7.default.createElement(
|
|
9922
|
+
StyledButton2,
|
|
9912
9923
|
{
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9924
|
+
block: true,
|
|
9925
|
+
style: {
|
|
9926
|
+
justifyContent: "start",
|
|
9927
|
+
height: "40px"
|
|
9928
|
+
},
|
|
9929
|
+
variant: "tertiary",
|
|
9930
|
+
size: "sm",
|
|
9931
|
+
onClick: () => toggleGroup(group),
|
|
9932
|
+
"aria-controls": `saved-views-collections-${group}`,
|
|
9933
|
+
"aria-expanded": expanded,
|
|
9934
|
+
icon: expanded ? /* @__PURE__ */ import_react7.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ import_react7.default.createElement(ChevronRight_default, { size: "sm" })
|
|
9918
9935
|
},
|
|
9919
|
-
expanded ? /* @__PURE__ */ import_react7.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ import_react7.default.createElement(ChevronRight_default, { size: "sm" }),
|
|
9920
9936
|
groupIcon(group),
|
|
9921
9937
|
/* @__PURE__ */ import_react7.default.createElement(import_core_react6.Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
|
|
9922
|
-
);
|
|
9938
|
+
));
|
|
9923
9939
|
};
|
|
9924
9940
|
var ViewLevelHeader_default = ViewLevelHeader;
|
|
9925
9941
|
|
|
@@ -9937,7 +9953,7 @@ var useScrollToRef = (dependency) => {
|
|
|
9937
9953
|
|
|
9938
9954
|
// src/components/panels/PanelContent.styles.ts
|
|
9939
9955
|
var import_core_react7 = require("@procore/core-react");
|
|
9940
|
-
var Row = styled_components_esm_default(import_core_react7.
|
|
9956
|
+
var Row = styled_components_esm_default(import_core_react7.MenuImperative.Item)`
|
|
9941
9957
|
width: 100%;
|
|
9942
9958
|
padding-left: 35px;
|
|
9943
9959
|
padding-right: 4px;
|
|
@@ -9955,6 +9971,11 @@ var Panel2 = styled_components_esm_default(import_core_react7.DetailPage.Card)`
|
|
|
9955
9971
|
`;
|
|
9956
9972
|
|
|
9957
9973
|
// src/components/panels/PanelContent.tsx
|
|
9974
|
+
var StyledMenuImperative = styled_components_esm_default(import_core_react8.MenuImperative)`
|
|
9975
|
+
div[role='listbox'] {
|
|
9976
|
+
padding: 0;
|
|
9977
|
+
}
|
|
9978
|
+
`;
|
|
9958
9979
|
var PanelContent = (props) => {
|
|
9959
9980
|
const { queryInput, selectedSavedView, tableConfig } = props;
|
|
9960
9981
|
const { showToast } = (0, import_toast_alert2.useToastAlertContext)();
|
|
@@ -9995,40 +10016,52 @@ var PanelContent = (props) => {
|
|
|
9995
10016
|
}
|
|
9996
10017
|
});
|
|
9997
10018
|
};
|
|
9998
|
-
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(
|
|
9999
|
-
|
|
10019
|
+
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(
|
|
10020
|
+
StyledMenuImperative,
|
|
10000
10021
|
{
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10022
|
+
role: "listbox",
|
|
10023
|
+
onSelect: (selection) => {
|
|
10024
|
+
if ((selectedSavedView == null ? void 0 : selectedSavedView.id) !== selection.item.id) {
|
|
10025
|
+
props.onSelect({ item: selection.item });
|
|
10026
|
+
}
|
|
10027
|
+
}
|
|
10004
10028
|
},
|
|
10005
|
-
/* @__PURE__ */ import_react9.default.createElement(
|
|
10006
|
-
|
|
10029
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react8.MenuImperative.Options, null, temporaryView && /* @__PURE__ */ import_react9.default.createElement(
|
|
10030
|
+
Row,
|
|
10007
10031
|
{
|
|
10032
|
+
key: temporaryView.id,
|
|
10008
10033
|
item: temporaryView,
|
|
10009
10034
|
selected: isTemporarySelected,
|
|
10010
|
-
|
|
10011
|
-
}
|
|
10012
|
-
)
|
|
10013
|
-
), presetViews.map((presetView) => {
|
|
10014
|
-
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === presetView.id;
|
|
10015
|
-
return /* @__PURE__ */ import_react9.default.createElement(
|
|
10016
|
-
Row,
|
|
10017
|
-
{
|
|
10018
|
-
key: presetView.id,
|
|
10019
|
-
selected: isSelected,
|
|
10020
|
-
onClick: () => props.onSelect({ item: presetView }),
|
|
10021
|
-
ref: isSelected ? selectedRowRef : null
|
|
10035
|
+
ref: isTemporarySelected ? selectedRowRef : null
|
|
10022
10036
|
},
|
|
10023
10037
|
/* @__PURE__ */ import_react9.default.createElement(
|
|
10024
10038
|
SavedViewCollectionMenuItem,
|
|
10025
10039
|
{
|
|
10026
|
-
item:
|
|
10027
|
-
selected:
|
|
10040
|
+
item: temporaryView,
|
|
10041
|
+
selected: isTemporarySelected,
|
|
10042
|
+
onClearTemporary: props.onClearTemporary
|
|
10028
10043
|
}
|
|
10029
10044
|
)
|
|
10030
|
-
)
|
|
10031
|
-
|
|
10045
|
+
), presetViews.map((presetView) => {
|
|
10046
|
+
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === presetView.id;
|
|
10047
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
10048
|
+
Row,
|
|
10049
|
+
{
|
|
10050
|
+
key: presetView.id,
|
|
10051
|
+
item: presetView,
|
|
10052
|
+
selected: isSelected,
|
|
10053
|
+
ref: isSelected ? selectedRowRef : null
|
|
10054
|
+
},
|
|
10055
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
10056
|
+
SavedViewCollectionMenuItem,
|
|
10057
|
+
{
|
|
10058
|
+
item: presetView,
|
|
10059
|
+
selected: isSelected
|
|
10060
|
+
}
|
|
10061
|
+
)
|
|
10062
|
+
);
|
|
10063
|
+
}))
|
|
10064
|
+
), viewLevels.map((level) => {
|
|
10032
10065
|
const isExpanded = groups[level];
|
|
10033
10066
|
const views = isExpanded && savedViews ? savedViews.filter(
|
|
10034
10067
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
@@ -10040,48 +10073,60 @@ var PanelContent = (props) => {
|
|
|
10040
10073
|
toggleGroup,
|
|
10041
10074
|
expanded: isExpanded
|
|
10042
10075
|
}
|
|
10043
|
-
), views.
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10076
|
+
), isExpanded && views.length > 0 && /* @__PURE__ */ import_react9.default.createElement(
|
|
10077
|
+
StyledMenuImperative,
|
|
10078
|
+
{
|
|
10079
|
+
id: `saved-views-collections-${level}`,
|
|
10080
|
+
role: "listbox",
|
|
10081
|
+
onSelect: (selection) => {
|
|
10082
|
+
if ((selectedSavedView == null ? void 0 : selectedSavedView.id) !== selection.item.id) {
|
|
10083
|
+
props.onSelect({ item: selection.item });
|
|
10084
|
+
}
|
|
10085
|
+
}
|
|
10086
|
+
},
|
|
10087
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react8.MenuImperative.Options, null, views.map((view) => {
|
|
10088
|
+
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === view.id;
|
|
10089
|
+
const canUpdate = isSelected && hasPermissionForViewLevel(
|
|
10090
|
+
view.view_level,
|
|
10091
|
+
permissions
|
|
10092
|
+
) && !isEqual(
|
|
10093
|
+
view.table_config,
|
|
10094
|
+
tableConfig,
|
|
10095
|
+
props.defaultView.table_config,
|
|
10096
|
+
props.provider
|
|
10097
|
+
);
|
|
10098
|
+
const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
|
|
10099
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
10100
|
+
Row,
|
|
10065
10101
|
{
|
|
10066
|
-
item: view,
|
|
10067
10102
|
key: view.id,
|
|
10103
|
+
item: view,
|
|
10068
10104
|
selected: isSelected,
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10105
|
+
ref: isSelected ? selectedRowRef : null
|
|
10106
|
+
},
|
|
10107
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
10108
|
+
SavedViewCollectionMenuItem,
|
|
10109
|
+
{
|
|
10110
|
+
item: view,
|
|
10111
|
+
key: view.id,
|
|
10112
|
+
selected: isSelected,
|
|
10113
|
+
canUpdate,
|
|
10114
|
+
canEditOrDelete,
|
|
10115
|
+
onUpdate: (data) => onUpdate(data),
|
|
10116
|
+
isUpdateProcessing: isUpdateLoading,
|
|
10117
|
+
onEdit: () => props.openModal("update" /* UPDATE */),
|
|
10118
|
+
onDelete: props.onDelete,
|
|
10119
|
+
permissions
|
|
10120
|
+
}
|
|
10121
|
+
)
|
|
10122
|
+
);
|
|
10123
|
+
}))
|
|
10124
|
+
));
|
|
10080
10125
|
})));
|
|
10081
10126
|
};
|
|
10082
10127
|
|
|
10083
10128
|
// src/components/saved-views/SavedViews.tsx
|
|
10084
|
-
var
|
|
10129
|
+
var import_core_react15 = require("@procore/core-react");
|
|
10085
10130
|
var import_react13 = __toESM(require("react"));
|
|
10086
10131
|
var import_react_query3 = require("@tanstack/react-query");
|
|
10087
10132
|
var import_toast_alert3 = require("@procore/toast-alert");
|
|
@@ -10114,8 +10159,8 @@ var SavedViewsDeleteConfirmationModalShared = ({
|
|
|
10114
10159
|
var import_react11 = __toESM(require("react"));
|
|
10115
10160
|
|
|
10116
10161
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10117
|
-
var
|
|
10118
|
-
var
|
|
10162
|
+
var import_core_react11 = require("@procore/core-react");
|
|
10163
|
+
var React20 = __toESM(require("react"));
|
|
10119
10164
|
var yup = __toESM(require("yup"));
|
|
10120
10165
|
|
|
10121
10166
|
// src/components/modals/form-modal/FormModalBaseUtils.ts
|
|
@@ -10152,6 +10197,37 @@ function extractMessage(error, I18n) {
|
|
|
10152
10197
|
return { form: I18n.t("savedViews.modal.errors.unknown") };
|
|
10153
10198
|
}
|
|
10154
10199
|
|
|
10200
|
+
// src/components/modals/form-modal/NameInputField.tsx
|
|
10201
|
+
var import_core_react10 = require("@procore/core-react");
|
|
10202
|
+
var React19 = __toESM(require("react"));
|
|
10203
|
+
var NAME_INPUT_ID = "saved-view-form-name-input";
|
|
10204
|
+
var NameInputField = ({
|
|
10205
|
+
error,
|
|
10206
|
+
onResetMutations
|
|
10207
|
+
}) => {
|
|
10208
|
+
const I18n = (0, import_core_react10.useI18nContext)();
|
|
10209
|
+
const label = I18n.t("savedViews.modal.fields.name");
|
|
10210
|
+
const { errors: formErrors, submitCount } = (0, import_core_react10.useFormContext)();
|
|
10211
|
+
React19.useEffect(() => {
|
|
10212
|
+
var _a;
|
|
10213
|
+
if (submitCount > 0 && (formErrors == null ? void 0 : formErrors.name)) {
|
|
10214
|
+
(_a = document.getElementById(NAME_INPUT_ID)) == null ? void 0 : _a.focus();
|
|
10215
|
+
}
|
|
10216
|
+
}, [formErrors == null ? void 0 : formErrors.name, submitCount]);
|
|
10217
|
+
return /* @__PURE__ */ React19.createElement(
|
|
10218
|
+
import_core_react10.Form.Text,
|
|
10219
|
+
{
|
|
10220
|
+
id: NAME_INPUT_ID,
|
|
10221
|
+
name: "name",
|
|
10222
|
+
error,
|
|
10223
|
+
placeholder: label,
|
|
10224
|
+
label,
|
|
10225
|
+
colWidth: 12,
|
|
10226
|
+
onChange: onResetMutations
|
|
10227
|
+
}
|
|
10228
|
+
);
|
|
10229
|
+
};
|
|
10230
|
+
|
|
10155
10231
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10156
10232
|
var ScrollContainer = styled_components_esm_default("div")`
|
|
10157
10233
|
overflow: auto;
|
|
@@ -10171,7 +10247,7 @@ var FormModalBase = ({
|
|
|
10171
10247
|
setOpenEditCreateModal,
|
|
10172
10248
|
onSelect
|
|
10173
10249
|
}) => {
|
|
10174
|
-
const I18n = (0,
|
|
10250
|
+
const I18n = (0, import_core_react11.useI18nContext)();
|
|
10175
10251
|
const NAME_MAX_LENGTH = 150;
|
|
10176
10252
|
const {
|
|
10177
10253
|
mutate: createSavedView,
|
|
@@ -10230,24 +10306,17 @@ var FormModalBase = ({
|
|
|
10230
10306
|
I18n,
|
|
10231
10307
|
isProjectLevelTool
|
|
10232
10308
|
);
|
|
10233
|
-
return /* @__PURE__ */
|
|
10234
|
-
|
|
10309
|
+
return /* @__PURE__ */ React20.createElement(
|
|
10310
|
+
import_core_react11.Modal,
|
|
10235
10311
|
{
|
|
10236
|
-
"
|
|
10237
|
-
|
|
10312
|
+
howToClose: ["x", "scrim"],
|
|
10313
|
+
onClose,
|
|
10238
10314
|
open,
|
|
10239
|
-
|
|
10315
|
+
width: "md",
|
|
10240
10316
|
"data-testid": "create-update-modal"
|
|
10241
10317
|
},
|
|
10242
|
-
/* @__PURE__ */
|
|
10243
|
-
|
|
10244
|
-
{
|
|
10245
|
-
onClose,
|
|
10246
|
-
style: { borderBottom: `1px solid ${import_core_react10.colors.gray85}` }
|
|
10247
|
-
},
|
|
10248
|
-
/* @__PURE__ */ React19.createElement(import_core_react10.H2, null, header)
|
|
10249
|
-
), /* @__PURE__ */ React19.createElement(
|
|
10250
|
-
import_core_react10.Form,
|
|
10318
|
+
/* @__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(
|
|
10319
|
+
import_core_react11.Form,
|
|
10251
10320
|
{
|
|
10252
10321
|
initialValues: {
|
|
10253
10322
|
name: initialName,
|
|
@@ -10272,30 +10341,26 @@ var FormModalBase = ({
|
|
|
10272
10341
|
onReset: onCancel,
|
|
10273
10342
|
validateOnChange: true
|
|
10274
10343
|
},
|
|
10275
|
-
/* @__PURE__ */
|
|
10276
|
-
|
|
10344
|
+
/* @__PURE__ */ React20.createElement(import_core_react11.Form.Form, { name: header }, /* @__PURE__ */ React20.createElement(
|
|
10345
|
+
import_core_react11.Modal.Body,
|
|
10277
10346
|
{
|
|
10278
|
-
style: { paddingTop: 0, paddingBottom: 0, marginTop:
|
|
10347
|
+
style: { paddingTop: 0, paddingBottom: 0, marginTop: import_core_react11.spacing.lg }
|
|
10279
10348
|
},
|
|
10280
|
-
errors && /* @__PURE__ */
|
|
10281
|
-
/* @__PURE__ */
|
|
10282
|
-
|
|
10349
|
+
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 == null ? void 0 : errors.form) || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
|
|
10350
|
+
/* @__PURE__ */ React20.createElement(import_core_react11.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10351
|
+
NameInputField,
|
|
10283
10352
|
{
|
|
10284
|
-
name: "name",
|
|
10285
10353
|
error: errors == null ? void 0 : errors.name,
|
|
10286
|
-
|
|
10287
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10288
|
-
colWidth: 12,
|
|
10289
|
-
onChange: () => resetMutations()
|
|
10354
|
+
onResetMutations: resetMutations
|
|
10290
10355
|
}
|
|
10291
10356
|
)),
|
|
10292
|
-
/* @__PURE__ */
|
|
10293
|
-
|
|
10357
|
+
/* @__PURE__ */ React20.createElement(
|
|
10358
|
+
import_core_react11.Form.Row,
|
|
10294
10359
|
{
|
|
10295
|
-
style: { marginTop: (errors == null ? void 0 : errors.name) ?
|
|
10360
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? import_core_react11.spacing.xl : import_core_react11.spacing.none }
|
|
10296
10361
|
},
|
|
10297
|
-
/* @__PURE__ */
|
|
10298
|
-
|
|
10362
|
+
/* @__PURE__ */ React20.createElement(
|
|
10363
|
+
import_core_react11.Form.TextArea,
|
|
10299
10364
|
{
|
|
10300
10365
|
name: "description",
|
|
10301
10366
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10305,8 +10370,8 @@ var FormModalBase = ({
|
|
|
10305
10370
|
}
|
|
10306
10371
|
)
|
|
10307
10372
|
),
|
|
10308
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
10309
|
-
|
|
10373
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React20.createElement(import_core_react11.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10374
|
+
import_core_react11.Form.Select,
|
|
10310
10375
|
{
|
|
10311
10376
|
name: "view_level",
|
|
10312
10377
|
options: viewLevelOptions,
|
|
@@ -10315,9 +10380,9 @@ var FormModalBase = ({
|
|
|
10315
10380
|
onSearch: false,
|
|
10316
10381
|
onClear: false
|
|
10317
10382
|
}
|
|
10318
|
-
)) : /* @__PURE__ */
|
|
10319
|
-
), /* @__PURE__ */
|
|
10320
|
-
|
|
10383
|
+
)) : /* @__PURE__ */ React20.createElement(React20.Fragment, null)
|
|
10384
|
+
), /* @__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(
|
|
10385
|
+
import_core_react11.Button,
|
|
10321
10386
|
{
|
|
10322
10387
|
"data-testid": "create-update-modal-button",
|
|
10323
10388
|
type: "submit",
|
|
@@ -10332,7 +10397,7 @@ var FormModalBase = ({
|
|
|
10332
10397
|
};
|
|
10333
10398
|
|
|
10334
10399
|
// src/components/modals/form-modal/FormModal.tsx
|
|
10335
|
-
var
|
|
10400
|
+
var import_core_react12 = require("@procore/core-react");
|
|
10336
10401
|
var FormModal = ({
|
|
10337
10402
|
open,
|
|
10338
10403
|
mode,
|
|
@@ -10345,7 +10410,7 @@ var FormModal = ({
|
|
|
10345
10410
|
onSelect,
|
|
10346
10411
|
defaultView
|
|
10347
10412
|
}) => {
|
|
10348
|
-
const i18n = (0,
|
|
10413
|
+
const i18n = (0, import_core_react12.useI18nContext)();
|
|
10349
10414
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
10350
10415
|
FormModalBase,
|
|
10351
10416
|
{
|
|
@@ -10367,8 +10432,8 @@ var FormModal = ({
|
|
|
10367
10432
|
};
|
|
10368
10433
|
|
|
10369
10434
|
// src/components/modals/form-modal/SharedViewFormModal.tsx
|
|
10370
|
-
var
|
|
10371
|
-
var
|
|
10435
|
+
var import_core_react13 = require("@procore/core-react");
|
|
10436
|
+
var React22 = __toESM(require("react"));
|
|
10372
10437
|
var yup2 = __toESM(require("yup"));
|
|
10373
10438
|
var SharedViewFormModal = ({
|
|
10374
10439
|
open,
|
|
@@ -10380,7 +10445,7 @@ var SharedViewFormModal = ({
|
|
|
10380
10445
|
isCreating,
|
|
10381
10446
|
resetCreateError
|
|
10382
10447
|
}) => {
|
|
10383
|
-
const I18n = (0,
|
|
10448
|
+
const I18n = (0, import_core_react13.useI18nContext)();
|
|
10384
10449
|
const NAME_MAX_LENGTH = 150;
|
|
10385
10450
|
const errors = extractMessage(createError, I18n);
|
|
10386
10451
|
const handleNameChange = () => {
|
|
@@ -10391,44 +10456,45 @@ var SharedViewFormModal = ({
|
|
|
10391
10456
|
const handleOnSubmit = (data) => {
|
|
10392
10457
|
onCreateView(data.name, data.description);
|
|
10393
10458
|
};
|
|
10394
|
-
return /* @__PURE__ */
|
|
10395
|
-
|
|
10459
|
+
return /* @__PURE__ */ React22.createElement(
|
|
10460
|
+
import_core_react13.Modal,
|
|
10396
10461
|
{
|
|
10397
10462
|
"data-testid": "shared-view-form-modal",
|
|
10398
10463
|
open,
|
|
10399
|
-
|
|
10464
|
+
howToClose: ["x", "scrim"],
|
|
10465
|
+
onClose,
|
|
10400
10466
|
style: { width: "540px" }
|
|
10401
10467
|
},
|
|
10402
|
-
/* @__PURE__ */
|
|
10403
|
-
|
|
10468
|
+
/* @__PURE__ */ React22.createElement(
|
|
10469
|
+
import_core_react13.Modal.Header,
|
|
10404
10470
|
{
|
|
10405
10471
|
onClose,
|
|
10406
10472
|
style: {
|
|
10407
|
-
paddingTop:
|
|
10408
|
-
paddingBottom:
|
|
10409
|
-
paddingLeft:
|
|
10410
|
-
paddingRight:
|
|
10473
|
+
paddingTop: import_core_react13.spacing.lg,
|
|
10474
|
+
paddingBottom: import_core_react13.spacing.xs,
|
|
10475
|
+
paddingLeft: import_core_react13.spacing.xl,
|
|
10476
|
+
paddingRight: import_core_react13.spacing.xl
|
|
10411
10477
|
}
|
|
10412
10478
|
},
|
|
10413
|
-
I18n.t("savedViews.modal.create.title")
|
|
10479
|
+
/* @__PURE__ */ React22.createElement(import_core_react13.Modal.Heading, null, I18n.t("savedViews.modal.create.title"))
|
|
10414
10480
|
),
|
|
10415
|
-
/* @__PURE__ */
|
|
10416
|
-
|
|
10481
|
+
/* @__PURE__ */ React22.createElement(
|
|
10482
|
+
import_core_react13.P,
|
|
10417
10483
|
{
|
|
10418
10484
|
style: {
|
|
10419
|
-
paddingLeft:
|
|
10420
|
-
paddingRight:
|
|
10421
|
-
paddingBottom:
|
|
10422
|
-
paddingTop:
|
|
10485
|
+
paddingLeft: import_core_react13.spacing.xl,
|
|
10486
|
+
paddingRight: import_core_react13.spacing.xl,
|
|
10487
|
+
paddingBottom: import_core_react13.spacing.lg,
|
|
10488
|
+
paddingTop: import_core_react13.spacing.none,
|
|
10423
10489
|
margin: 0,
|
|
10424
|
-
color:
|
|
10490
|
+
color: import_core_react13.colors.gray45,
|
|
10425
10491
|
whiteSpace: "pre-line"
|
|
10426
10492
|
}
|
|
10427
10493
|
},
|
|
10428
10494
|
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
10429
10495
|
),
|
|
10430
|
-
/* @__PURE__ */
|
|
10431
|
-
|
|
10496
|
+
/* @__PURE__ */ React22.createElement(
|
|
10497
|
+
import_core_react13.Form,
|
|
10432
10498
|
{
|
|
10433
10499
|
initialValues: {
|
|
10434
10500
|
name: fetchedView.name,
|
|
@@ -10446,36 +10512,32 @@ var SharedViewFormModal = ({
|
|
|
10446
10512
|
onSubmit: handleOnSubmit,
|
|
10447
10513
|
validateOnChange: true
|
|
10448
10514
|
},
|
|
10449
|
-
/* @__PURE__ */
|
|
10450
|
-
|
|
10515
|
+
/* @__PURE__ */ React22.createElement(import_core_react13.Form.Form, { name: "share-view-form" }, /* @__PURE__ */ React22.createElement(
|
|
10516
|
+
import_core_react13.Modal.Body,
|
|
10451
10517
|
{
|
|
10452
10518
|
style: {
|
|
10453
|
-
paddingTop:
|
|
10519
|
+
paddingTop: import_core_react13.spacing.lg,
|
|
10454
10520
|
paddingBottom: 0,
|
|
10455
|
-
borderTop: `1px solid ${
|
|
10521
|
+
borderTop: `1px solid ${import_core_react13.colors.gray85}`
|
|
10456
10522
|
}
|
|
10457
10523
|
},
|
|
10458
|
-
errors && /* @__PURE__ */
|
|
10524
|
+
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", {
|
|
10459
10525
|
mode: "create"
|
|
10460
|
-
})), /* @__PURE__ */
|
|
10461
|
-
/* @__PURE__ */
|
|
10462
|
-
|
|
10526
|
+
})), /* @__PURE__ */ React22.createElement(import_core_react13.Banner.Body, null, (errors == null ? void 0 : errors.form) || I18n.t("savedViews.modal.errors.description.create")))),
|
|
10527
|
+
/* @__PURE__ */ React22.createElement(import_core_react13.Form.Row, null, /* @__PURE__ */ React22.createElement(
|
|
10528
|
+
NameInputField,
|
|
10463
10529
|
{
|
|
10464
|
-
name: "name",
|
|
10465
10530
|
error: errors == null ? void 0 : errors.name,
|
|
10466
|
-
|
|
10467
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10468
|
-
colWidth: 12,
|
|
10469
|
-
onChange: handleNameChange
|
|
10531
|
+
onResetMutations: handleNameChange
|
|
10470
10532
|
}
|
|
10471
10533
|
)),
|
|
10472
|
-
/* @__PURE__ */
|
|
10473
|
-
|
|
10534
|
+
/* @__PURE__ */ React22.createElement(
|
|
10535
|
+
import_core_react13.Form.Row,
|
|
10474
10536
|
{
|
|
10475
|
-
style: { marginTop: (errors == null ? void 0 : errors.name) ?
|
|
10537
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? import_core_react13.spacing.xl : import_core_react13.spacing.none }
|
|
10476
10538
|
},
|
|
10477
|
-
/* @__PURE__ */
|
|
10478
|
-
|
|
10539
|
+
/* @__PURE__ */ React22.createElement(
|
|
10540
|
+
import_core_react13.Form.TextArea,
|
|
10479
10541
|
{
|
|
10480
10542
|
name: "description",
|
|
10481
10543
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10485,8 +10547,8 @@ var SharedViewFormModal = ({
|
|
|
10485
10547
|
}
|
|
10486
10548
|
)
|
|
10487
10549
|
)
|
|
10488
|
-
), /* @__PURE__ */
|
|
10489
|
-
|
|
10550
|
+
), /* @__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(
|
|
10551
|
+
import_core_react13.Button,
|
|
10490
10552
|
{
|
|
10491
10553
|
variant: "secondary",
|
|
10492
10554
|
onClick: onCreateTemporaryView,
|
|
@@ -10494,8 +10556,8 @@ var SharedViewFormModal = ({
|
|
|
10494
10556
|
disabled: isCreating
|
|
10495
10557
|
},
|
|
10496
10558
|
I18n.t("savedViews.actions.viewTemporarily")
|
|
10497
|
-
), /* @__PURE__ */
|
|
10498
|
-
|
|
10559
|
+
), /* @__PURE__ */ React22.createElement(
|
|
10560
|
+
import_core_react13.Button,
|
|
10499
10561
|
{
|
|
10500
10562
|
type: "submit",
|
|
10501
10563
|
variant: "primary",
|
|
@@ -10512,7 +10574,7 @@ var SharedViewFormModal = ({
|
|
|
10512
10574
|
// src/utils/hooks/useViewSelection.ts
|
|
10513
10575
|
var import_react12 = require("react");
|
|
10514
10576
|
var import_react_router_dom = require("react-router-dom");
|
|
10515
|
-
var
|
|
10577
|
+
var import_core_react14 = require("@procore/core-react");
|
|
10516
10578
|
|
|
10517
10579
|
// src/utils/viewStorage.ts
|
|
10518
10580
|
var ViewStorage = {
|
|
@@ -10575,7 +10637,7 @@ var restoreUrlParameter = (currentParam, previousParam, setSearchParams) => {
|
|
|
10575
10637
|
}
|
|
10576
10638
|
};
|
|
10577
10639
|
var useViewSelection = (config, savedViews, presetViews, openSharedViewModal) => {
|
|
10578
|
-
const I18n = (0,
|
|
10640
|
+
const I18n = (0, import_core_react14.useI18nContext)();
|
|
10579
10641
|
const projectIdSegment = config.projectId ?? "company";
|
|
10580
10642
|
const storageKey = `savedView_${config.domain}_${config.tableName}_${config.companyId}_${projectIdSegment}_${config.userId}`;
|
|
10581
10643
|
const temporaryStorageKey = `${storageKey}-temporary`;
|
|
@@ -10691,7 +10753,7 @@ var SavedViewsContent = (props) => {
|
|
|
10691
10753
|
const { data: savedViews } = useSavedViewsQuery(queryInput);
|
|
10692
10754
|
const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
|
|
10693
10755
|
const { showToast } = (0, import_toast_alert3.useToastAlertContext)();
|
|
10694
|
-
const i18n = (0,
|
|
10756
|
+
const i18n = (0, import_core_react15.useI18nContext)();
|
|
10695
10757
|
const [activeModal, setActiveModal] = (0, import_react13.useState)(null);
|
|
10696
10758
|
const [modalData, setModalData] = (0, import_react13.useState)(null);
|
|
10697
10759
|
const openModal = (type, data) => {
|
|
@@ -10791,14 +10853,28 @@ var SavedViewsContent = (props) => {
|
|
|
10791
10853
|
"data-testid": "saved-view-expanded-panel",
|
|
10792
10854
|
provider: props.provider
|
|
10793
10855
|
},
|
|
10794
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10795
|
-
|
|
10856
|
+
/* @__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(
|
|
10857
|
+
import_core_react15.Tooltip,
|
|
10858
|
+
{
|
|
10859
|
+
showDelay: 200,
|
|
10860
|
+
overlay: /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Tooltip.Content, null, i18n.t("savedViews.tooltip"))
|
|
10861
|
+
},
|
|
10862
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10863
|
+
Help_default,
|
|
10864
|
+
{
|
|
10865
|
+
tabIndex: 0,
|
|
10866
|
+
size: "sm",
|
|
10867
|
+
"aria-label": i18n.t("savedViews.tooltip")
|
|
10868
|
+
}
|
|
10869
|
+
)
|
|
10870
|
+
))), /* @__PURE__ */ import_react13.default.createElement(
|
|
10871
|
+
import_core_react15.Tooltip,
|
|
10796
10872
|
{
|
|
10797
10873
|
overlay: i18n.t("savedViews.actions.create"),
|
|
10798
10874
|
showDelay: 1e3
|
|
10799
10875
|
},
|
|
10800
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10801
|
-
|
|
10876
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10877
|
+
import_core_react15.Button,
|
|
10802
10878
|
{
|
|
10803
10879
|
icon: /* @__PURE__ */ import_react13.default.createElement(Plus_default, null),
|
|
10804
10880
|
variant: "secondary",
|
|
@@ -10807,9 +10883,9 @@ var SavedViewsContent = (props) => {
|
|
|
10807
10883
|
"aria-label": i18n.t("savedViews.actions.create")
|
|
10808
10884
|
},
|
|
10809
10885
|
i18n.t("savedViews.actions.create")
|
|
10810
|
-
)
|
|
10886
|
+
)
|
|
10811
10887
|
)),
|
|
10812
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10888
|
+
/* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ import_react13.default.createElement(
|
|
10813
10889
|
PanelContent,
|
|
10814
10890
|
{
|
|
10815
10891
|
onSelect: ({ item }) => selectView(item),
|