@blaze-cms/plugin-data-ui 0.118.0-alpha.3 → 0.119.0-alpha.2

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/lib/components/EntityDataListing/EntityDataListing.js +2 -2
  3. package/lib/components/EntityDataListing/EntityDataListing.js.map +1 -1
  4. package/lib/components/EntityManager/Entity/Entity.js +8 -5
  5. package/lib/components/EntityManager/Entity/Entity.js.map +1 -1
  6. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +2 -2
  7. package/lib/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  8. package/lib/components/EntityManager/Entity/SideBarRelations/index.js +2 -2
  9. package/lib/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  10. package/lib/components/EntityManager/EntityManager.js +2 -2
  11. package/lib/components/EntityManager/EntityManager.js.map +1 -1
  12. package/lib/components/EntityManager/utils/query.js +2 -2
  13. package/lib/components/EntityManager/utils/query.js.map +1 -1
  14. package/lib/components/ListingTable/ListingTable.js +2 -2
  15. package/lib/components/ListingTable/ListingTable.js.map +1 -1
  16. package/lib/utils/build-create-entity-mutation.js +2 -2
  17. package/lib/utils/build-create-entity-mutation.js.map +1 -1
  18. package/lib/utils/build-delete-entity-mutation.js +2 -2
  19. package/lib/utils/build-delete-entity-mutation.js.map +1 -1
  20. package/lib/utils/build-listing-query.js +2 -2
  21. package/lib/utils/build-listing-query.js.map +1 -1
  22. package/lib/utils/build-update-data-query.js +2 -2
  23. package/lib/utils/build-update-data-query.js.map +1 -1
  24. package/lib/utils/build-update-publish-unpublish-mutation.js +2 -2
  25. package/lib/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  26. package/lib-es/components/EntityDataListing/EntityDataListing.js +1 -1
  27. package/lib-es/components/EntityDataListing/EntityDataListing.js.map +1 -1
  28. package/lib-es/components/EntityManager/Entity/Entity.js +7 -4
  29. package/lib-es/components/EntityManager/Entity/Entity.js.map +1 -1
  30. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +1 -1
  31. package/lib-es/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js.map +1 -1
  32. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js +1 -1
  33. package/lib-es/components/EntityManager/Entity/SideBarRelations/index.js.map +1 -1
  34. package/lib-es/components/EntityManager/EntityManager.js +1 -1
  35. package/lib-es/components/EntityManager/EntityManager.js.map +1 -1
  36. package/lib-es/components/EntityManager/utils/query.js +1 -1
  37. package/lib-es/components/EntityManager/utils/query.js.map +1 -1
  38. package/lib-es/components/ListingTable/ListingTable.js +1 -1
  39. package/lib-es/components/ListingTable/ListingTable.js.map +1 -1
  40. package/lib-es/utils/build-create-entity-mutation.js +1 -1
  41. package/lib-es/utils/build-create-entity-mutation.js.map +1 -1
  42. package/lib-es/utils/build-delete-entity-mutation.js +1 -1
  43. package/lib-es/utils/build-delete-entity-mutation.js.map +1 -1
  44. package/lib-es/utils/build-listing-query.js +1 -1
  45. package/lib-es/utils/build-listing-query.js.map +1 -1
  46. package/lib-es/utils/build-update-data-query.js +1 -1
  47. package/lib-es/utils/build-update-data-query.js.map +1 -1
  48. package/lib-es/utils/build-update-publish-unpublish-mutation.js +1 -1
  49. package/lib-es/utils/build-update-publish-unpublish-mutation.js.map +1 -1
  50. package/package.json +9 -10
  51. package/src/components/EntityDataListing/EntityDataListing.js +1 -1
  52. package/src/components/EntityManager/Entity/Entity.js +7 -4
  53. package/src/components/EntityManager/Entity/EntityHeader/HeaderPreviewButton/HeaderPreviewButton.js +1 -1
  54. package/src/components/EntityManager/Entity/SideBarRelations/index.js +1 -1
  55. package/src/components/EntityManager/EntityManager.js +1 -1
  56. package/src/components/EntityManager/utils/query.js +1 -1
  57. package/src/components/ListingTable/ListingTable.js +1 -1
  58. package/src/utils/build-create-entity-mutation.js +1 -1
  59. package/src/utils/build-delete-entity-mutation.js +1 -1
  60. package/src/utils/build-listing-query.js +1 -1
  61. package/src/utils/build-update-data-query.js +1 -1
  62. package/src/utils/build-update-publish-unpublish-mutation.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/build-create-entity-mutation.js"],"names":["gql","BlazeError","upperfirst","getDataProperties","buildCreateEntityMutation","entitySchema","actions","create","properties","actionInput","dataProperties","join"],"mappings":"AAAA,OAAOA,GAAP,MAAgB,aAAhB;AACA,SAASC,UAAT,QAA2B,wBAA3B;AACA,OAAOC,UAAP,MAAuB,mBAAvB;AACA,SAASC,iBAAT,QAAkC,2BAAlC;;AAEA,SAASC,yBAAT,CAAmCC,YAAnC,EAAiD;AAC/C,MACE,CAACA,YAAD,IACA,CAACA,YAAY,CAACC,OADd,IAEA,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAFtB,IAGA,CAACF,YAAY,CAACG,UAJhB,EAKE;AACA,UAAM,IAAIP,UAAJ,CACJ,8EADI,CAAN;AAGD;;AAED,QAAMQ,WAAW,GAAGP,UAAU,CAAE,GAAEG,YAAY,CAACC,OAAb,CAAqBC,MAAO,OAAhC,CAA9B;AACA,QAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAD,CAAxC;AAEA,SAAOL,GAAI,kCAAiCS,WAAY;AAC1D,qBAAqBJ,YAAY,CAACC,OAAb,CAAqBC,MAAO;AACjD;AACA;AACA,YAAYG,cAAc,CAACC,IAAf,CAAoB,KAApB,CAA2B;AACvC;AACA;AACA,IAPE;AAQD;;AAED,eAAeP,yBAAf","sourcesContent":["import gql from 'graphql-tag';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\nimport { getDataProperties } from '@blaze-cms/admin-ui-utils';\n\nfunction buildCreateEntityMutation(entitySchema) {\n if (\n !entitySchema ||\n !entitySchema.actions ||\n !entitySchema.actions.create ||\n !entitySchema.properties\n ) {\n throw new BlazeError(\n 'Create entity query requires create action and properties from entity schema'\n );\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.create}Input`);\n const dataProperties = getDataProperties(entitySchema);\n\n return gql`mutation createEntity($input: ${actionInput}) {\n createdEntity: ${entitySchema.actions.create}(input: $input){\n result {\n id,\n ${dataProperties.join(',\\n')}\n }\n }\n }`;\n}\n\nexport default buildCreateEntityMutation;\n"],"file":"build-create-entity-mutation.js"}
1
+ {"version":3,"sources":["../../src/utils/build-create-entity-mutation.js"],"names":["gql","BlazeError","upperfirst","getDataProperties","buildCreateEntityMutation","entitySchema","actions","create","properties","actionInput","dataProperties","join"],"mappings":"AAAA,SAASA,GAAT,QAAoB,gBAApB;AACA,SAASC,UAAT,QAA2B,wBAA3B;AACA,OAAOC,UAAP,MAAuB,mBAAvB;AACA,SAASC,iBAAT,QAAkC,2BAAlC;;AAEA,SAASC,yBAAT,CAAmCC,YAAnC,EAAiD;AAC/C,MACE,CAACA,YAAD,IACA,CAACA,YAAY,CAACC,OADd,IAEA,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAFtB,IAGA,CAACF,YAAY,CAACG,UAJhB,EAKE;AACA,UAAM,IAAIP,UAAJ,CACJ,8EADI,CAAN;AAGD;;AAED,QAAMQ,WAAW,GAAGP,UAAU,CAAE,GAAEG,YAAY,CAACC,OAAb,CAAqBC,MAAO,OAAhC,CAA9B;AACA,QAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAD,CAAxC;AAEA,SAAOL,GAAI,kCAAiCS,WAAY;AAC1D,qBAAqBJ,YAAY,CAACC,OAAb,CAAqBC,MAAO;AACjD;AACA;AACA,YAAYG,cAAc,CAACC,IAAf,CAAoB,KAApB,CAA2B;AACvC;AACA;AACA,IAPE;AAQD;;AAED,eAAeP,yBAAf","sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\nimport { getDataProperties } from '@blaze-cms/admin-ui-utils';\n\nfunction buildCreateEntityMutation(entitySchema) {\n if (\n !entitySchema ||\n !entitySchema.actions ||\n !entitySchema.actions.create ||\n !entitySchema.properties\n ) {\n throw new BlazeError(\n 'Create entity query requires create action and properties from entity schema'\n );\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.create}Input`);\n const dataProperties = getDataProperties(entitySchema);\n\n return gql`mutation createEntity($input: ${actionInput}) {\n createdEntity: ${entitySchema.actions.create}(input: $input){\n result {\n id,\n ${dataProperties.join(',\\n')}\n }\n }\n }`;\n}\n\nexport default buildCreateEntityMutation;\n"],"file":"build-create-entity-mutation.js"}
@@ -1,4 +1,4 @@
1
- import gql from 'graphql-tag';
1
+ import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
  import upperfirst from 'lodash.upperfirst';
