@drawbridge/components 0.1.24 → 0.1.26

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.
@@ -48,15 +48,16 @@ const FormOrganizationCampaignIntegrationGtm = ({
48
48
  }) => {
49
49
  const { control, handleSubmit, formState } = (0, import_form.useForm)({
50
50
  defaultValues: values,
51
+ // @story integrations/gtm
52
+ // The container is needed only to run: off saves with it blank. On,
53
+ // or with anything typed, every rule applies. The api checks the same.
51
54
  resolver: (0, import_yup.resolver)(
52
- import_yup.default.object({
55
+ import_yup.default.lazy(({ enabled, settings }) => import_yup.default.object({
53
56
  enabled: import_yup.default.boolean(),
54
- // Container ID is required whether or not the integration is
55
- // enabled — a disabled-and-empty GTM integration is just noise.
56
57
  settings: import_yup.default.object({
57
- containerId: import_yup.default.string().label("Container ID").required().min(10).max(20).matches(/^\S*$/, "Container ID must not contain spaces").prefix("GTM", 3)
58
+ containerId: !enabled && !(settings == null ? void 0 : settings.containerId) ? import_yup.default.string().label("Container ID") : import_yup.default.string().label("Container ID").required().min(10).max(20).matches(/^\S*$/, "Container ID must not contain spaces").prefix("GTM", 3)
58
59
  })
59
- })
60
+ }))
60
61
  )
61
62
  });
62
63
  const onSubmit = async ({
@@ -16,15 +16,16 @@ const FormOrganizationCampaignIntegrationGtm = ({
16
16
  }) => {
17
17
  const { control, handleSubmit, formState } = useForm({
18
18
  defaultValues: values,
19
+ // @story integrations/gtm
20
+ // The container is needed only to run: off saves with it blank. On,
21
+ // or with anything typed, every rule applies. The api checks the same.
19
22
  resolver: resolver(
20
- yup.object({
23
+ yup.lazy(({ enabled, settings }) => yup.object({
21
24
  enabled: yup.boolean(),
22
- // Container ID is required whether or not the integration is
23
- // enabled — a disabled-and-empty GTM integration is just noise.
24
25
  settings: yup.object({
25
- containerId: yup.string().label("Container ID").required().min(10).max(20).matches(/^\S*$/, "Container ID must not contain spaces").prefix("GTM", 3)
26
+ containerId: !enabled && !(settings == null ? void 0 : settings.containerId) ? yup.string().label("Container ID") : yup.string().label("Container ID").required().min(10).max(20).matches(/^\S*$/, "Container ID must not contain spaces").prefix("GTM", 3)
26
27
  })
27
- })
28
+ }))
28
29
  )
29
30
  });
30
31
  const onSubmit = async ({
@@ -363,6 +363,9 @@ const TemplateSocketOrganization = ({
363
363
  queryClient.invalidateQueries({
364
364
  queryKey: ["organization-segments", params.organization]
365
365
  });
366
+ queryClient.invalidateQueries({
367
+ queryKey: ["menu", "organization", params.organization]
368
+ });
366
369
  },
367
370
  "organization.export": () => {
368
371
  queryClient.invalidateQueries({
@@ -328,6 +328,9 @@ const TemplateSocketOrganization = ({
328
328
  queryClient.invalidateQueries({
329
329
  queryKey: ["organization-segments", params.organization]
330
330
  });
331
+ queryClient.invalidateQueries({
332
+ queryKey: ["menu", "organization", params.organization]
333
+ });
331
334
  },
332
335
  "organization.export": () => {
333
336
  queryClient.invalidateQueries({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawbridge/components",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "exports": {
5
5
  "./advertisement": {
6
6
  "types": "./types/advertisement.d.ts",