@procore/saved-views 1.0.1-estimatingFork.5 → 1.0.1-estimatingFork.6
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.d.mts +1 -1
- package/dist/legacy/index.d.ts +1 -1
- package/dist/legacy/index.js +272 -199
- package/dist/legacy/index.mjs +297 -225
- package/dist/modern/index.d.mts +1 -1
- package/dist/modern/index.d.ts +1 -1
- package/dist/modern/index.js +271 -199
- package/dist/modern/index.mjs +296 -225
- 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
|
|
|
@@ -9539,7 +9551,7 @@ var import_react9 = __toESM(require("react"));
|
|
|
9539
9551
|
|
|
9540
9552
|
// src/components/panels/PanelContent.styles.ts
|
|
9541
9553
|
var import_core_react5 = require("@procore/core-react");
|
|
9542
|
-
var Row = styled_components_esm_default(import_core_react5.
|
|
9554
|
+
var Row = styled_components_esm_default(import_core_react5.MenuImperative.Item)`
|
|
9543
9555
|
width: 100%;
|
|
9544
9556
|
padding-left: 35px;
|
|
9545
9557
|
padding-right: 4px;
|
|
@@ -9811,31 +9823,40 @@ var groupIcon = (group) => {
|
|
|
9811
9823
|
return /* @__PURE__ */ import_react8.default.createElement(Building_default, null);
|
|
9812
9824
|
}
|
|
9813
9825
|
};
|
|
9814
|
-
var
|
|
9815
|
-
width: 100%;
|
|
9826
|
+
var StyledButton2 = styled_components_esm_default(import_core_react6.Button)`
|
|
9816
9827
|
&:hover {
|
|
9817
9828
|
background-color: ${import_core_react6.colors.gray98};
|
|
9818
9829
|
}
|
|
9819
9830
|
`;
|
|
9820
9831
|
var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
9821
9832
|
const I18n = (0, import_core_react6.useI18nContext)();
|
|
9822
|
-
return /* @__PURE__ */ import_react8.default.createElement(
|
|
9823
|
-
|
|
9833
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_core_react6.Box, { style: { width: "100%" } }, /* @__PURE__ */ import_react8.default.createElement(
|
|
9834
|
+
StyledButton2,
|
|
9824
9835
|
{
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
|
|
9836
|
+
block: true,
|
|
9837
|
+
style: {
|
|
9838
|
+
justifyContent: "start",
|
|
9839
|
+
height: "40px"
|
|
9840
|
+
},
|
|
9841
|
+
variant: "tertiary",
|
|
9842
|
+
size: "sm",
|
|
9843
|
+
onClick: () => toggleGroup(group),
|
|
9844
|
+
"aria-controls": `saved-views-collections-${group}`,
|
|
9845
|
+
"aria-expanded": expanded,
|
|
9846
|
+
icon: expanded ? /* @__PURE__ */ import_react8.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ import_react8.default.createElement(ChevronRight_default, { size: "sm" })
|
|
9830
9847
|
},
|
|
9831
|
-
expanded ? /* @__PURE__ */ import_react8.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ import_react8.default.createElement(ChevronRight_default, { size: "sm" }),
|
|
9832
9848
|
groupIcon(group),
|
|
9833
9849
|
/* @__PURE__ */ import_react8.default.createElement(import_core_react6.Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
|
|
9834
|
-
);
|
|
9850
|
+
));
|
|
9835
9851
|
};
|
|
9836
9852
|
var ViewLevelHeader_default = ViewLevelHeader;
|
|
9837
9853
|
|
|
9838
9854
|
// src/components/panels/PanelContent.tsx
|
|
9855
|
+
var StyledMenuImperative = styled_components_esm_default(import_core_react7.MenuImperative)`
|
|
9856
|
+
div[role='listbox'] {
|
|
9857
|
+
padding: 0;
|
|
9858
|
+
}
|
|
9859
|
+
`;
|
|
9839
9860
|
var PanelContent = (props) => {
|
|
9840
9861
|
const { queryInput, selectedSavedView, tableConfig } = props;
|
|
9841
9862
|
const { showToast } = (0, import_toast_alert2.useToastAlertContext)();
|
|
@@ -9878,42 +9899,52 @@ var PanelContent = (props) => {
|
|
|
9878
9899
|
}
|
|
9879
9900
|
});
|
|
9880
9901
|
};
|
|
9881
|
-
return /* @__PURE__ */ import_react9.default.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ import_react9.default.createElement(import_core_react7.Flex, { direction: "column", style: { height: "100%", width: "100%" } }, temporaryView && /* @__PURE__ */ import_react9.default.createElement(
|
|
9882
|
-
|
|
9902
|
+
return /* @__PURE__ */ import_react9.default.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ import_react9.default.createElement(import_core_react7.Flex, { direction: "column", style: { height: "100%", width: "100%" } }, (temporaryView || presetViews) && /* @__PURE__ */ import_react9.default.createElement(
|
|
9903
|
+
StyledMenuImperative,
|
|
9883
9904
|
{
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9905
|
+
role: "listbox",
|
|
9906
|
+
onSelect: (selection) => {
|
|
9907
|
+
if ((selectedSavedView == null ? void 0 : selectedSavedView.id) !== selection.item.id) {
|
|
9908
|
+
props.onSelect({ item: selection.item });
|
|
9909
|
+
}
|
|
9910
|
+
}
|
|
9887
9911
|
},
|
|
9888
|
-
/* @__PURE__ */ import_react9.default.createElement(
|
|
9889
|
-
|
|
9912
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react7.MenuImperative.Options, null, temporaryView && /* @__PURE__ */ import_react9.default.createElement(
|
|
9913
|
+
Row,
|
|
9890
9914
|
{
|
|
9915
|
+
key: temporaryView.id,
|
|
9891
9916
|
item: temporaryView,
|
|
9892
9917
|
selected: isTemporarySelected,
|
|
9893
|
-
|
|
9894
|
-
enableSharingViews: false
|
|
9895
|
-
}
|
|
9896
|
-
)
|
|
9897
|
-
), presetViews.map((presetView) => {
|
|
9898
|
-
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === presetView.id;
|
|
9899
|
-
return /* @__PURE__ */ import_react9.default.createElement(
|
|
9900
|
-
Row,
|
|
9901
|
-
{
|
|
9902
|
-
key: presetView.id,
|
|
9903
|
-
selected: isSelected,
|
|
9904
|
-
onClick: () => props.onSelect({ item: presetView }),
|
|
9905
|
-
ref: isSelected ? selectedRowRef : null
|
|
9918
|
+
ref: isTemporarySelected ? selectedRowRef : null
|
|
9906
9919
|
},
|
|
9907
9920
|
/* @__PURE__ */ import_react9.default.createElement(
|
|
9908
9921
|
SavedViewCollectionMenuItem,
|
|
9909
9922
|
{
|
|
9910
|
-
item:
|
|
9911
|
-
selected:
|
|
9912
|
-
|
|
9923
|
+
item: temporaryView,
|
|
9924
|
+
selected: isTemporarySelected,
|
|
9925
|
+
onClearTemporary: props.onClearTemporary
|
|
9913
9926
|
}
|
|
9914
9927
|
)
|
|
9915
|
-
)
|
|
9916
|
-
|
|
9928
|
+
), presetViews.map((presetView) => {
|
|
9929
|
+
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === presetView.id;
|
|
9930
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
9931
|
+
Row,
|
|
9932
|
+
{
|
|
9933
|
+
key: presetView.id,
|
|
9934
|
+
item: presetView,
|
|
9935
|
+
selected: isSelected,
|
|
9936
|
+
ref: isSelected ? selectedRowRef : null
|
|
9937
|
+
},
|
|
9938
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
9939
|
+
SavedViewCollectionMenuItem,
|
|
9940
|
+
{
|
|
9941
|
+
item: presetView,
|
|
9942
|
+
selected: isSelected
|
|
9943
|
+
}
|
|
9944
|
+
)
|
|
9945
|
+
);
|
|
9946
|
+
}))
|
|
9947
|
+
), viewLevels.map((level) => {
|
|
9917
9948
|
const isExpanded = groups[level];
|
|
9918
9949
|
const views = isExpanded && savedViews ? savedViews.filter(
|
|
9919
9950
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
@@ -9925,49 +9956,60 @@ var PanelContent = (props) => {
|
|
|
9925
9956
|
toggleGroup,
|
|
9926
9957
|
expanded: isExpanded
|
|
9927
9958
|
}
|
|
9928
|
-
), views.
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9959
|
+
), isExpanded && views.length > 0 && /* @__PURE__ */ import_react9.default.createElement(
|
|
9960
|
+
StyledMenuImperative,
|
|
9961
|
+
{
|
|
9962
|
+
id: `saved-views-collections-${level}`,
|
|
9963
|
+
role: "listbox",
|
|
9964
|
+
onSelect: (selection) => {
|
|
9965
|
+
if ((selectedSavedView == null ? void 0 : selectedSavedView.id) !== selection.item.id) {
|
|
9966
|
+
props.onSelect({ item: selection.item });
|
|
9967
|
+
}
|
|
9968
|
+
}
|
|
9969
|
+
},
|
|
9970
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react7.MenuImperative.Options, null, views.map((view) => {
|
|
9971
|
+
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === view.id;
|
|
9972
|
+
const canUpdate = isSelected && hasPermissionForViewLevel(
|
|
9973
|
+
view.view_level,
|
|
9974
|
+
permissions
|
|
9975
|
+
) && !isEqual(
|
|
9976
|
+
view.table_config,
|
|
9977
|
+
tableConfig,
|
|
9978
|
+
props.defaultView.table_config,
|
|
9979
|
+
props.provider
|
|
9980
|
+
);
|
|
9981
|
+
const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
|
|
9982
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
9983
|
+
Row,
|
|
9950
9984
|
{
|
|
9951
|
-
item: view,
|
|
9952
9985
|
key: view.id,
|
|
9986
|
+
item: view,
|
|
9953
9987
|
selected: isSelected,
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
|
|
9988
|
+
ref: isSelected ? selectedRowRef : null
|
|
9989
|
+
},
|
|
9990
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
9991
|
+
SavedViewCollectionMenuItem,
|
|
9992
|
+
{
|
|
9993
|
+
item: view,
|
|
9994
|
+
key: view.id,
|
|
9995
|
+
selected: isSelected,
|
|
9996
|
+
canUpdate,
|
|
9997
|
+
canEditOrDelete,
|
|
9998
|
+
onUpdate: (data) => onUpdate(data),
|
|
9999
|
+
isUpdateProcessing: isUpdateLoading,
|
|
10000
|
+
onEdit: () => props.openModal("update" /* UPDATE */),
|
|
10001
|
+
onDelete: props.onDelete,
|
|
10002
|
+
permissions
|
|
10003
|
+
}
|
|
10004
|
+
)
|
|
10005
|
+
);
|
|
10006
|
+
}))
|
|
10007
|
+
));
|
|
9966
10008
|
})));
|
|
9967
10009
|
};
|
|
9968
10010
|
|
|
9969
10011
|
// src/components/saved-views/SavedViews.tsx
|
|
9970
|
-
var
|
|
10012
|
+
var import_core_react15 = require("@procore/core-react");
|
|
9971
10013
|
var import_react13 = __toESM(require("react"));
|
|
9972
10014
|
var import_react_query3 = require("@tanstack/react-query");
|
|
9973
10015
|
var import_toast_alert3 = require("@procore/toast-alert");
|
|
@@ -10000,8 +10042,8 @@ var SavedViewsDeleteConfirmationModalShared = ({
|
|
|
10000
10042
|
var import_react11 = __toESM(require("react"));
|
|
10001
10043
|
|
|
10002
10044
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10003
|
-
var
|
|
10004
|
-
var
|
|
10045
|
+
var import_core_react10 = require("@procore/core-react");
|
|
10046
|
+
var React20 = __toESM(require("react"));
|
|
10005
10047
|
var yup = __toESM(require("yup"));
|
|
10006
10048
|
|
|
10007
10049
|
// src/components/modals/form-modal/FormModalBaseUtils.ts
|
|
@@ -10038,8 +10080,39 @@ function extractMessage(error, I18n) {
|
|
|
10038
10080
|
return { form: I18n.t("savedViews.modal.errors.unknown") };
|
|
10039
10081
|
}
|
|
10040
10082
|
|
|
10083
|
+
// src/components/modals/form-modal/NameInputField.tsx
|
|
10084
|
+
var import_core_react9 = require("@procore/core-react");
|
|
10085
|
+
var React19 = __toESM(require("react"));
|
|
10086
|
+
var NAME_INPUT_ID = "saved-view-form-name-input";
|
|
10087
|
+
var NameInputField = ({
|
|
10088
|
+
error,
|
|
10089
|
+
onResetMutations
|
|
10090
|
+
}) => {
|
|
10091
|
+
const I18n = (0, import_core_react9.useI18nContext)();
|
|
10092
|
+
const label = I18n.t("savedViews.modal.fields.name");
|
|
10093
|
+
const { errors: formErrors, submitCount } = (0, import_core_react9.useFormContext)();
|
|
10094
|
+
React19.useEffect(() => {
|
|
10095
|
+
var _a;
|
|
10096
|
+
if (submitCount > 0 && (formErrors == null ? void 0 : formErrors.name)) {
|
|
10097
|
+
(_a = document.getElementById(NAME_INPUT_ID)) == null ? void 0 : _a.focus();
|
|
10098
|
+
}
|
|
10099
|
+
}, [formErrors == null ? void 0 : formErrors.name, submitCount]);
|
|
10100
|
+
return /* @__PURE__ */ React19.createElement(
|
|
10101
|
+
import_core_react9.Form.Text,
|
|
10102
|
+
{
|
|
10103
|
+
id: NAME_INPUT_ID,
|
|
10104
|
+
name: "name",
|
|
10105
|
+
error,
|
|
10106
|
+
placeholder: label,
|
|
10107
|
+
label,
|
|
10108
|
+
colWidth: 12,
|
|
10109
|
+
onChange: onResetMutations
|
|
10110
|
+
}
|
|
10111
|
+
);
|
|
10112
|
+
};
|
|
10113
|
+
|
|
10041
10114
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10042
|
-
var { useEffect:
|
|
10115
|
+
var { useEffect: useEffect3, useRef: useRef2 } = React20;
|
|
10043
10116
|
var ScrollContainer = styled_components_esm_default("div")`
|
|
10044
10117
|
overflow: auto;
|
|
10045
10118
|
`;
|
|
@@ -10059,10 +10132,10 @@ var FormModalBase = ({
|
|
|
10059
10132
|
onSelect,
|
|
10060
10133
|
backend
|
|
10061
10134
|
}) => {
|
|
10062
|
-
const I18n = (0,
|
|
10135
|
+
const I18n = (0, import_core_react10.useI18nContext)();
|
|
10063
10136
|
const NAME_MAX_LENGTH = 150;
|
|
10064
10137
|
const originalBodyWidth = useRef2("");
|
|
10065
|
-
|
|
10138
|
+
useEffect3(() => {
|
|
10066
10139
|
if (open) {
|
|
10067
10140
|
originalBodyWidth.current = document.body.style.width || "";
|
|
10068
10141
|
document.body.style.width = "100%";
|
|
@@ -10133,24 +10206,17 @@ var FormModalBase = ({
|
|
|
10133
10206
|
I18n,
|
|
10134
10207
|
isProjectLevelTool
|
|
10135
10208
|
);
|
|
10136
|
-
return /* @__PURE__ */
|
|
10137
|
-
|
|
10209
|
+
return /* @__PURE__ */ React20.createElement(
|
|
10210
|
+
import_core_react10.Modal,
|
|
10138
10211
|
{
|
|
10139
|
-
"
|
|
10140
|
-
|
|
10212
|
+
howToClose: ["x", "scrim"],
|
|
10213
|
+
onClose,
|
|
10141
10214
|
open,
|
|
10142
|
-
|
|
10215
|
+
width: "md",
|
|
10143
10216
|
"data-testid": "create-update-modal"
|
|
10144
10217
|
},
|
|
10145
|
-
/* @__PURE__ */
|
|
10146
|
-
|
|
10147
|
-
{
|
|
10148
|
-
onClose,
|
|
10149
|
-
style: { borderBottom: `1px solid ${import_core_react9.colors.gray85}` }
|
|
10150
|
-
},
|
|
10151
|
-
/* @__PURE__ */ React19.createElement(import_core_react9.H2, null, header)
|
|
10152
|
-
), /* @__PURE__ */ React19.createElement(
|
|
10153
|
-
import_core_react9.Form,
|
|
10218
|
+
/* @__PURE__ */ React20.createElement(ScrollContainer, null, /* @__PURE__ */ React20.createElement(import_core_react10.Modal.Header, { style: { borderBottom: `1px solid ${import_core_react10.colors.gray85}` } }, /* @__PURE__ */ React20.createElement(import_core_react10.Modal.Heading, null, header)), /* @__PURE__ */ React20.createElement(
|
|
10219
|
+
import_core_react10.Form,
|
|
10154
10220
|
{
|
|
10155
10221
|
initialValues: {
|
|
10156
10222
|
name: initialName,
|
|
@@ -10175,30 +10241,26 @@ var FormModalBase = ({
|
|
|
10175
10241
|
onReset: onCancel,
|
|
10176
10242
|
validateOnChange: true
|
|
10177
10243
|
},
|
|
10178
|
-
/* @__PURE__ */
|
|
10179
|
-
|
|
10244
|
+
/* @__PURE__ */ React20.createElement(import_core_react10.Form.Form, { name: header }, /* @__PURE__ */ React20.createElement(
|
|
10245
|
+
import_core_react10.Modal.Body,
|
|
10180
10246
|
{
|
|
10181
|
-
style: { paddingTop: 0, paddingBottom: 0, marginTop:
|
|
10247
|
+
style: { paddingTop: 0, paddingBottom: 0, marginTop: import_core_react10.spacing.lg }
|
|
10182
10248
|
},
|
|
10183
|
-
errors && /* @__PURE__ */
|
|
10184
|
-
/* @__PURE__ */
|
|
10185
|
-
|
|
10249
|
+
errors && /* @__PURE__ */ React20.createElement(import_core_react10.ErrorBanner, { style: { marginBottom: import_core_react10.spacing.xl } }, /* @__PURE__ */ React20.createElement(import_core_react10.Banner.Content, null, /* @__PURE__ */ React20.createElement(import_core_react10.Banner.Title, null, I18n.t("savedViews.modal.errors.title", { mode })), /* @__PURE__ */ React20.createElement(import_core_react10.Banner.Body, null, (errors == null ? void 0 : errors.form) || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
|
|
10250
|
+
/* @__PURE__ */ React20.createElement(import_core_react10.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10251
|
+
NameInputField,
|
|
10186
10252
|
{
|
|
10187
|
-
name: "name",
|
|
10188
10253
|
error: errors == null ? void 0 : errors.name,
|
|
10189
|
-
|
|
10190
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10191
|
-
colWidth: 12,
|
|
10192
|
-
onChange: () => resetMutations()
|
|
10254
|
+
onResetMutations: resetMutations
|
|
10193
10255
|
}
|
|
10194
10256
|
)),
|
|
10195
|
-
/* @__PURE__ */
|
|
10196
|
-
|
|
10257
|
+
/* @__PURE__ */ React20.createElement(
|
|
10258
|
+
import_core_react10.Form.Row,
|
|
10197
10259
|
{
|
|
10198
|
-
style: { marginTop: (errors == null ? void 0 : errors.name) ?
|
|
10260
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? import_core_react10.spacing.xl : import_core_react10.spacing.none }
|
|
10199
10261
|
},
|
|
10200
|
-
/* @__PURE__ */
|
|
10201
|
-
|
|
10262
|
+
/* @__PURE__ */ React20.createElement(
|
|
10263
|
+
import_core_react10.Form.TextArea,
|
|
10202
10264
|
{
|
|
10203
10265
|
name: "description",
|
|
10204
10266
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10208,8 +10270,8 @@ var FormModalBase = ({
|
|
|
10208
10270
|
}
|
|
10209
10271
|
)
|
|
10210
10272
|
),
|
|
10211
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
10212
|
-
|
|
10273
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React20.createElement(import_core_react10.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10274
|
+
import_core_react10.Form.Select,
|
|
10213
10275
|
{
|
|
10214
10276
|
name: "view_level",
|
|
10215
10277
|
qa: { label: "view-level" },
|
|
@@ -10219,9 +10281,9 @@ var FormModalBase = ({
|
|
|
10219
10281
|
onSearch: false,
|
|
10220
10282
|
onClear: false
|
|
10221
10283
|
}
|
|
10222
|
-
)) : /* @__PURE__ */
|
|
10223
|
-
), /* @__PURE__ */
|
|
10224
|
-
|
|
10284
|
+
)) : /* @__PURE__ */ React20.createElement(React20.Fragment, null)
|
|
10285
|
+
), /* @__PURE__ */ React20.createElement(import_core_react10.Modal.Footer, { style: { borderTop: `1px solid ${import_core_react10.colors.gray85}` } }, /* @__PURE__ */ React20.createElement(import_core_react10.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React20.createElement(import_core_react10.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React20.createElement(import_core_react10.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React20.createElement(import_core_react10.Modal.FooterButtons, null, /* @__PURE__ */ React20.createElement(import_core_react10.Button, { type: "reset", variant: "tertiary", disabled: isLoading }, I18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React20.createElement(
|
|
10286
|
+
import_core_react10.Button,
|
|
10225
10287
|
{
|
|
10226
10288
|
"data-testid": "create-update-modal-button",
|
|
10227
10289
|
type: "submit",
|
|
@@ -10236,7 +10298,7 @@ var FormModalBase = ({
|
|
|
10236
10298
|
};
|
|
10237
10299
|
|
|
10238
10300
|
// src/components/modals/form-modal/FormModal.tsx
|
|
10239
|
-
var
|
|
10301
|
+
var import_core_react11 = require("@procore/core-react");
|
|
10240
10302
|
var FormModal = ({
|
|
10241
10303
|
open,
|
|
10242
10304
|
mode,
|
|
@@ -10250,7 +10312,7 @@ var FormModal = ({
|
|
|
10250
10312
|
defaultView,
|
|
10251
10313
|
backend
|
|
10252
10314
|
}) => {
|
|
10253
|
-
const i18n = (0,
|
|
10315
|
+
const i18n = (0, import_core_react11.useI18nContext)();
|
|
10254
10316
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
10255
10317
|
FormModalBase,
|
|
10256
10318
|
{
|
|
@@ -10273,8 +10335,8 @@ var FormModal = ({
|
|
|
10273
10335
|
};
|
|
10274
10336
|
|
|
10275
10337
|
// src/components/modals/form-modal/SharedViewFormModal.tsx
|
|
10276
|
-
var
|
|
10277
|
-
var
|
|
10338
|
+
var import_core_react12 = require("@procore/core-react");
|
|
10339
|
+
var React22 = __toESM(require("react"));
|
|
10278
10340
|
var yup2 = __toESM(require("yup"));
|
|
10279
10341
|
var SharedViewFormModal = ({
|
|
10280
10342
|
open,
|
|
@@ -10286,7 +10348,7 @@ var SharedViewFormModal = ({
|
|
|
10286
10348
|
isCreating,
|
|
10287
10349
|
resetCreateError
|
|
10288
10350
|
}) => {
|
|
10289
|
-
const I18n = (0,
|
|
10351
|
+
const I18n = (0, import_core_react12.useI18nContext)();
|
|
10290
10352
|
const NAME_MAX_LENGTH = 150;
|
|
10291
10353
|
const errors = extractMessage(createError, I18n);
|
|
10292
10354
|
const handleNameChange = () => {
|
|
@@ -10297,44 +10359,45 @@ var SharedViewFormModal = ({
|
|
|
10297
10359
|
const handleOnSubmit = (data) => {
|
|
10298
10360
|
onCreateView(data.name, data.description);
|
|
10299
10361
|
};
|
|
10300
|
-
return /* @__PURE__ */
|
|
10301
|
-
|
|
10362
|
+
return /* @__PURE__ */ React22.createElement(
|
|
10363
|
+
import_core_react12.Modal,
|
|
10302
10364
|
{
|
|
10303
10365
|
"data-testid": "shared-view-form-modal",
|
|
10304
10366
|
open,
|
|
10305
|
-
|
|
10367
|
+
howToClose: ["x", "scrim"],
|
|
10368
|
+
onClose,
|
|
10306
10369
|
style: { width: "540px" }
|
|
10307
10370
|
},
|
|
10308
|
-
/* @__PURE__ */
|
|
10309
|
-
|
|
10371
|
+
/* @__PURE__ */ React22.createElement(
|
|
10372
|
+
import_core_react12.Modal.Header,
|
|
10310
10373
|
{
|
|
10311
10374
|
onClose,
|
|
10312
10375
|
style: {
|
|
10313
|
-
paddingTop:
|
|
10314
|
-
paddingBottom:
|
|
10315
|
-
paddingLeft:
|
|
10316
|
-
paddingRight:
|
|
10376
|
+
paddingTop: import_core_react12.spacing.lg,
|
|
10377
|
+
paddingBottom: import_core_react12.spacing.xs,
|
|
10378
|
+
paddingLeft: import_core_react12.spacing.xl,
|
|
10379
|
+
paddingRight: import_core_react12.spacing.xl
|
|
10317
10380
|
}
|
|
10318
10381
|
},
|
|
10319
|
-
I18n.t("savedViews.modal.create.title")
|
|
10382
|
+
/* @__PURE__ */ React22.createElement(import_core_react12.Modal.Heading, null, I18n.t("savedViews.modal.create.title"))
|
|
10320
10383
|
),
|
|
10321
|
-
/* @__PURE__ */
|
|
10322
|
-
|
|
10384
|
+
/* @__PURE__ */ React22.createElement(
|
|
10385
|
+
import_core_react12.P,
|
|
10323
10386
|
{
|
|
10324
10387
|
style: {
|
|
10325
|
-
paddingLeft:
|
|
10326
|
-
paddingRight:
|
|
10327
|
-
paddingBottom:
|
|
10328
|
-
paddingTop:
|
|
10388
|
+
paddingLeft: import_core_react12.spacing.xl,
|
|
10389
|
+
paddingRight: import_core_react12.spacing.xl,
|
|
10390
|
+
paddingBottom: import_core_react12.spacing.lg,
|
|
10391
|
+
paddingTop: import_core_react12.spacing.none,
|
|
10329
10392
|
margin: 0,
|
|
10330
|
-
color:
|
|
10393
|
+
color: import_core_react12.colors.gray45,
|
|
10331
10394
|
whiteSpace: "pre-line"
|
|
10332
10395
|
}
|
|
10333
10396
|
},
|
|
10334
10397
|
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
10335
10398
|
),
|
|
10336
|
-
/* @__PURE__ */
|
|
10337
|
-
|
|
10399
|
+
/* @__PURE__ */ React22.createElement(
|
|
10400
|
+
import_core_react12.Form,
|
|
10338
10401
|
{
|
|
10339
10402
|
initialValues: {
|
|
10340
10403
|
name: fetchedView.name,
|
|
@@ -10352,36 +10415,32 @@ var SharedViewFormModal = ({
|
|
|
10352
10415
|
onSubmit: handleOnSubmit,
|
|
10353
10416
|
validateOnChange: true
|
|
10354
10417
|
},
|
|
10355
|
-
/* @__PURE__ */
|
|
10356
|
-
|
|
10418
|
+
/* @__PURE__ */ React22.createElement(import_core_react12.Form.Form, { name: "share-view-form" }, /* @__PURE__ */ React22.createElement(
|
|
10419
|
+
import_core_react12.Modal.Body,
|
|
10357
10420
|
{
|
|
10358
10421
|
style: {
|
|
10359
|
-
paddingTop:
|
|
10422
|
+
paddingTop: import_core_react12.spacing.lg,
|
|
10360
10423
|
paddingBottom: 0,
|
|
10361
|
-
borderTop: `1px solid ${
|
|
10424
|
+
borderTop: `1px solid ${import_core_react12.colors.gray85}`
|
|
10362
10425
|
}
|
|
10363
10426
|
},
|
|
10364
|
-
errors && /* @__PURE__ */
|
|
10427
|
+
errors && /* @__PURE__ */ React22.createElement(import_core_react12.ErrorBanner, { style: { marginBottom: import_core_react12.spacing.xl } }, /* @__PURE__ */ React22.createElement(import_core_react12.Banner.Content, null, /* @__PURE__ */ React22.createElement(import_core_react12.Banner.Title, null, I18n.t("savedViews.modal.errors.title", {
|
|
10365
10428
|
mode: "create"
|
|
10366
|
-
})), /* @__PURE__ */
|
|
10367
|
-
/* @__PURE__ */
|
|
10368
|
-
|
|
10429
|
+
})), /* @__PURE__ */ React22.createElement(import_core_react12.Banner.Body, null, (errors == null ? void 0 : errors.form) || I18n.t("savedViews.modal.errors.description.create")))),
|
|
10430
|
+
/* @__PURE__ */ React22.createElement(import_core_react12.Form.Row, null, /* @__PURE__ */ React22.createElement(
|
|
10431
|
+
NameInputField,
|
|
10369
10432
|
{
|
|
10370
|
-
name: "name",
|
|
10371
10433
|
error: errors == null ? void 0 : errors.name,
|
|
10372
|
-
|
|
10373
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10374
|
-
colWidth: 12,
|
|
10375
|
-
onChange: handleNameChange
|
|
10434
|
+
onResetMutations: handleNameChange
|
|
10376
10435
|
}
|
|
10377
10436
|
)),
|
|
10378
|
-
/* @__PURE__ */
|
|
10379
|
-
|
|
10437
|
+
/* @__PURE__ */ React22.createElement(
|
|
10438
|
+
import_core_react12.Form.Row,
|
|
10380
10439
|
{
|
|
10381
|
-
style: { marginTop: (errors == null ? void 0 : errors.name) ?
|
|
10440
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? import_core_react12.spacing.xl : import_core_react12.spacing.none }
|
|
10382
10441
|
},
|
|
10383
|
-
/* @__PURE__ */
|
|
10384
|
-
|
|
10442
|
+
/* @__PURE__ */ React22.createElement(
|
|
10443
|
+
import_core_react12.Form.TextArea,
|
|
10385
10444
|
{
|
|
10386
10445
|
name: "description",
|
|
10387
10446
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10391,8 +10450,8 @@ var SharedViewFormModal = ({
|
|
|
10391
10450
|
}
|
|
10392
10451
|
)
|
|
10393
10452
|
)
|
|
10394
|
-
), /* @__PURE__ */
|
|
10395
|
-
|
|
10453
|
+
), /* @__PURE__ */ React22.createElement(import_core_react12.Modal.Footer, { style: { borderTop: `1px solid ${import_core_react12.colors.gray85}` } }, /* @__PURE__ */ React22.createElement(import_core_react12.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_core_react12.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React22.createElement(import_core_react12.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React22.createElement(import_core_react12.Modal.FooterButtons, null, /* @__PURE__ */ React22.createElement(
|
|
10454
|
+
import_core_react12.Button,
|
|
10396
10455
|
{
|
|
10397
10456
|
variant: "secondary",
|
|
10398
10457
|
onClick: onCreateTemporaryView,
|
|
@@ -10400,8 +10459,8 @@ var SharedViewFormModal = ({
|
|
|
10400
10459
|
disabled: isCreating
|
|
10401
10460
|
},
|
|
10402
10461
|
I18n.t("savedViews.actions.viewTemporarily")
|
|
10403
|
-
), /* @__PURE__ */
|
|
10404
|
-
|
|
10462
|
+
), /* @__PURE__ */ React22.createElement(
|
|
10463
|
+
import_core_react12.Button,
|
|
10405
10464
|
{
|
|
10406
10465
|
type: "submit",
|
|
10407
10466
|
variant: "primary",
|
|
@@ -10418,7 +10477,7 @@ var SharedViewFormModal = ({
|
|
|
10418
10477
|
// src/utils/hooks/useViewSelection.ts
|
|
10419
10478
|
var import_react12 = require("react");
|
|
10420
10479
|
var import_react_router_dom = require("react-router-dom");
|
|
10421
|
-
var
|
|
10480
|
+
var import_core_react13 = require("@procore/core-react");
|
|
10422
10481
|
|
|
10423
10482
|
// src/utils/viewStorage.ts
|
|
10424
10483
|
var ViewStorage = {
|
|
@@ -10481,7 +10540,7 @@ var restoreUrlParameter = (currentParam, previousParam, setSearchParams) => {
|
|
|
10481
10540
|
}
|
|
10482
10541
|
};
|
|
10483
10542
|
var useViewSelection = (config, savedViews, presetViews, openSharedViewModal) => {
|
|
10484
|
-
const I18n = (0,
|
|
10543
|
+
const I18n = (0, import_core_react13.useI18nContext)();
|
|
10485
10544
|
const projectIdSegment = config.projectId ?? "company";
|
|
10486
10545
|
const storageKey = `savedView_${config.domain}_${config.tableName}_${config.companyId}_${projectIdSegment}_${config.userId}`;
|
|
10487
10546
|
const temporaryStorageKey = `${storageKey}-temporary`;
|
|
@@ -10588,7 +10647,7 @@ var import_react_query2 = require("@tanstack/react-query");
|
|
|
10588
10647
|
// src/utils/api/queriesHandler.ts
|
|
10589
10648
|
var import_core_http = require("@procore/core-http");
|
|
10590
10649
|
var import_react_query = require("@tanstack/react-query");
|
|
10591
|
-
var
|
|
10650
|
+
var import_core_react14 = require("@procore/core-react");
|
|
10592
10651
|
var getBasePath = (companyId, projectId) => {
|
|
10593
10652
|
if (projectId) {
|
|
10594
10653
|
return `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views`;
|
|
@@ -10598,7 +10657,7 @@ var getBasePath = (companyId, projectId) => {
|
|
|
10598
10657
|
var useApiRequest = (props, method, mutationKey) => {
|
|
10599
10658
|
const { projectId, companyId, domain, tableName } = props;
|
|
10600
10659
|
const queryClient2 = (0, import_react_query.useQueryClient)();
|
|
10601
|
-
const { locale } = (0,
|
|
10660
|
+
const { locale } = (0, import_core_react14.useI18nContext)();
|
|
10602
10661
|
const basePath = getBasePath(companyId, projectId);
|
|
10603
10662
|
const queryKey = ["savedViews", domain, tableName, companyId, projectId];
|
|
10604
10663
|
return (0, import_react_query.useMutation)({
|
|
@@ -10745,7 +10804,7 @@ var SavedViewsContent = (props) => {
|
|
|
10745
10804
|
const { data: savedViews } = backend.useSavedViewsQuery(queryInput);
|
|
10746
10805
|
const { mutate: deleteSavedView } = backend.useDeleteSavedView(queryInput);
|
|
10747
10806
|
const { showToast } = (0, import_toast_alert3.useToastAlertContext)();
|
|
10748
|
-
const i18n = (0,
|
|
10807
|
+
const i18n = (0, import_core_react15.useI18nContext)();
|
|
10749
10808
|
const [activeModal, setActiveModal] = (0, import_react13.useState)(null);
|
|
10750
10809
|
const [modalData, setModalData] = (0, import_react13.useState)(null);
|
|
10751
10810
|
const openModal = (type, data) => {
|
|
@@ -10845,14 +10904,28 @@ var SavedViewsContent = (props) => {
|
|
|
10845
10904
|
"data-testid": "saved-view-expanded-panel",
|
|
10846
10905
|
provider: props.provider
|
|
10847
10906
|
},
|
|
10848
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10849
|
-
|
|
10907
|
+
/* @__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(
|
|
10908
|
+
import_core_react15.Tooltip,
|
|
10909
|
+
{
|
|
10910
|
+
showDelay: 200,
|
|
10911
|
+
overlay: /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Tooltip.Content, null, i18n.t("savedViews.tooltip"))
|
|
10912
|
+
},
|
|
10913
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10914
|
+
Help_default,
|
|
10915
|
+
{
|
|
10916
|
+
tabIndex: 0,
|
|
10917
|
+
size: "sm",
|
|
10918
|
+
"aria-label": i18n.t("savedViews.tooltip")
|
|
10919
|
+
}
|
|
10920
|
+
)
|
|
10921
|
+
))), /* @__PURE__ */ import_react13.default.createElement(
|
|
10922
|
+
import_core_react15.Tooltip,
|
|
10850
10923
|
{
|
|
10851
10924
|
overlay: i18n.t("savedViews.actions.create"),
|
|
10852
10925
|
showDelay: 1e3
|
|
10853
10926
|
},
|
|
10854
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10855
|
-
|
|
10927
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10928
|
+
import_core_react15.Button,
|
|
10856
10929
|
{
|
|
10857
10930
|
icon: /* @__PURE__ */ import_react13.default.createElement(Plus_default, null),
|
|
10858
10931
|
variant: "secondary",
|
|
@@ -10861,9 +10934,9 @@ var SavedViewsContent = (props) => {
|
|
|
10861
10934
|
"aria-label": i18n.t("savedViews.actions.create")
|
|
10862
10935
|
},
|
|
10863
10936
|
i18n.t("savedViews.actions.create")
|
|
10864
|
-
)
|
|
10937
|
+
)
|
|
10865
10938
|
)),
|
|
10866
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10939
|
+
/* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ import_react13.default.createElement(
|
|
10867
10940
|
PanelContent,
|
|
10868
10941
|
{
|
|
10869
10942
|
onSelect: ({ item }) => selectView(item),
|
|
@@ -10876,7 +10949,7 @@ var SavedViewsContent = (props) => {
|
|
|
10876
10949
|
presetViews: props.presetViews,
|
|
10877
10950
|
savedViews: allViews,
|
|
10878
10951
|
provider: props.provider,
|
|
10879
|
-
userId: props.userId
|
|
10952
|
+
userId: props.userId,
|
|
10880
10953
|
onClearTemporary: clearTemporaryView,
|
|
10881
10954
|
backend
|
|
10882
10955
|
}
|