4
4
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/build-delete-entity-mutation.js"],"names":["gql","BlazeError","upperfirst","buildDeleteEntity","entitySchema","actions","delete","actionInput"],"mappings":"AAAA,OAAOA,GAAP,MAAgB,aAAhB;AACA,SAASC,UAAT,QAA2B,wBAA3B;AACA,OAAOC,UAAP,MAAuB,mBAAvB;;AAEA,SAASC,iBAAT,CAA2BC,YAA3B,EAAyC;AACvC,MAAI,CAACA,YAAD,IAAiB,CAACA,YAAY,CAACC,OAA/B,IAA0C,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAApE,EAA4E;AAC1E,UAAM,IAAIL,UAAJ,CAAe,wDAAf,CAAN;AACD;;AAED,QAAMM,WAAW,GAAGL,UAAU,CAAE,GAAEE,YAAY,CAACC,OAAb,CAAqBC,MAAO,OAAhC,CAA9B;AAEA,SAAON,GAAI;AACb,mCAAmCO,WAAY;AAC/C,oBAAoBH,YAAY,CAACC,OAAb,CAAqBC,MAAO;AAChD;AACA;AACA;AACA,GANE;AAOD;;AAED,eAAeH,iBAAf","sourcesContent":["import gql from 'graphql-tag';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\n\nfunction buildDeleteEntity(entitySchema) {\n if (!entitySchema || !entitySchema.actions || !entitySchema.actions.delete) {\n throw new BlazeError('Delete query requires delete action from entity schema');\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.delete}Input`);\n\n return gql`\n mutation deleteEntity($input: ${actionInput}) {\n deleteEntity: ${entitySchema.actions.delete}(input: $input){\n result\n }\n }\n `;\n}\n\nexport default buildDeleteEntity;\n"],"file":"build-delete-entity-mutation.js"}
1
+ {"version":3,"sources":["../../src/utils/build-delete-entity-mutation.js"],"names":["gql","BlazeError","upperfirst","buildDeleteEntity","entitySchema","actions","delete","actionInput"],"mappings":"AAAA,SAASA,GAAT,QAAoB,gBAApB;AACA,SAASC,UAAT,QAA2B,wBAA3B;AACA,OAAOC,UAAP,MAAuB,mBAAvB;;AAEA,SAASC,iBAAT,CAA2BC,YAA3B,EAAyC;AACvC,MAAI,CAACA,YAAD,IAAiB,CAACA,YAAY,CAACC,OAA/B,IAA0C,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAApE,EAA4E;AAC1E,UAAM,IAAIL,UAAJ,CAAe,wDAAf,CAAN;AACD;;AAED,QAAMM,WAAW,GAAGL,UAAU,CAAE,GAAEE,YAAY,CAACC,OAAb,CAAqBC,MAAO,OAAhC,CAA9B;AAEA,SAAON,GAAI;AACb,mCAAmCO,WAAY;AAC/C,oBAAoBH,YAAY,CAACC,OAAb,CAAqBC,MAAO;AAChD;AACA;AACA;AACA,GANE;AAOD;;AAED,eAAeH,iBAAf","sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\n\nfunction buildDeleteEntity(entitySchema) {\n if (!entitySchema || !entitySchema.actions || !entitySchema.actions.delete) {\n throw new BlazeError('Delete query requires delete action from entity schema');\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.delete}Input`);\n\n return gql`\n mutation deleteEntity($input: ${actionInput}) {\n deleteEntity: ${entitySchema.actions.delete}(input: $input){\n result\n }\n }\n `;\n}\n\nexport default buildDeleteEntity;\n"],"file":"build-delete-entity-mutation.js"}
@@ -1,4 +1,4 @@
1
- import gql from 'graphql-tag';
1
+ import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
 
