Skip to content

Commit

Permalink
fix(api-headless-cms): add missing dynamic zone storage transform (#4399
Browse files Browse the repository at this point in the history
)
  • Loading branch information
brunozoric authored Nov 26, 2024
1 parent 69a78b3 commit a88d624
Show file tree
Hide file tree
Showing 31 changed files with 1,027 additions and 304 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PluginsContainer } from "@webiny/plugins";
import { createDateStorageTransformPlugin } from "~/dynamoDb/storage/date";
import { createLongTextStorageTransformPlugin } from "~/dynamoDb/storage/longText";
import { createRichTextStorageTransformPlugin } from "~/dynamoDb/storage/richText";
import { createDefaultStorageTransform } from "@webiny/api-headless-cms/storage/default";
Expand All @@ -9,7 +8,6 @@ export const createStoragePluginsContainer = () => {
return new PluginsContainer([
createDefaultStorageTransform(),
createObjectStorageTransform(),
createDateStorageTransformPlugin(),
createLongTextStorageTransformPlugin(),
createRichTextStorageTransformPlugin()
]);
Expand Down
7 changes: 1 addition & 6 deletions packages/api-headless-cms-ddb-es/src/dynamoDb/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { createRichTextStorageTransformPlugin } from "./storage/richText";
import { createLongTextStorageTransformPlugin } from "./storage/longText";
import { createDateStorageTransformPlugin } from "./storage/date";

export default () => createDynamoDbPlugins();

export const createDynamoDbPlugins = () => {
return [
createRichTextStorageTransformPlugin(),
createLongTextStorageTransformPlugin(),
createDateStorageTransformPlugin()
];
return [createRichTextStorageTransformPlugin(), createLongTextStorageTransformPlugin()];
};
77 changes: 0 additions & 77 deletions packages/api-headless-cms-ddb-es/src/dynamoDb/storage/date.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface StorageValue {

export const createLongTextStorageTransformPlugin = () => {
const plugin = new StorageTransformPlugin<string | string[], StorageValue>({
name: "headless-cms.storage-transform.long-text.default",
fieldType: "long-text",
fromStorage: async ({ field, value: storageValue }) => {
const typeOf = typeof storageValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const transformArray = (value: any) => {

export const createRichTextStorageTransformPlugin = () => {
const plugin = new StorageTransformPlugin({
name: "headless-cms.storage-transform.rich-text.default",
fieldType: "rich-text",
fromStorage: async ({ field, value: storageValue }) => {
if (!storageValue) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PluginsContainer } from "@webiny/plugins";
import { createDateStorageTransformPlugin } from "~/dynamoDb/storage/date";
import { createLongTextStorageTransformPlugin } from "~/dynamoDb/storage/longText";
import { createRichTextStorageTransformPlugin } from "~/dynamoDb/storage/richText";
import { createDefaultStorageTransform } from "@webiny/api-headless-cms/storage/default";
Expand All @@ -9,7 +8,6 @@ export const createStoragePluginsContainer = () => {
return new PluginsContainer([
createDefaultStorageTransform(),
createObjectStorageTransform(),
createDateStorageTransformPlugin(),
createLongTextStorageTransformPlugin(),
createRichTextStorageTransformPlugin()
]);
Expand Down
2 changes: 0 additions & 2 deletions packages/api-headless-cms-ddb/src/dynamoDb/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { createRichTextStorageTransformPlugin } from "./storage/richText";
import { createLongTextStorageTransformPlugin } from "./storage/longText";
import { createDateStorageTransformPlugin } from "./storage/date";
import { createPlainObjectPathPlugin } from "./path/plainObject";
import { createDatetimeTransformValuePlugin } from "./transformValue/datetime";
import { createLocationFolderIdPathPlugin } from "~/dynamoDb/path/locationFolderId";

export default () => [
createRichTextStorageTransformPlugin(),
createLongTextStorageTransformPlugin(),
createDateStorageTransformPlugin(),
createPlainObjectPathPlugin(),
createLocationFolderIdPathPlugin(),
createDatetimeTransformValuePlugin()
Expand Down
73 changes: 0 additions & 73 deletions packages/api-headless-cms-ddb/src/dynamoDb/storage/date.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface StorageValue {

export const createLongTextStorageTransformPlugin = () => {
return new StorageTransformPlugin<string | string[], StorageValue>({
name: "headless-cms.storage-transform.long-text.default",
fieldType: "long-text",
fromStorage: async ({ field, value: storageValue }) => {
const typeOf = typeof storageValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const transformArray = (value: any) => {

export const createRichTextStorageTransformPlugin = () => {
return new StorageTransformPlugin({
name: "headless-cms.storage-transform.rich-text.default",
fieldType: "rich-text",
fromStorage: async ({ field, value: storageValue }) => {
if (!storageValue) {
Expand Down
Loading

0 comments on commit a88d624

Please sign in to comment.