diff --git a/platform/wab/plasmic.json b/platform/wab/plasmic.json
index c787d93cb05..8a1a8d9856e 100644
--- a/platform/wab/plasmic.json
+++ b/platform/wab/plasmic.json
@@ -576,7 +576,8 @@
"indirect": false,
"globalContextsFilePath": "",
"splitsProviderFilePath": "",
- "customFunctions": []
+ "customFunctions": [],
+ "jsBundleThemes": []
},
{
"projectId": "ooL7EhXDmFQWnW9sxtchhE",
@@ -8815,8 +8816,8 @@
"componentImportPath": "@plasmicapp/react-web/lib/data-sources"
}
],
- "jsBundleThemes": [],
- "splitsProviderFilePath": ""
+ "splitsProviderFilePath": "",
+ "customFunctions": []
},
{
"projectId": "gtUDvxG6cmBbSzqLikNzoP",
@@ -11071,6 +11072,6 @@
"postSyncCommands": [
"git ls-files -m | xargs pre-commit run prettier --files"
],
- "cliVersion": "0.1.322",
- "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.322/dist/plasmic.schema.json"
+ "cliVersion": "0.1.325",
+ "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.325/dist/plasmic.schema.json"
}
diff --git a/platform/wab/plasmic.lock b/platform/wab/plasmic.lock
index c67be846592..447eaf80c3b 100644
--- a/platform/wab/plasmic.lock
+++ b/platform/wab/plasmic.lock
@@ -7640,7 +7640,7 @@
},
{
"projectId": "ieacQ3Z46z4gwo1FnaB5vY",
- "version": "3.0.1",
+ "version": "4.0.0",
"dependencies": {
"tXkSR39sgCDWSitZxC5xFV": "75.3.1",
"oT38tGyqov9SPWHpf3Y2Rf": "4.7.0",
@@ -7657,112 +7657,112 @@
{
"type": "renderModule",
"assetId": "FxC1c7NZtR",
- "checksum": "f82a417131ff56886c059db3923fa92e"
+ "checksum": "6a3131466a3d2a738d6827c93e27d832"
},
{
"type": "cssRules",
"assetId": "FxC1c7NZtR",
- "checksum": "f82a417131ff56886c059db3923fa92e"
+ "checksum": "6a3131466a3d2a738d6827c93e27d832"
},
{
"type": "renderModule",
"assetId": "kX5_DA_mZR",
- "checksum": "b3d490c6d240ab1ea271ff8625170eda"
+ "checksum": "ac8484e27b480dc7e29505b3a7fd4e46"
},
{
"type": "cssRules",
"assetId": "kX5_DA_mZR",
- "checksum": "b3d490c6d240ab1ea271ff8625170eda"
+ "checksum": "ac8484e27b480dc7e29505b3a7fd4e46"
},
{
"type": "renderModule",
"assetId": "fC6EeUMrpE",
- "checksum": "29cdae091f4d0ce21889ea8904e5c670"
+ "checksum": "acd8a719a39fef84320dc2d42caf7344"
},
{
"type": "cssRules",
"assetId": "fC6EeUMrpE",
- "checksum": "29cdae091f4d0ce21889ea8904e5c670"
+ "checksum": "acd8a719a39fef84320dc2d42caf7344"
},
{
"type": "renderModule",
"assetId": "M3aa84scyXT",
- "checksum": "faa7a80ca51a37a6fd24be75182d1dbe"
+ "checksum": "556615e52ff03402d806f84c2795d9cc"
},
{
"type": "cssRules",
"assetId": "M3aa84scyXT",
- "checksum": "faa7a80ca51a37a6fd24be75182d1dbe"
+ "checksum": "556615e52ff03402d806f84c2795d9cc"
},
{
"type": "renderModule",
"assetId": "FpZFUfiTA6",
- "checksum": "8a40f378f4698e5446cbf382dc502c05"
+ "checksum": "c2a25d5a0598e9cb1c93f76b7c102c06"
},
{
"type": "cssRules",
"assetId": "FpZFUfiTA6",
- "checksum": "8a40f378f4698e5446cbf382dc502c05"
+ "checksum": "c2a25d5a0598e9cb1c93f76b7c102c06"
},
{
"type": "renderModule",
"assetId": "girCdMST6R",
- "checksum": "de075d1a032621446be780abb94768f1"
+ "checksum": "d6db92b395dcd97a7d073914d28c0efd"
},
{
"type": "cssRules",
"assetId": "girCdMST6R",
- "checksum": "de075d1a032621446be780abb94768f1"
+ "checksum": "d6db92b395dcd97a7d073914d28c0efd"
},
{
"type": "renderModule",
"assetId": "k2vc2stl18",
- "checksum": "754bbd05aefcdae928962fbb45a139dd"
+ "checksum": "7691d46eef02acf7c29f3a9d83c35ed7"
},
{
"type": "cssRules",
"assetId": "k2vc2stl18",
- "checksum": "754bbd05aefcdae928962fbb45a139dd"
+ "checksum": "7691d46eef02acf7c29f3a9d83c35ed7"
},
{
"type": "renderModule",
"assetId": "9vM3ZFGR4eV",
- "checksum": "3a98421ad015ad6a815f797624bce7ea"
+ "checksum": "19868deece2805abbf23ba4920cc5b14"
},
{
"type": "cssRules",
"assetId": "9vM3ZFGR4eV",
- "checksum": "3a98421ad015ad6a815f797624bce7ea"
+ "checksum": "19868deece2805abbf23ba4920cc5b14"
},
{
"type": "renderModule",
"assetId": "FiuFB1wXjp",
- "checksum": "ede12d91012043471296a84f0b4297b0"
+ "checksum": "107becdf96040277d7c8ff46856fd563"
},
{
"type": "cssRules",
"assetId": "FiuFB1wXjp",
- "checksum": "ede12d91012043471296a84f0b4297b0"
+ "checksum": "107becdf96040277d7c8ff46856fd563"
},
{
"type": "renderModule",
"assetId": "y1ZiXuS8BD",
- "checksum": "985be79a466f1e94f0f149407067e353"
+ "checksum": "27a640d634db6b3100a87de84d3e4d31"
},
{
"type": "cssRules",
"assetId": "y1ZiXuS8BD",
- "checksum": "985be79a466f1e94f0f149407067e353"
+ "checksum": "27a640d634db6b3100a87de84d3e4d31"
},
{
"type": "renderModule",
"assetId": "pLQf-lY112u",
- "checksum": "cbbe117b5b2b54ff6b3e3fe9967bd5b7"
+ "checksum": "b7a6068e00ff68b3509746f187a08361"
},
{
"type": "cssRules",
"assetId": "pLQf-lY112u",
- "checksum": "cbbe117b5b2b54ff6b3e3fe9967bd5b7"
+ "checksum": "b7a6068e00ff68b3509746f187a08361"
},
{
"type": "icon",
@@ -7782,22 +7782,22 @@
{
"type": "renderModule",
"assetId": "Tz8Unep1qu",
- "checksum": "c840133efc8d0dc5fc704fcfb9231819"
+ "checksum": "e3b8f7edebe52e0947d45fe721b00a9d"
},
{
"type": "cssRules",
"assetId": "Tz8Unep1qu",
- "checksum": "c840133efc8d0dc5fc704fcfb9231819"
+ "checksum": "e3b8f7edebe52e0947d45fe721b00a9d"
},
{
"type": "renderModule",
"assetId": "a5viGetjMi",
- "checksum": "fac09e398b86da763c8977706c2c651d"
+ "checksum": "ffd47de83e11deb0292c44845f4371ea"
},
{
"type": "cssRules",
"assetId": "a5viGetjMi",
- "checksum": "fac09e398b86da763c8977706c2c651d"
+ "checksum": "ffd47de83e11deb0292c44845f4371ea"
},
{
"type": "icon",
diff --git a/platform/wab/src/wab/client/components/cms/CmsEntriesList.tsx b/platform/wab/src/wab/client/components/cms/CmsEntriesList.tsx
index 5c3710be9b7..7aceafa9989 100644
--- a/platform/wab/src/wab/client/components/cms/CmsEntriesList.tsx
+++ b/platform/wab/src/wab/client/components/cms/CmsEntriesList.tsx
@@ -1,23 +1,19 @@
// This is a skeleton starter React component generated by Plasmic.
// This file is owned by you, feel free to edit as you see fit.
-import { HTMLElementRefOf } from "@plasmicapp/react-web";
-import * as React from "react";
-import { useHistory, useRouteMatch } from "react-router";
-import {
- ApiCmseRow,
- CmsDatabaseId,
- CmsTableId,
-} from "../../../shared/ApiSchema";
-import { UU } from "../../cli-routes";
-import { useApi } from "../../contexts/AppContexts";
+import { UU } from "@/wab/client/cli-routes";
+import { Spinner } from "@/wab/client/components/widgets";
+import { useApi } from "@/wab/client/contexts/AppContexts";
import {
DefaultCmsEntriesListProps,
PlasmicCmsEntriesList,
-} from "../../plasmic/plasmic_kit_cms/PlasmicCmsEntriesList";
-import { Spinner } from "../widgets";
+} from "@/wab/client/plasmic/plasmic_kit_cms/PlasmicCmsEntriesList";
+import { ApiCmseRow, CmsDatabaseId, CmsTableId } from "@/wab/shared/ApiSchema";
+import { HTMLElementRefOf } from "@plasmicapp/react-web";
+import fastStringify from "fast-stringify";
+import * as React from "react";
+import { useHistory, useRouteMatch } from "react-router";
import { useCmsTable, useMutateTableRows } from "./cms-contexts";
import CmsEntryItem from "./CmsEntryItem";
-import fastStringify from "fast-stringify";
export interface CmsEntriesListProps extends DefaultCmsEntriesListProps {
rows?: ApiCmseRow[];
@@ -30,8 +26,10 @@ function CmsEntriesList_(
const { rows, ...rest } = props;
const api = useApi();
const history = useHistory();
- const match =
- useRouteMatch<{ databaseId: CmsDatabaseId; tableId: CmsTableId }>();
+ const match = useRouteMatch<{
+ databaseId: CmsDatabaseId;
+ tableId: CmsTableId;
+ }>();
const { databaseId, tableId } = match.params;
const table = useCmsTable(databaseId, tableId);
const mutateTableRows = useMutateTableRows();
@@ -40,7 +38,7 @@ function CmsEntriesList_(
if (!rows || !table) {
return ;
}
- const filteredRows = rows?.filter((row) =>
+ const filteredRows = rows?.filter((row) =>
fastStringify(Object.values(row))
.toLowerCase()
.includes(query.toLowerCase())
@@ -51,18 +49,19 @@ function CmsEntriesList_(
{...rest}
root={{ ref }}
modelName={table.name}
- searchInput={{
- value: query,
- onChange: (e) => setQuery(e.target.value),
- }}
+ // searchInput={{
+ // value: query,
+ // onChange: (e) => setQuery(e.target.value),
+ // }}
children={
<>
- {filteredRows ?
- filteredRows.map((row) => (
-
- )): rows.map((row) => (
-
- ))}
+ {filteredRows
+ ? filteredRows.map((row) => (
+
+ ))
+ : rows.map((row) => (
+
+ ))}
>
}
addButton={{
diff --git a/platform/wab/src/wab/client/components/cms/CmsEntryDetails.tsx b/platform/wab/src/wab/client/components/cms/CmsEntryDetails.tsx
index 19927ebd6a0..08abb61c549 100644
--- a/platform/wab/src/wab/client/components/cms/CmsEntryDetails.tsx
+++ b/platform/wab/src/wab/client/components/cms/CmsEntryDetails.tsx
@@ -16,6 +16,7 @@ import {
CmsRowId,
CmsTableId,
} from "@/wab/shared/ApiSchema";
+import { substituteUrlParams } from "@/wab/shared/utils/url-utils";
import { HTMLElementRefOf } from "@plasmicapp/react-web";
import { Drawer, Form, Menu, message, notification, Tooltip } from "antd";
import { useForm } from "antd/lib/form/Form";
@@ -421,6 +422,24 @@ function CmsEntryDetailsForm_(
}
}
+ previewButton={
+ table.settings?.previewUrl
+ ? {
+ props: {
+ href: substituteUrlParams(
+ table.settings.previewUrl,
+ (row.draftData?.[""] ?? row.data?.[""] ?? {}) as Record<
+ string,
+ string
+ >
+ ),
+ target: "_blank",
+ },
+ }
+ : {
+ render: () => null,
+ }
+ }
publishButton={{
render: (ps, Comp) => (
// Wrap in Form.Item so it can react to form error state
@@ -449,6 +468,24 @@ function CmsEntryDetailsForm_(
content: "Your changes have been published.",
duration: 5,
});
+ const hooks = table.settings?.webhooks?.filter(
+ (hook) => hook.event === "publish"
+ );
+ if (hooks && hooks.length > 0) {
+ const hooksResp = await api.triggerCmsTableWebhooks(
+ table.id,
+ "publish"
+ );
+ const failed = hooksResp.responses.filter(
+ (r) => r.status !== 200
+ );
+ if (failed.length > 0) {
+ await message.warning({
+ content: "Some publish hooks failed.",
+ duration: 5,
+ });
+ }
+ }
}
}}
disabled={
diff --git a/platform/wab/src/wab/client/components/cms/CmsModelDetails.tsx b/platform/wab/src/wab/client/components/cms/CmsModelDetails.tsx
index a6aa9781c9b..f47609e15e6 100644
--- a/platform/wab/src/wab/client/components/cms/CmsModelDetails.tsx
+++ b/platform/wab/src/wab/client/components/cms/CmsModelDetails.tsx
@@ -1,33 +1,55 @@
-import { HTMLElementRefOf } from "@plasmicapp/react-web";
-import { Collapse, Dropdown, Form, InputNumber, Menu, message } from "antd";
-import { FormInstance, useForm } from "antd/lib/form/Form";
-import L, { isEqual, sortBy } from "lodash";
-import * as React from "react";
-import { Prompt, useHistory } from "react-router";
-import { useBeforeUnload } from "react-use";
-import { ensureType, jsonClone, tuple, uniqueName } from "../../../common";
+import { useRRouteMatch, UU } from "@/wab/client/cli-routes";
+import PlasmicWebhookHeader from "@/wab/client/components/webhooks/plasmic/plasmic_kit_continuous_deployment/PlasmicWebhookHeader";
+import PlasmicWebhooksItem from "@/wab/client/components/webhooks/plasmic/plasmic_kit_continuous_deployment/PlasmicWebhooksItem";
+import { Spinner } from "@/wab/client/components/widgets";
+import Button from "@/wab/client/components/widgets/Button";
+import { Icon } from "@/wab/client/components/widgets/Icon";
+import { Modal } from "@/wab/client/components/widgets/Modal";
+import Select from "@/wab/client/components/widgets/Select";
+import Textbox from "@/wab/client/components/widgets/Textbox";
+import { useApi } from "@/wab/client/contexts/AppContexts";
+import PlusIcon from "@/wab/client/plasmic/plasmic_kit/PlasmicIcon__Plus";
+import Trash2Icon from "@/wab/client/plasmic/plasmic_kit/PlasmicIcon__Trash2";
+import {
+ DefaultCmsModelDetailsProps,
+ PlasmicCmsModelDetails,
+} from "@/wab/client/plasmic/plasmic_kit_cms/PlasmicCmsModelDetails";
+import {
+ ensureType,
+ jsonClone,
+ remove,
+ spawn,
+ tuple,
+ uniqueName,
+} from "@/wab/common";
+import { extractParamsFromPagePath } from "@/wab/components";
import {
ApiCmsDatabase,
CmsDatabaseId,
CmsFieldMeta,
cmsFieldMetaDefaults,
CmsTableId,
+ CmsTableSettings,
CmsTypeMeta,
CmsTypeName,
cmsTypes,
-} from "../../../shared/ApiSchema";
-import { useRRouteMatch, UU } from "../../cli-routes";
-import { useApi } from "../../contexts/AppContexts";
-import PlusIcon from "../../plasmic/plasmic_kit/PlasmicIcon__Plus";
-import Trash2Icon from "../../plasmic/plasmic_kit/PlasmicIcon__Trash2";
+} from "@/wab/shared/ApiSchema";
+import { httpMethods } from "@/wab/shared/HttpClientUtil";
+import { HTMLElementRefOf } from "@plasmicapp/react-web";
import {
- DefaultCmsModelDetailsProps,
- PlasmicCmsModelDetails,
-} from "../../plasmic/plasmic_kit_cms/PlasmicCmsModelDetails";
-import Button from "../widgets/Button";
-import { Icon } from "../widgets/Icon";
-import Select from "../widgets/Select";
-import Textbox from "../widgets/Textbox";
+ Collapse,
+ Dropdown,
+ Form,
+ Input,
+ InputNumber,
+ Menu,
+ message,
+} from "antd";
+import { FormInstance, useForm } from "antd/lib/form/Form";
+import L, { isEqual, sortBy } from "lodash";
+import * as React from "react";
+import { Prompt, useHistory } from "react-router";
+import { useBeforeUnload } from "react-use";
import { useCmsDatabase, useCmsTable, useMutateTable } from "./cms-contexts";
import {
ContentEntryFormContext,
@@ -36,7 +58,7 @@ import {
ValueSwitch,
} from "./CmsInputs";
-export interface CmsModelDetailsProps extends DefaultCmsModelDetailsProps {}
+export type CmsModelDetailsProps = DefaultCmsModelDetailsProps;
function renderTypeSpecificSubform(
database: ApiCmsDatabase,
@@ -62,7 +84,6 @@ function renderTypeSpecificSubform(
fieldPathSuffix: [],
formItemProps: { label: "Default value" },
typeName: typeMeta.type,
-
})}
{(typeName === "text" || typeName === "long-text") && (
@@ -308,6 +329,7 @@ function CmsModelDetails_(
const match = useRRouteMatch(UU.cmsModelSchema)!;
const history = useHistory();
const { databaseId, tableId } = match.params;
+ const [showSettingsModal, setShowSettingsModal] = React.useState(false);
const database = useCmsDatabase(databaseId);
@@ -417,6 +439,15 @@ function CmsModelDetails_(
menuButton={{
menu: () => (