4
4
  function buildListingQuery(entitySchema) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/build-listing-query.js"],"names":["gql","BlazeError","buildListingQuery","entitySchema","actions","getAll","listingProperties","sortType","toUpperCase","substr","join"],"mappings":"AAAA,OAAOA,GAAP,MAAgB,aAAhB;AACA,SAASC,UAAT,QAA2B,wBAA3B;;AAEA,SAASC,iBAAT,CAA2BC,YAA3B,EAAyC;AACvC,MAAI,CAACA,YAAY,CAACC,OAAd,IAAyB,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAA/C,IAAyD,CAACF,YAAY,CAACG,iBAA3E,EAA8F;AAC5F,UAAM,IAAIL,UAAJ,CACJ,+EADI,CAAN;AAGD;;AAED,QAAMM,QAAQ,GACZJ,YAAY,CAACC,OAAb,CAAqBC,MAArB,CAA4B,CAA5B,EAA+BG,WAA/B,KAA+CL,YAAY,CAACC,OAAb,CAAqBC,MAArB,CAA4BI,MAA5B,CAAmC,CAAnC,CADjD;AAGA,SAAOT,GAAI;AACb,YAAYG,YAAY,CAACC,OAAb,CAAqBC,MAAO,sCAAqCE,QAAS;AACtF,qBAAqBJ,YAAY,CAACC,OAAb,CAAqBC,MAAO;AACjD;AACA,UAAUF,YAAY,CAACG,iBAAb,CAA+BI,IAA/B,CAAoC,KAApC,CAA2C;AACrD;AACA;AACA,GAPE;AAQD;;AAED,eAAeR,iBAAf","sourcesContent":["import gql from 'graphql-tag';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nfunction buildListingQuery(entitySchema) {\n if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {\n throw new BlazeError(\n 'Listing query requires getAll action and listingProperties from entity schema'\n );\n }\n\n const sortType =\n entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);\n\n return gql`\n query ${entitySchema.actions.getAll}($limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {\n listingData: ${entitySchema.actions.getAll}(limit: $limit, offset:$offset, sort:$sort){\n id,\n ${entitySchema.listingProperties.join(',\\n')}\n }\n }\n `;\n}\n\nexport default buildListingQuery;\n"],"file":"build-listing-query.js"}
