@procore/saved-views 1.0.1-estimatingFork.5 → 1.0.1-estimatingFork.6.1
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 +4 -1
- package/dist/legacy/index.d.ts +4 -1
- package/dist/legacy/index.js +281 -202
- package/dist/legacy/index.mjs +306 -228
- package/dist/modern/index.d.mts +4 -1
- package/dist/modern/index.d.ts +4 -1
- package/dist/modern/index.js +280 -202
- package/dist/modern/index.mjs +305 -228
- 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.enableSharingViews !== false && 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,54 @@ 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,
|
|
9926
|
+
enableSharingViews: props.enableSharingViews
|
|
9913
9927
|
}
|
|
9914
9928
|
)
|
|
9915
|
-
)
|
|
9916
|
-
|
|
9929
|
+
), presetViews.map((presetView) => {
|
|
9930
|
+
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === presetView.id;
|
|
9931
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
9932
|
+
Row,
|
|
9933
|
+
{
|
|
9934
|
+
key: presetView.id,
|
|
9935
|
+
item: presetView,
|
|
9936
|
+
selected: isSelected,
|
|
9937
|
+
ref: isSelected ? selectedRowRef : null
|
|
9938
|
+
},
|
|
9939
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
9940
|
+
SavedViewCollectionMenuItem,
|
|
9941
|
+
{
|
|
9942
|
+
item: presetView,
|
|
9943
|
+
selected: isSelected,
|
|
9944
|
+
enableSharingViews: props.enableSharingViews
|
|
9945
|
+
}
|
|
9946
|
+
)
|
|
9947
|
+
);
|
|
9948
|
+
}))
|
|
9949
|
+
), viewLevels.map((level) => {
|
|
9917
9950
|
const isExpanded = groups[level];
|
|
9918
9951
|
const views = isExpanded && savedViews ? savedViews.filter(
|
|
9919
9952
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
@@ -9925,49 +9958,61 @@ var PanelContent = (props) => {
|
|
|
9925
9958
|
toggleGroup,
|
|
9926
9959
|
expanded: isExpanded
|
|
9927
9960
|
}
|
|
9928
|
-
), views.
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9961
|
+
), isExpanded && views.length > 0 && /* @__PURE__ */ import_react9.default.createElement(
|
|
9962
|
+
StyledMenuImperative,
|
|
9963
|
+
{
|
|
9964
|
+
id: `saved-views-collections-${level}`,
|
|
9965
|
+
role: "listbox",
|
|
9966
|
+
onSelect: (selection) => {
|
|
9967
|
+
if ((selectedSavedView == null ? void 0 : selectedSavedView.id) !== selection.item.id) {
|
|
9968
|
+
props.onSelect({ item: selection.item });
|
|
9969
|
+
}
|
|
9970
|
+
}
|
|
9971
|
+
},
|
|
9972
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react7.MenuImperative.Options, null, views.map((view) => {
|
|
9973
|
+
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === view.id;
|
|
9974
|
+
const canUpdate = isSelected && hasPermissionForViewLevel(
|
|
9975
|
+
view.view_level,
|
|
9976
|
+
permissions
|
|
9977
|
+
) && !isEqual(
|
|
9978
|
+
view.table_config,
|
|
9979
|
+
tableConfig,
|
|
9980
|
+
props.defaultView.table_config,
|
|
9981
|
+
props.provider
|
|
9982
|
+
);
|
|
9983
|
+
const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
|
|
9984
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
9985
|
+
Row,
|
|
9950
9986
|
{
|
|
9951
|
-
item: view,
|
|
9952
9987
|
key: view.id,
|
|
9988
|
+
item: view,
|
|
9953
9989
|
selected: isSelected,
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
|
|
9990
|
+
ref: isSelected ? selectedRowRef : null
|
|
9991
|
+
},
|
|
9992
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
9993
|
+
SavedViewCollectionMenuItem,
|
|
9994
|
+
{
|
|
9995
|
+
item: view,
|
|
9996
|
+
key: view.id,
|
|
9997
|
+
selected: isSelected,
|
|
9998
|
+
canUpdate,
|
|
9999
|
+
canEditOrDelete,
|
|
10000
|
+
onUpdate: (data) => onUpdate(data),
|
|
10001
|
+
isUpdateProcessing: isUpdateLoading,
|
|
10002
|
+
onEdit: () => props.openModal("update" /* UPDATE */),
|
|
10003
|
+
onDelete: props.onDelete,
|
|
10004
|
+
permissions,
|
|
10005
|
+
enableSharingViews: props.enableSharingViews
|
|
10006
|
+
}
|
|
10007
|
+
)
|
|
10008
|
+
);
|
|
10009
|
+
}))
|
|
10010
|
+
));
|
|
9966
10011
|
})));
|
|
9967
10012
|
};
|
|
9968
10013
|
|
|
9969
10014
|
// src/components/saved-views/SavedViews.tsx
|
|
9970
|
-
var
|
|
10015
|
+
var import_core_react15 = require("@procore/core-react");
|
|
9971
10016
|
var import_react13 = __toESM(require("react"));
|
|
9972
10017
|
var import_react_query3 = require("@tanstack/react-query");
|
|
9973
10018
|
var import_toast_alert3 = require("@procore/toast-alert");
|
|
@@ -10000,8 +10045,8 @@ var SavedViewsDeleteConfirmationModalShared = ({
|
|
|
10000
10045
|
var import_react11 = __toESM(require("react"));
|
|
10001
10046
|
|
|
10002
10047
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10003
|
-
var
|
|
10004
|
-
var
|
|
10048
|
+
var import_core_react10 = require("@procore/core-react");
|
|
10049
|
+
var React20 = __toESM(require("react"));
|
|
10005
10050
|
var yup = __toESM(require("yup"));
|
|
10006
10051
|
|
|
10007
10052
|
// src/components/modals/form-modal/FormModalBaseUtils.ts
|
|
@@ -10038,8 +10083,39 @@ function extractMessage(error, I18n) {
|
|
|
10038
10083
|
return { form: I18n.t("savedViews.modal.errors.unknown") };
|
|
10039
10084
|
}
|
|
10040
10085
|
|
|
10086
|
+
// src/components/modals/form-modal/NameInputField.tsx
|
|
10087
|
+
var import_core_react9 = require("@procore/core-react");
|
|
10088
|
+
var React19 = __toESM(require("react"));
|
|
10089
|
+
var NAME_INPUT_ID = "saved-view-form-name-input";
|
|
10090
|
+
var NameInputField = ({
|
|
10091
|
+
error,
|
|
10092
|
+
onResetMutations
|
|
10093
|
+
}) => {
|
|
10094
|
+
const I18n = (0, import_core_react9.useI18nContext)();
|
|
10095
|
+
const label = I18n.t("savedViews.modal.fields.name");
|
|
10096
|
+
const { errors: formErrors, submitCount } = (0, import_core_react9.useFormContext)();
|
|
10097
|
+
React19.useEffect(() => {
|
|
10098
|
+
var _a;
|
|
10099
|
+
if (submitCount > 0 && (formErrors == null ? void 0 : formErrors.name)) {
|
|
10100
|
+
(_a = document.getElementById(NAME_INPUT_ID)) == null ? void 0 : _a.focus();
|
|
10101
|
+
}
|
|
10102
|
+
}, [formErrors == null ? void 0 : formErrors.name, submitCount]);
|
|
10103
|
+
return /* @__PURE__ */ React19.createElement(
|
|
10104
|
+
import_core_react9.Form.Text,
|
|
10105
|
+
{
|
|
10106
|
+
id: NAME_INPUT_ID,
|
|
10107
|
+
name: "name",
|
|
10108
|
+
error,
|
|
10109
|
+
placeholder: label,
|
|
10110
|
+
label,
|
|
10111
|
+
colWidth: 12,
|
|
10112
|
+
onChange: onResetMutations
|
|
10113
|
+
}
|
|
10114
|
+
);
|
|
10115
|
+
};
|
|
10116
|
+
|
|
10041
10117
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10042
|
-
var { useEffect:
|
|
10118
|
+
var { useEffect: useEffect3, useRef: useRef2 } = React20;
|
|
10043
10119
|
var ScrollContainer = styled_components_esm_default("div")`
|
|
10044
10120
|
overflow: auto;
|
|
10045
10121
|
`;
|
|
@@ -10059,10 +10135,10 @@ var FormModalBase = ({
|
|
|
10059
10135
|
onSelect,
|
|
10060
10136
|
backend
|
|
10061
10137
|
}) => {
|
|
10062
|
-
const I18n = (0,
|
|
10138
|
+
const I18n = (0, import_core_react10.useI18nContext)();
|
|
10063
10139
|
const NAME_MAX_LENGTH = 150;
|
|
10064
10140
|
const originalBodyWidth = useRef2("");
|
|
10065
|
-
|
|
10141
|
+
useEffect3(() => {
|
|
10066
10142
|
if (open) {
|
|
10067
10143
|
originalBodyWidth.current = document.body.style.width || "";
|
|
10068
10144
|
document.body.style.width = "100%";
|
|
@@ -10133,24 +10209,17 @@ var FormModalBase = ({
|
|
|
10133
10209
|
I18n,
|
|
10134
10210
|
isProjectLevelTool
|
|
10135
10211
|
);
|
|
10136
|
-
return /* @__PURE__ */
|
|
10137
|
-
|
|
10212
|
+
return /* @__PURE__ */ React20.createElement(
|
|
10213
|
+
import_core_react10.Modal,
|
|
10138
10214
|
{
|
|
10139
|
-
"
|
|
10140
|
-
|
|
10215
|
+
howToClose: ["x", "scrim"],
|
|
10216
|
+
onClose,
|
|
10141
10217
|
open,
|
|
10142
|
-
|
|
10218
|
+
width: "md",
|
|
10143
10219
|
"data-testid": "create-update-modal"
|
|
10144
10220
|
},
|
|
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,
|
|
10221
|
+
/* @__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(
|
|
10222
|
+
import_core_react10.Form,
|
|
10154
10223
|
{
|
|
10155
10224
|
initialValues: {
|
|
10156
10225
|
name: initialName,
|
|
@@ -10175,30 +10244,26 @@ var FormModalBase = ({
|
|
|
10175
10244
|
onReset: onCancel,
|
|
10176
10245
|
validateOnChange: true
|
|
10177
10246
|
},
|
|
10178
|
-
/* @__PURE__ */
|
|
10179
|
-
|
|
10247
|
+
/* @__PURE__ */ React20.createElement(import_core_react10.Form.Form, { name: header }, /* @__PURE__ */ React20.createElement(
|
|
10248
|
+
import_core_react10.Modal.Body,
|
|
10180
10249
|
{
|
|
10181
|
-
style: { paddingTop: 0, paddingBottom: 0, marginTop:
|
|
10250
|
+
style: { paddingTop: 0, paddingBottom: 0, marginTop: import_core_react10.spacing.lg }
|
|
10182
10251
|
},
|
|
10183
|
-
errors && /* @__PURE__ */
|
|
10184
|
-
/* @__PURE__ */
|
|
10185
|
-
|
|
10252
|
+
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}`)))),
|
|
10253
|
+
/* @__PURE__ */ React20.createElement(import_core_react10.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10254
|
+
NameInputField,
|
|
10186
10255
|
{
|
|
10187
|
-
name: "name",
|
|
10188
10256
|
error: errors == null ? void 0 : errors.name,
|
|
10189
|
-
|
|
10190
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10191
|
-
colWidth: 12,
|
|
10192
|
-
onChange: () => resetMutations()
|
|
10257
|
+
onResetMutations: resetMutations
|
|
10193
10258
|
}
|
|
10194
10259
|
)),
|
|
10195
|
-
/* @__PURE__ */
|
|
10196
|
-
|
|
10260
|
+
/* @__PURE__ */ React20.createElement(
|
|
10261
|
+
import_core_react10.Form.Row,
|
|
10197
10262
|
{
|
|
10198
|
-
style: { marginTop: (errors == null ? void 0 : errors.name) ?
|
|
10263
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? import_core_react10.spacing.xl : import_core_react10.spacing.none }
|
|
10199
10264
|
},
|
|
10200
|
-
/* @__PURE__ */
|
|
10201
|
-
|
|
10265
|
+
/* @__PURE__ */ React20.createElement(
|
|
10266
|
+
import_core_react10.Form.TextArea,
|
|
10202
10267
|
{
|
|
10203
10268
|
name: "description",
|
|
10204
10269
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10208,8 +10273,8 @@ var FormModalBase = ({
|
|
|
10208
10273
|
}
|
|
10209
10274
|
)
|
|
10210
10275
|
),
|
|
10211
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
10212
|
-
|
|
10276
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React20.createElement(import_core_react10.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10277
|
+
import_core_react10.Form.Select,
|
|
10213
10278
|
{
|
|
10214
10279
|
name: "view_level",
|
|
10215
10280
|
qa: { label: "view-level" },
|
|
@@ -10219,9 +10284,9 @@ var FormModalBase = ({
|
|
|
10219
10284
|
onSearch: false,
|
|
10220
10285
|
onClear: false
|
|
10221
10286
|
}
|
|
10222
|
-
)) : /* @__PURE__ */
|
|
10223
|
-
), /* @__PURE__ */
|
|
10224
|
-
|
|
10287
|
+
)) : /* @__PURE__ */ React20.createElement(React20.Fragment, null)
|
|
10288
|
+
), /* @__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(
|
|
10289
|
+
import_core_react10.Button,
|
|
10225
10290
|
{
|
|
10226
10291
|
"data-testid": "create-update-modal-button",
|
|
10227
10292
|
type: "submit",
|
|
@@ -10236,7 +10301,7 @@ var FormModalBase = ({
|
|
|
10236
10301
|
};
|
|
10237
10302
|
|
|
10238
10303
|
// src/components/modals/form-modal/FormModal.tsx
|
|
10239
|
-
var
|
|
10304
|
+
var import_core_react11 = require("@procore/core-react");
|
|
10240
10305
|
var FormModal = ({
|
|
10241
10306
|
open,
|
|
10242
10307
|
mode,
|
|
@@ -10250,7 +10315,7 @@ var FormModal = ({
|
|
|
10250
10315
|
defaultView,
|
|
10251
10316
|
backend
|
|
10252
10317
|
}) => {
|
|
10253
|
-
const i18n = (0,
|
|
10318
|
+
const i18n = (0, import_core_react11.useI18nContext)();
|
|
10254
10319
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
10255
10320
|
FormModalBase,
|
|
10256
10321
|
{
|
|
@@ -10273,8 +10338,8 @@ var FormModal = ({
|
|
|
10273
10338
|
};
|
|
10274
10339
|
|
|
10275
10340
|
// src/components/modals/form-modal/SharedViewFormModal.tsx
|
|
10276
|
-
var
|
|
10277
|
-
var
|
|
10341
|
+
var import_core_react12 = require("@procore/core-react");
|
|
10342
|
+
var React22 = __toESM(require("react"));
|
|
10278
10343
|
var yup2 = __toESM(require("yup"));
|
|
10279
10344
|
var SharedViewFormModal = ({
|
|
10280
10345
|
open,
|
|
@@ -10286,7 +10351,7 @@ var SharedViewFormModal = ({
|
|
|
10286
10351
|
isCreating,
|
|
10287
10352
|
resetCreateError
|
|
10288
10353
|
}) => {
|
|
10289
|
-
const I18n = (0,
|
|
10354
|
+
const I18n = (0, import_core_react12.useI18nContext)();
|
|
10290
10355
|
const NAME_MAX_LENGTH = 150;
|
|
10291
10356
|
const errors = extractMessage(createError, I18n);
|
|
10292
10357
|
const handleNameChange = () => {
|
|
@@ -10297,44 +10362,45 @@ var SharedViewFormModal = ({
|
|
|
10297
10362
|
const handleOnSubmit = (data) => {
|
|
10298
10363
|
onCreateView(data.name, data.description);
|
|
10299
10364
|
};
|
|
10300
|
-
return /* @__PURE__ */
|
|
10301
|
-
|
|
10365
|
+
return /* @__PURE__ */ React22.createElement(
|
|
10366
|
+
import_core_react12.Modal,
|
|
10302
10367
|
{
|
|
10303
10368
|
"data-testid": "shared-view-form-modal",
|
|
10304
10369
|
open,
|
|
10305
|
-
|
|
10370
|
+
howToClose: ["x", "scrim"],
|
|
10371
|
+
onClose,
|
|
10306
10372
|
style: { width: "540px" }
|
|
10307
10373
|
},
|
|
10308
|
-
/* @__PURE__ */
|
|
10309
|
-
|
|
10374
|
+
/* @__PURE__ */ React22.createElement(
|
|
10375
|
+
import_core_react12.Modal.Header,
|
|
10310
10376
|
{
|
|
10311
10377
|
onClose,
|
|
10312
10378
|
style: {
|
|
10313
|
-
paddingTop:
|
|
10314
|
-
paddingBottom:
|
|
10315
|
-
paddingLeft:
|
|
10316
|
-
paddingRight:
|
|
10379
|
+
paddingTop: import_core_react12.spacing.lg,
|
|
10380
|
+
paddingBottom: import_core_react12.spacing.xs,
|
|
10381
|
+
paddingLeft: import_core_react12.spacing.xl,
|
|
10382
|
+
paddingRight: import_core_react12.spacing.xl
|
|
10317
10383
|
}
|
|
10318
10384
|
},
|
|
10319
|
-
I18n.t("savedViews.modal.create.title")
|
|
10385
|
+
/* @__PURE__ */ React22.createElement(import_core_react12.Modal.Heading, null, I18n.t("savedViews.modal.create.title"))
|
|
10320
10386
|
),
|
|
10321
|
-
/* @__PURE__ */
|
|
10322
|
-
|
|
10387
|
+
/* @__PURE__ */ React22.createElement(
|
|
10388
|
+
import_core_react12.P,
|
|
10323
10389
|
{
|
|
10324
10390
|
style: {
|
|
10325
|
-
paddingLeft:
|
|
10326
|
-
paddingRight:
|
|
10327
|
-
paddingBottom:
|
|
10328
|
-
paddingTop:
|
|
10391
|
+
paddingLeft: import_core_react12.spacing.xl,
|
|
10392
|
+
paddingRight: import_core_react12.spacing.xl,
|
|
10393
|
+
paddingBottom: import_core_react12.spacing.lg,
|
|
10394
|
+
paddingTop: import_core_react12.spacing.none,
|
|
10329
10395
|
margin: 0,
|
|
10330
|
-
color:
|
|
10396
|
+
color: import_core_react12.colors.gray45,
|
|
10331
10397
|
whiteSpace: "pre-line"
|
|
10332
10398
|
}
|
|
10333
10399
|
},
|
|
10334
10400
|
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
10335
10401
|
),
|
|
10336
|
-
/* @__PURE__ */
|
|
10337
|
-
|
|
10402
|
+
/* @__PURE__ */ React22.createElement(
|
|
10403
|
+
import_core_react12.Form,
|
|
10338
10404
|
{
|
|
10339
10405
|
initialValues: {
|
|
10340
10406
|
name: fetchedView.name,
|
|
@@ -10352,36 +10418,32 @@ var SharedViewFormModal = ({
|
|
|
10352
10418
|
onSubmit: handleOnSubmit,
|
|
10353
10419
|
validateOnChange: true
|
|
10354
10420
|
},
|
|
10355
|
-
/* @__PURE__ */
|
|
10356
|
-
|
|
10421
|
+
/* @__PURE__ */ React22.createElement(import_core_react12.Form.Form, { name: "share-view-form" }, /* @__PURE__ */ React22.createElement(
|
|
10422
|
+
import_core_react12.Modal.Body,
|
|
10357
10423
|
{
|
|
10358
10424
|
style: {
|
|
10359
|
-
paddingTop:
|
|
10425
|
+
paddingTop: import_core_react12.spacing.lg,
|
|
10360
10426
|
paddingBottom: 0,
|
|
10361
|
-
borderTop: `1px solid ${
|
|
10427
|
+
borderTop: `1px solid ${import_core_react12.colors.gray85}`
|
|
10362
10428
|
}
|
|
10363
10429
|
},
|
|
10364
|
-
errors && /* @__PURE__ */
|
|
10430
|
+
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
10431
|
mode: "create"
|
|
10366
|
-
})), /* @__PURE__ */
|
|
10367
|
-
/* @__PURE__ */
|
|
10368
|
-
|
|
10432
|
+
})), /* @__PURE__ */ React22.createElement(import_core_react12.Banner.Body, null, (errors == null ? void 0 : errors.form) || I18n.t("savedViews.modal.errors.description.create")))),
|
|
10433
|
+
/* @__PURE__ */ React22.createElement(import_core_react12.Form.Row, null, /* @__PURE__ */ React22.createElement(
|
|
10434
|
+
NameInputField,
|
|
10369
10435
|
{
|
|
10370
|
-
name: "name",
|
|
10371
10436
|
error: errors == null ? void 0 : errors.name,
|
|
10372
|
-
|
|
10373
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10374
|
-
colWidth: 12,
|
|
10375
|
-
onChange: handleNameChange
|
|
10437
|
+
onResetMutations: handleNameChange
|
|
10376
10438
|
}
|
|
10377
10439
|
)),
|
|
10378
|
-
/* @__PURE__ */
|
|
10379
|
-
|
|
10440
|
+
/* @__PURE__ */ React22.createElement(
|
|
10441
|
+
import_core_react12.Form.Row,
|
|
10380
10442
|
{
|
|
10381
|
-
style: { marginTop: (errors == null ? void 0 : errors.name) ?
|
|
10443
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? import_core_react12.spacing.xl : import_core_react12.spacing.none }
|
|
10382
10444
|
},
|
|
10383
|
-
/* @__PURE__ */
|
|
10384
|
-
|
|
10445
|
+
/* @__PURE__ */ React22.createElement(
|
|
10446
|
+
import_core_react12.Form.TextArea,
|
|
10385
10447
|
{
|
|
10386
10448
|
name: "description",
|
|
10387
10449
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10391,8 +10453,8 @@ var SharedViewFormModal = ({
|
|
|
10391
10453
|
}
|
|
10392
10454
|
)
|
|
10393
10455
|
)
|
|
10394
|
-
), /* @__PURE__ */
|
|
10395
|
-
|
|
10456
|
+
), /* @__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(
|
|
10457
|
+
import_core_react12.Button,
|
|
10396
10458
|
{
|
|
10397
10459
|
variant: "secondary",
|
|
10398
10460
|
onClick: onCreateTemporaryView,
|
|
@@ -10400,8 +10462,8 @@ var SharedViewFormModal = ({
|
|
|
10400
10462
|
disabled: isCreating
|
|
10401
10463
|
},
|
|
10402
10464
|
I18n.t("savedViews.actions.viewTemporarily")
|
|
10403
|
-
), /* @__PURE__ */
|
|
10404
|
-
|
|
10465
|
+
), /* @__PURE__ */ React22.createElement(
|
|
10466
|
+
import_core_react12.Button,
|
|
10405
10467
|
{
|
|
10406
10468
|
type: "submit",
|
|
10407
10469
|
variant: "primary",
|
|
@@ -10418,7 +10480,7 @@ var SharedViewFormModal = ({
|
|
|
10418
10480
|
// src/utils/hooks/useViewSelection.ts
|
|
10419
10481
|
var import_react12 = require("react");
|
|
10420
10482
|
var import_react_router_dom = require("react-router-dom");
|
|
10421
|
-
var
|
|
10483
|
+
var import_core_react13 = require("@procore/core-react");
|
|
10422
10484
|
|
|
10423
10485
|
// src/utils/viewStorage.ts
|
|
10424
10486
|
var ViewStorage = {
|
|
@@ -10481,7 +10543,7 @@ var restoreUrlParameter = (currentParam, previousParam, setSearchParams) => {
|
|
|
10481
10543
|
}
|
|
10482
10544
|
};
|
|
10483
10545
|
var useViewSelection = (config, savedViews, presetViews, openSharedViewModal) => {
|
|
10484
|
-
const I18n = (0,
|
|
10546
|
+
const I18n = (0, import_core_react13.useI18nContext)();
|
|
10485
10547
|
const projectIdSegment = config.projectId ?? "company";
|
|
10486
10548
|
const storageKey = `savedView_${config.domain}_${config.tableName}_${config.companyId}_${projectIdSegment}_${config.userId}`;
|
|
10487
10549
|
const temporaryStorageKey = `${storageKey}-temporary`;
|
|
@@ -10588,7 +10650,7 @@ var import_react_query2 = require("@tanstack/react-query");
|
|
|
10588
10650
|
// src/utils/api/queriesHandler.ts
|
|
10589
10651
|
var import_core_http = require("@procore/core-http");
|
|
10590
10652
|
var import_react_query = require("@tanstack/react-query");
|
|
10591
|
-
var
|
|
10653
|
+
var import_core_react14 = require("@procore/core-react");
|
|
10592
10654
|
var getBasePath = (companyId, projectId) => {
|
|
10593
10655
|
if (projectId) {
|
|
10594
10656
|
return `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views`;
|
|
@@ -10598,7 +10660,7 @@ var getBasePath = (companyId, projectId) => {
|
|
|
10598
10660
|
var useApiRequest = (props, method, mutationKey) => {
|
|
10599
10661
|
const { projectId, companyId, domain, tableName } = props;
|
|
10600
10662
|
const queryClient2 = (0, import_react_query.useQueryClient)();
|
|
10601
|
-
const { locale } = (0,
|
|
10663
|
+
const { locale } = (0, import_core_react14.useI18nContext)();
|
|
10602
10664
|
const basePath = getBasePath(companyId, projectId);
|
|
10603
10665
|
const queryKey = ["savedViews", domain, tableName, companyId, projectId];
|
|
10604
10666
|
return (0, import_react_query.useMutation)({
|
|
@@ -10745,7 +10807,7 @@ var SavedViewsContent = (props) => {
|
|
|
10745
10807
|
const { data: savedViews } = backend.useSavedViewsQuery(queryInput);
|
|
10746
10808
|
const { mutate: deleteSavedView } = backend.useDeleteSavedView(queryInput);
|
|
10747
10809
|
const { showToast } = (0, import_toast_alert3.useToastAlertContext)();
|
|
10748
|
-
const i18n = (0,
|
|
10810
|
+
const i18n = (0, import_core_react15.useI18nContext)();
|
|
10749
10811
|
const [activeModal, setActiveModal] = (0, import_react13.useState)(null);
|
|
10750
10812
|
const [modalData, setModalData] = (0, import_react13.useState)(null);
|
|
10751
10813
|
const openModal = (type, data) => {
|
|
@@ -10845,14 +10907,28 @@ var SavedViewsContent = (props) => {
|
|
|
10845
10907
|
"data-testid": "saved-view-expanded-panel",
|
|
10846
10908
|
provider: props.provider
|
|
10847
10909
|
},
|
|
10848
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10849
|
-
|
|
10910
|
+
/* @__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(
|
|
10911
|
+
import_core_react15.Tooltip,
|
|
10912
|
+
{
|
|
10913
|
+
showDelay: 200,
|
|
10914
|
+
overlay: /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Tooltip.Content, null, i18n.t("savedViews.tooltip"))
|
|
10915
|
+
},
|
|
10916
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10917
|
+
Help_default,
|
|
10918
|
+
{
|
|
10919
|
+
tabIndex: 0,
|
|
10920
|
+
size: "sm",
|
|
10921
|
+
"aria-label": i18n.t("savedViews.tooltip")
|
|
10922
|
+
}
|
|
10923
|
+
)
|
|
10924
|
+
))), /* @__PURE__ */ import_react13.default.createElement(
|
|
10925
|
+
import_core_react15.Tooltip,
|
|
10850
10926
|
{
|
|
10851
10927
|
overlay: i18n.t("savedViews.actions.create"),
|
|
10852
10928
|
showDelay: 1e3
|
|
10853
10929
|
},
|
|
10854
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10855
|
-
|
|
10930
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10931
|
+
import_core_react15.Button,
|
|
10856
10932
|
{
|
|
10857
10933
|
icon: /* @__PURE__ */ import_react13.default.createElement(Plus_default, null),
|
|
10858
10934
|
variant: "secondary",
|
|
@@ -10861,9 +10937,9 @@ var SavedViewsContent = (props) => {
|
|
|
10861
10937
|
"aria-label": i18n.t("savedViews.actions.create")
|
|
10862
10938
|
},
|
|
10863
10939
|
i18n.t("savedViews.actions.create")
|
|
10864
|
-
)
|
|
10940
|
+
)
|
|
10865
10941
|
)),
|
|
10866
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10942
|
+
/* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ import_react13.default.createElement(
|
|
10867
10943
|
PanelContent,
|
|
10868
10944
|
{
|
|
10869
10945
|
onSelect: ({ item }) => selectView(item),
|
|
@@ -10876,9 +10952,10 @@ var SavedViewsContent = (props) => {
|
|
|
10876
10952
|
presetViews: props.presetViews,
|
|
10877
10953
|
savedViews: allViews,
|
|
10878
10954
|
provider: props.provider,
|
|
10879
|
-
userId: props.userId
|
|
10955
|
+
userId: props.userId,
|
|
10880
10956
|
onClearTemporary: clearTemporaryView,
|
|
10881
|
-
backend
|
|
10957
|
+
backend,
|
|
10958
|
+
enableSharingViews: props.enableSharingViews
|
|
10882
10959
|
}
|
|
10883
10960
|
))
|
|
10884
10961
|
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */ import_react13.default.createElement(
|
|
@@ -11101,7 +11178,8 @@ var SmartGridSavedViews = (props) => {
|
|
|
11101
11178
|
presetViews,
|
|
11102
11179
|
tableName: props.tableName,
|
|
11103
11180
|
tableConfig,
|
|
11104
|
-
backend: props.backend
|
|
11181
|
+
backend: props.backend,
|
|
11182
|
+
enableSharingViews: props.enableSharingViews
|
|
11105
11183
|
}
|
|
11106
11184
|
);
|
|
11107
11185
|
};
|
|
@@ -11215,7 +11293,8 @@ var DataTableSavedViews = (0, import_react18.forwardRef)((props, ref) => {
|
|
|
11215
11293
|
defaultView,
|
|
11216
11294
|
presetViews,
|
|
11217
11295
|
tableName: props.tableName,
|
|
11218
|
-
tableConfig: internalTableConfig
|
|
11296
|
+
tableConfig: internalTableConfig,
|
|
11297
|
+
enableSharingViews: props.enableSharingViews
|
|
11219
11298
|
}
|
|
11220
11299
|
);
|
|
11221
11300
|
});
|