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