1
+ {"version":3,"sources":["../../src/utils/build-listing-query.js"],"names":["gql","BlazeError","buildListingQuery","entitySchema","actions","getAll","listingProperties","sortType","toUpperCase","substr","join"],"mappings":"AAAA,SAASA,GAAT,QAAoB,gBAApB;AACA,SAASC,UAAT,QAA2B,wBAA3B;;AAEA,SAASC,iBAAT,CAA2BC,YAA3B,EAAyC;AACvC,MAAI,CAACA,YAAY,CAACC,OAAd,IAAyB,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAA/C,IAAyD,CAACF,YAAY,CAACG,iBAA3E,EAA8F;AAC5F,UAAM,IAAIL,UAAJ,CACJ,+EADI,CAAN;AAGD;;AAED,QAAMM,QAAQ,GACZJ,YAAY,CAACC,OAAb,CAAqBC,MAArB,CAA4B,CAA5B,EAA+BG,WAA/B,KAA+CL,YAAY,CAACC,OAAb,CAAqBC,MAArB,CAA4BI,MAA5B,CAAmC,CAAnC,CADjD;AAGA,SAAOT,GAAI;AACb,YAAYG,YAAY,CAACC,OAAb,CAAqBC,MAAO,sCAAqCE,QAAS;AACtF,qBAAqBJ,YAAY,CAACC,OAAb,CAAqBC,MAAO;AACjD;AACA,UAAUF,YAAY,CAACG,iBAAb,CAA+BI,IAA/B,CAAoC,KAApC,CAA2C;AACrD;AACA;AACA,GAPE;AAQD;;AAED,eAAeR,iBAAf","sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nfunction buildListingQuery(entitySchema) {\n if (!entitySchema.actions || !entitySchema.actions.getAll || !entitySchema.listingProperties) {\n throw new BlazeError(\n 'Listing query requires getAll action and listingProperties from entity schema'\n );\n }\n\n const sortType =\n entitySchema.actions.getAll[0].toUpperCase() + entitySchema.actions.getAll.substr(1);\n\n return gql`\n query ${entitySchema.actions.getAll}($limit: Int, $offset:Int, $sort: [${sortType}SortItem]) {\n listingData: ${entitySchema.actions.getAll}(limit: $limit, offset:$offset, sort:$sort){\n id,\n ${entitySchema.listingProperties.join(',\\n')}\n }\n }\n `;\n}\n\nexport default buildListingQuery;\n"],"file":"build-listing-query.js"}
@@ -1,4 +1,4 @@
1
- import gql from 'graphql-tag';
1
+ import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
  import upperfirst from 'lodash.upperfirst';
4
4
  import { getDataProperties } from '@blaze-cms/admin-ui-utils';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/build-update-data-query.js"],"names":["gql","BlazeError","upperfirst","getDataProperties","buildUpdateDataQuery","entitySchema","actions","update","properties","actionInput","dataProperties","join"],"mappings":"AAAA,OAAOA,GAAP,MAAgB,aAAhB;AACA,SAASC,UAAT,QAA2B,wBAA3B;AACA,OAAOC,UAAP,MAAuB,mBAAvB;AACA,SAASC,iBAAT,QAAkC,2BAAlC;;AAEA,SAASC,oBAAT,CAA8BC,YAA9B,EAA4C;AAC1C,MAAI,CAACA,YAAY,CAACC,OAAd,IAAyB,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAA/C,IAAyD,CAACF,YAAY,CAACG,UAA3E,EAAuF;AACrF,UAAM,IAAIP,UAAJ,CACJ,+EADI,CAAN;AAGD;;AAED,QAAMQ,WAAW,GAAGP,UAAU,CAAE,GAAEG,YAAY,CAACC,OAAb,CAAqBC,MAAO,OAAhC,CAA9B;AACA,QAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAD,CAAxC;AAEA,SAAOL,GAAI;AACb,mCAAmCS,WAAY;AAC/C,oBAAoBJ,YAAY,CAACC,OAAb,CAAqBC,MAAO;AAChD;AACA;AACA,YAAYG,cAAc,CAACC,IAAf,CAAoB,KAApB,CAA2B;AACvC;AACA;AACA;AACA;AACA,GAVE;AAWD;;AAED,eAAeP,oBAAf","sourcesContent":["import gql from 'graphql-tag';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\nimport { getDataProperties } from '@blaze-cms/admin-ui-utils';\n\nfunction buildUpdateDataQuery(entitySchema) {\n if (!entitySchema.actions || !entitySchema.actions.update || !entitySchema.properties) {\n throw new BlazeError(\n 'Update DataEntity query requires get action and properties from entity schema'\n );\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.update}Input`);\n const dataProperties = getDataProperties(entitySchema);\n\n return gql`\n mutation updateEntity($input: ${actionInput}) {\n updateEntity: ${entitySchema.actions.update}(input: $input){\n result {\n id,\n ${dataProperties.join(',\\n')},\n updated\n }\n }\n }\n `;\n}\n\nexport default buildUpdateDataQuery;\n"],"file":"build-update-data-query.js"}
1
+ {"version":3,"sources":["../../src/utils/build-update-data-query.js"],"names":["gql","BlazeError","upperfirst","getDataProperties","buildUpdateDataQuery","entitySchema","actions","update","properties","actionInput","dataProperties","join"],"mappings":"AAAA,SAASA,GAAT,QAAoB,gBAApB;AACA,SAASC,UAAT,QAA2B,wBAA3B;AACA,OAAOC,UAAP,MAAuB,mBAAvB;AACA,SAASC,iBAAT,QAAkC,2BAAlC;;AAEA,SAASC,oBAAT,CAA8BC,YAA9B,EAA4C;AAC1C,MAAI,CAACA,YAAY,CAACC,OAAd,IAAyB,CAACD,YAAY,CAACC,OAAb,CAAqBC,MAA/C,IAAyD,CAACF,YAAY,CAACG,UAA3E,EAAuF;AACrF,UAAM,IAAIP,UAAJ,CACJ,+EADI,CAAN;AAGD;;AAED,QAAMQ,WAAW,GAAGP,UAAU,CAAE,GAAEG,YAAY,CAACC,OAAb,CAAqBC,MAAO,OAAhC,CAA9B;AACA,QAAMG,cAAc,GAAGP,iBAAiB,CAACE,YAAD,CAAxC;AAEA,SAAOL,GAAI;AACb,mCAAmCS,WAAY;AAC/C,oBAAoBJ,YAAY,CAACC,OAAb,CAAqBC,MAAO;AAChD;AACA;AACA,YAAYG,cAAc,CAACC,IAAf,CAAoB,KAApB,CAA2B;AACvC;AACA;AACA;AACA;AACA,GAVE;AAWD;;AAED,eAAeP,oBAAf","sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\nimport upperfirst from 'lodash.upperfirst';\nimport { getDataProperties } from '@blaze-cms/admin-ui-utils';\n\nfunction buildUpdateDataQuery(entitySchema) {\n if (!entitySchema.actions || !entitySchema.actions.update || !entitySchema.properties) {\n throw new BlazeError(\n 'Update DataEntity query requires get action and properties from entity schema'\n );\n }\n\n const actionInput = upperfirst(`${entitySchema.actions.update}Input`);\n const dataProperties = getDataProperties(entitySchema);\n\n return gql`\n mutation updateEntity($input: ${actionInput}) {\n updateEntity: ${entitySchema.actions.update}(input: $input){\n result {\n id,\n ${dataProperties.join(',\\n')},\n updated\n }\n }\n }\n `;\n}\n\nexport default buildUpdateDataQuery;\n"],"file":"build-update-data-query.js"}
@@ -1,4 +1,4 @@
1
- import gql from 'graphql-tag';
1
+ import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
 
4
4
  function buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/build-update-publish-unpublish-mutation.js"],"names":["gql","BlazeError","buildUpdatePublishUnpublishMutation","entitySchema","id","action","cache","actions","publish","withClient"],"mappings":"AAAA,OAAOA,GAAP,MAAgB,aAAhB;AACA,SAASC,UAAT,QAA2B,wBAA3B;;AAEA,SAASC,mCAAT,CAA6CC,YAA7C,EAA2DC,EAA3D,EAA+DC,MAA/D,EAAuEC,KAAvE,EAA8E;AAC5E,MAAI,CAACH,YAAD,IAAiB,CAACA,YAAY,CAACI,OAA/B,IAA0C,CAACJ,YAAY,CAACI,OAAb,CAAqBC,OAAhE,IAA2E,CAACJ,EAA5E,IAAkF,CAACC,MAAvF,EAA+F;AAC7F,UAAM,IAAIJ,UAAJ,CACJ,2EADI,CAAN;AAGD;;AAED,QAAMQ,UAAU,GAAI,GAAEH,KAAK,GAAG,SAAH,GAAe,EAAG,EAA7C;AAEA,SAAON,GAAI;AACb;AACA,kBAAkBG,YAAY,CAACI,OAAb,CAAqBF,MAArB,CAA6B,IAAGI,UAAW;AAC7D,eAAeL,EAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAXE;AAYD;;AAED,eAAeF,mCAAf","sourcesContent":["import gql from 'graphql-tag';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nfunction buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {\n if (!entitySchema || !entitySchema.actions || !entitySchema.actions.publish || !id || !action) {\n throw new BlazeError(\n 'Update DataEntity query requires publish action from entity schema and id'\n );\n }\n\n const withClient = `${cache ? '@client' : ''}`;\n\n return gql`\n mutation {\n response: ${entitySchema.actions[action]} ${withClient}(input: {\n id: \"${id}\"\n }){\n result {\n id,\n status\n }\n }\n }\n `;\n}\n\nexport default buildUpdatePublishUnpublishMutation;\n"],"file":"build-update-publish-unpublish-mutation.js"}
1
+ {"version":3,"sources":["../../src/utils/build-update-publish-unpublish-mutation.js"],"names":["gql","BlazeError","buildUpdatePublishUnpublishMutation","entitySchema","id","action","cache","actions","publish","withClient"],"mappings":"AAAA,SAASA,GAAT,QAAoB,gBAApB;AACA,SAASC,UAAT,QAA2B,wBAA3B;;AAEA,SAASC,mCAAT,CAA6CC,YAA7C,EAA2DC,EAA3D,EAA+DC,MAA/D,EAAuEC,KAAvE,EAA8E;AAC5E,MAAI,CAACH,YAAD,IAAiB,CAACA,YAAY,CAACI,OAA/B,IAA0C,CAACJ,YAAY,CAACI,OAAb,CAAqBC,OAAhE,IAA2E,CAACJ,EAA5E,IAAkF,CAACC,MAAvF,EAA+F;AAC7F,UAAM,IAAIJ,UAAJ,CACJ,2EADI,CAAN;AAGD;;AAED,QAAMQ,UAAU,GAAI,GAAEH,KAAK,GAAG,SAAH,GAAe,EAAG,EAA7C;AAEA,SAAON,GAAI;AACb;AACA,kBAAkBG,YAAY,CAACI,OAAb,CAAqBF,MAArB,CAA6B,IAAGI,UAAW;AAC7D,eAAeL,EAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAXE;AAYD;;AAED,eAAeF,mCAAf","sourcesContent":["import { gql } from '@apollo/client';\nimport { BlazeError } from '@blaze-cms/core-errors';\n\nfunction buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {\n if (!entitySchema || !entitySchema.actions || !entitySchema.actions.publish || !id || !action) {\n throw new BlazeError(\n 'Update DataEntity query requires publish action from entity schema and id'\n );\n }\n\n const withClient = `${cache ? '@client' : ''}`;\n\n return gql`\n mutation {\n response: ${entitySchema.actions[action]} ${withClient}(input: {\n id: \"${id}\"\n }){\n result {\n id,\n status\n }\n }\n }\n `;\n}\n\nexport default buildUpdatePublishUnpublishMutation;\n"],"file":"build-update-publish-unpublish-mutation.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaze-cms/plugin-data-ui",
3
- "version": "0.118.0-alpha.3",
3
+ "version": "0.119.0-alpha.2",
4
4
  "description": "Blaze plugin data ui",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
@@ -27,10 +27,10 @@
27
27
  },
28
28
  "license": "GPL-3.0",
29
29
  "dependencies": {
30
- "@blaze-cms/admin-ui-utils": "^0.118.0-alpha.0",
31
- "@blaze-cms/core-errors": "^0.118.0-alpha.0",
32
- "@blaze-cms/react-form-builder": "^0.118.0-alpha.0",
33
- "@blaze-cms/react-page-builder": "^0.118.0-alpha.3",
30
+ "@blaze-cms/admin-ui-utils": "^0.119.0-alpha.1",
31
+ "@blaze-cms/core-errors": "^0.118.0",
32
+ "@blaze-cms/react-form-builder": "^0.119.0-alpha.1",
33
+ "@blaze-cms/react-page-builder": "^0.119.0-alpha.2",
34
34
  "@blaze-cms/setup-ui": "^0.92.0",
35
35
  "@blaze-react/button": "0.5.19",
36
36
  "@blaze-react/more": "0.5.19",
@@ -40,7 +40,6 @@
40
40
  "@blaze-react/toaster": "0.5.17",
41
41
  "@blaze-react/utils": "0.5.15",
42
42
  "core-js": "^3.2.1",
43
- "graphql-tag": "^2.10.1",
44
43
  "lodash.differencewith": "^4.5.0",
45
44
  "lodash.has": "^4.5.2",
46
45
  "lodash.isempty": "^4.4.0",
@@ -53,17 +52,17 @@
53
52
  "uuid": "^3.3.3"
54
53
  },
55
54
  "devDependencies": {
56
- "@blaze-cms/core-ui": "^0.118.0-alpha.0"
55
+ "@blaze-cms/core-ui": "^0.119.0-alpha.1"
57
56
  },
58
57
  "peerDependencies": {
58
+ "@apollo/client": "3.x",
59
59
  "prop-types": "^15.7.2",
60
- "react": "^16.13.1",
61
- "react-apollo": "^3.1.1",
60
+ "react": "^17.0.2",
62
61
  "react-router-dom": "^5.0.1"
63
62
  },
64
63
  "eslintIgnore": [
65
64
  "lib/*",
66
65
  "lib-es/*"
67
66
  ],
68
- "gitHead": "9ce5c14d20fe41c7e6b671fd8e8edd5410d704ce"
67
+ "gitHead": "48eacb8ab1011f1c45fdfe51312388e92b9776ba"
69
68
  }
@@ -1,4 +1,4 @@
1
- import { useQuery } from 'react-apollo';
1
+ import { useQuery } from '@apollo/client';
2
2
  import React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { getQuery } from '@blaze-cms/admin-ui-utils';
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable no-undef */
2
2
  import React, { useEffect, useState, useRef } from 'react';
3
3
  import { withRouter, Prompt } from 'react-router-dom';
4
- import { useApolloClient } from 'react-apollo';
4
+ import { useApolloClient } from '@apollo/client';
5
5
  import PropTypes from 'prop-types';
6
6
  import { getQuery, GET_CURRENT_TAB_ID } from '@blaze-cms/admin-ui-utils';
7
7
  import { FormBuilder, parseFormValues } from '@blaze-cms/react-form-builder';
@@ -102,7 +102,8 @@ const Entity = ({
102
102
 
103
103
  if (formData && pageBuilderTemplateStatus) {
104
104
  const isPageBuilderTemplateSet = !!formData.values.pageBuilderTemplateId;
105
- client.writeData({
105
+ client.writeQuery({
106
+ query: getQuery('GET_PB_TEMPLATE_STATUS'),
106
107
  data: {
107
108
  pageBuilderTemplateSet: isPageBuilderTemplateSet,
108
109
  pageBuilderTemplateId: formData.values.pageBuilderTemplateId || ''
@@ -110,7 +111,8 @@ const Entity = ({
110
111
  });
111
112
  }
112
113
  if (schema) {
113
- client.writeData({
114
+ client.writeQuery({
115
+ query: getQuery('GET_CURRENT_ENTITY'),
114
116
  data: {
115
117
  currentEntity: schema.id
116
118
  }
@@ -175,7 +177,8 @@ const Entity = ({
175
177
  let updatedFormValues = valuesChecked ? valuesChecked.slice() : [];
176
178
  if (currentField === PAGE_BUILDER_TEMPLATE_FIELD_ID) {
177
179
  const pageBuilderTemplateId = fieldValue;
178
- client.writeData({
180
+ client.writeQuery({
181
+ query: getQuery('GET_PB_TEMPLATE_STATUS'),
179
182
  data: {
180
183
  pageBuilderTemplateSet: !!pageBuilderTemplateId,
181
184
  pageBuilderTemplateId
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import Button from '@blaze-react/button';
4
- import { useMutation } from '@apollo/react-hooks';
4
+ import { useMutation } from '@apollo/client';
5
5
  import { getMutation } from '@blaze-cms/admin-ui-utils';
6
6
 
7
7
  const HeaderPreviewButton = ({ itemId, itemEntity }) => {
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import uuidv1 from 'uuid/v1';
4
- import { useApolloClient } from 'react-apollo';
4
+ import { useApolloClient } from '@apollo/client';
5
5
  import { getQuery } from '@blaze-cms/admin-ui-utils';
6
6
  import { formFieldTypes } from '@blaze-cms/react-form-builder';
7
7
  import Badge from '@blaze-react/badge';
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { withRouter } from 'react-router-dom';
3
- import { useApolloClient } from 'react-apollo';
3
+ import { useApolloClient } from '@apollo/client';
4
4
  import PropTypes from 'prop-types';
5
5
  import entityAvailableActions from './utils/entityAvailableActions';
6
6
  import Entity from './Entity';
@@ -1,4 +1,4 @@
1
- import gql from 'graphql-tag';
1
+ import { gql } from '@apollo/client';
2
2
  import upperFirst from 'lodash.upperfirst';
3
3
 
4
4
  const generateQuery = (action, props) => `
@@ -1,4 +1,4 @@
1
- import { useApolloClient } from 'react-apollo';
1
+ import { useApolloClient } from '@apollo/client';
2
2
  import React, { useEffect, useState, Fragment } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { withRouter, Link } from 'react-router-dom';
@@ -1,4 +1,4 @@
1
- import gql from 'graphql-tag';
1
+ import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
  import upperfirst from 'lodash.upperfirst';
4
4
  import { getDataProperties } from '@blaze-cms/admin-ui-utils';
@@ -1,4 +1,4 @@
1
- import gql from 'graphql-tag';
1
+ import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
  import upperfirst from 'lodash.upperfirst';
4
4
 
@@ -1,4 +1,4 @@
1
- import gql from 'graphql-tag';
1
+ import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
 
4
4
  function buildListingQuery(entitySchema) {
@@ -1,4 +1,4 @@
1
- import gql from 'graphql-tag';
1
+ import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
  import upperfirst from 'lodash.upperfirst';
4
4
  import { getDataProperties } from '@blaze-cms/admin-ui-utils';
@@ -1,4 +1,4 @@
1
- import gql from 'graphql-tag';
1
+ import { gql } from '@apollo/client';
2
2
  import { BlazeError } from '@blaze-cms/core-errors';
3
3
 
4
4
  function buildUpdatePublishUnpublishMutation(entitySchema, id, action, cache) {