@localazy/strapi-plugin 0.2.12 → 1.0.0-beta.0
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/README.md +3 -1
- package/dist/_chunks/App-BSFfgZKU.mjs +5278 -0
- package/dist/_chunks/App-D1QaIMHX.js +5278 -0
- package/dist/_chunks/ContentTransferSetup-DHXJIxAp.js +1552 -0
- package/dist/_chunks/ContentTransferSetup-DtjcF_jM.mjs +1550 -0
- package/dist/_chunks/GlobalSettings-BON3kjHK.js +228 -0
- package/dist/_chunks/GlobalSettings-BcdibqNS.mjs +228 -0
- package/dist/_chunks/LanguagesSelector-BeijBEjg.js +47 -0
- package/dist/_chunks/LanguagesSelector-fyAIUp7M.mjs +48 -0
- package/dist/_chunks/en-BTf8goGM.mjs +8 -0
- package/dist/_chunks/en-CRtsEFtl.js +8 -0
- package/dist/_chunks/fr-C8Qw4iPZ.js +4 -0
- package/dist/_chunks/fr-hkSxFuzl.mjs +4 -0
- package/dist/_chunks/has-model-changed-BMCQX2Dd.js +316 -0
- package/dist/_chunks/has-model-changed-Dvtzpc9v.mjs +317 -0
- package/dist/_chunks/index-BQw2qi2G.js +2679 -0
- package/dist/_chunks/index-CN3Gyh5F.mjs +2678 -0
- package/dist/_chunks/isEqual-B-YVnzrp.js +205 -0
- package/dist/_chunks/isEqual-CEyT97-3.mjs +206 -0
- package/dist/_chunks/set-DUdH3vE5.js +54557 -0
- package/dist/_chunks/set-DulHAQhq.mjs +54542 -0
- package/dist/admin/index.js +4 -0
- package/dist/admin/index.mjs +5 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/config/development/index.d.ts +15 -0
- package/dist/admin/src/config/example/index.example.d.ts +15 -0
- package/dist/admin/src/config/index.d.ts +15 -0
- package/dist/admin/src/config/local/index.d.ts +15 -0
- package/dist/admin/src/config/production/index.d.ts +15 -0
- package/dist/admin/src/i18n.d.ts +2 -0
- package/dist/admin/src/index.d.ts +10 -0
- package/dist/admin/src/modules/@common/api/strapi-api-base.d.ts +6 -0
- package/dist/admin/src/modules/@common/components/Icons/House.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/Icons/Localazy.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/LanguagesSelector.d.ts +11 -0
- package/dist/admin/src/modules/@common/components/PluginPageLoader.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/SideNav.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/TransferReport.d.ts +5 -0
- package/dist/admin/src/modules/@common/functions/flatten-deep.d.ts +2 -0
- package/dist/admin/src/modules/@common/locale/en.d.ts +14 -0
- package/dist/admin/src/modules/@common/models/supported-content-type-fields.d.ts +2 -0
- package/dist/admin/src/modules/@common/models/supported-custom-field-plugins.d.ts +2 -0
- package/dist/admin/src/modules/@common/services/i18n-service.d.ts +3 -0
- package/dist/admin/src/modules/@common/services/plugin.service.d.ts +3 -0
- package/dist/admin/src/modules/@common/services/product-analytics-service.d.ts +14 -0
- package/dist/admin/src/modules/@common/services/project-service.d.ts +4 -0
- package/dist/admin/src/modules/@common/services/user-service.d.ts +5 -0
- package/dist/admin/src/modules/@common/utils/are-locales-compatible.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/format-number.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/get-default-locale.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/history.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/is-plugin-route.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/iso-locales-utils.d.ts +3 -0
- package/dist/admin/src/modules/@common/utils/redirect-to-plugin-route.d.ts +13 -0
- package/dist/admin/src/modules/@common/utils/sort-by-model-name.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/use-header-subtitle.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/use-header-title.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/use-nav.d.ts +11 -0
- package/dist/admin/src/modules/alerts/constants/channels.d.ts +1 -0
- package/dist/admin/src/modules/alerts/constants/events.d.ts +4 -0
- package/dist/admin/src/modules/alerts/services/alerts-service.d.ts +8 -0
- package/dist/admin/src/modules/localazy-download/locale/en.d.ts +24 -0
- package/dist/admin/src/modules/localazy-download/services/download-alerts-service.d.ts +5 -0
- package/dist/admin/src/modules/localazy-download/services/localazy-download-service.d.ts +3 -0
- package/dist/admin/src/modules/localazy-upload/components/ReadDocsButton.d.ts +3 -0
- package/dist/admin/src/modules/localazy-upload/locale/en.d.ts +19 -0
- package/dist/admin/src/modules/localazy-upload/services/localazy-upload-service.d.ts +3 -0
- package/dist/admin/src/modules/localazy-upload/services/upload-alerts-service.d.ts +5 -0
- package/dist/admin/src/modules/login/components/FetchIdentity.d.ts +3 -0
- package/dist/admin/src/modules/login/components/LoginButton.d.ts +12 -0
- package/dist/admin/src/modules/login/components/LogoutButton.d.ts +6 -0
- package/dist/admin/src/modules/login/locale/en.d.ts +8 -0
- package/dist/admin/src/modules/login/services/localazy-login-service.d.ts +4 -0
- package/dist/admin/src/modules/overview/components/OverviewItem.d.ts +7 -0
- package/dist/admin/src/modules/overview/components/OverviewItemLink.d.ts +7 -0
- package/dist/admin/src/modules/overview/components/PrerequisitiesInfo.d.ts +3 -0
- package/dist/admin/src/modules/overview/locale/en.d.ts +14 -0
- package/dist/admin/src/modules/plugin-settings/components/ContentTransferSetupEmpty.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/components/Tree.d.ts +8 -0
- package/dist/admin/src/modules/plugin-settings/components/TreeItem.d.ts +10 -0
- package/dist/admin/src/modules/plugin-settings/functions/build-content-transfer-setup-schema.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/functions/get-content-transfer-setup-keys-sets.d.ts +8 -0
- package/dist/admin/src/modules/plugin-settings/functions/has-model-changed.d.ts +6 -0
- package/dist/admin/src/modules/plugin-settings/locale/en.d.ts +49 -0
- package/dist/admin/src/modules/plugin-settings/services/plugin-settings-service.d.ts +6 -0
- package/dist/admin/src/modules/plugin-settings/services/strapi-model-service.d.ts +4 -0
- package/dist/admin/src/modules/plugin-settings/services/strapi-users-service.d.ts +3 -0
- package/dist/admin/src/modules/plugin-settings/utils/array-of-models-to-object.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/utils/find-model-value-by-key.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/utils/get-filtered-models-schemas.d.ts +7 -0
- package/dist/admin/src/modules/plugin-settings/utils/get-models-tree.d.ts +5 -0
- package/dist/admin/src/modules/strapi/utils/get-default-theme.d.ts +3 -0
- package/dist/admin/src/modules/user/model/localazy-identity.d.ts +15 -0
- package/dist/admin/src/modules/user/services/localazy-user-service.d.ts +6 -0
- package/dist/admin/src/pages/App.d.ts +3 -0
- package/dist/admin/src/pages/ContentTransferSetup.d.ts +4 -0
- package/dist/admin/src/pages/Download.d.ts +7 -0
- package/dist/admin/src/pages/GlobalSettings.d.ts +4 -0
- package/dist/admin/src/pages/HomePage.d.ts +2 -0
- package/dist/admin/src/pages/Login.d.ts +8 -0
- package/dist/admin/src/pages/Overview.d.ts +8 -0
- package/dist/admin/src/pages/Upload.d.ts +7 -0
- package/dist/admin/src/pluginId.d.ts +2 -0
- package/dist/admin/src/plugins/generic-connector-client.d.ts +3 -0
- package/dist/admin/src/state/localazy-identity.d.ts +13 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/server/index.js +26000 -0
- package/dist/server/index.mjs +25989 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/core/config.d.ts +1 -0
- package/dist/server/src/config/development/index.d.ts +15 -0
- package/dist/server/src/config/example/index.example.d.ts +15 -0
- package/dist/server/src/config/index.d.ts +18 -0
- package/dist/server/src/config/local/index.d.ts +15 -0
- package/dist/server/src/config/production/index.d.ts +15 -0
- package/dist/server/src/constants/channels.d.ts +3 -0
- package/dist/server/src/constants/events.d.ts +6 -0
- package/dist/server/src/content-types/index.d.ts +2 -0
- package/dist/server/src/controllers/index.d.ts +43 -0
- package/dist/server/src/controllers/localazy-auth-controller.d.ts +8 -0
- package/dist/server/src/controllers/localazy-project-controller.d.ts +7 -0
- package/dist/server/src/controllers/localazy-transfer-controller.d.ts +8 -0
- package/dist/server/src/controllers/localazy-user-controller.d.ts +9 -0
- package/dist/server/src/controllers/plugin-settings-controller.d.ts +10 -0
- package/dist/server/src/controllers/strapi-controller.d.ts +10 -0
- package/dist/server/src/core/index.d.ts +71 -0
- package/dist/server/src/db/model/content-transfer-setup.d.ts +4 -0
- package/dist/server/src/db/model/localazy-user.d.ts +17 -0
- package/dist/server/src/db/model/plugin-settings.d.ts +5 -0
- package/dist/server/src/db/model/utils/get-strapi-store.d.ts +26 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/functions/should-set-downloaded-property.d.ts +12 -0
- package/dist/server/src/index.d.ts +189 -0
- package/dist/server/src/lifecycles/deep-populate-hook.d.ts +20 -0
- package/dist/server/src/lifecycles/deprecate-event-entry-in-localazy-hook.d.ts +4 -0
- package/dist/server/src/lifecycles/upload-event-entry-to-localazy-hook.d.ts +12 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/models/plugin/content-transfer-setup.d.ts +13 -0
- package/dist/server/src/models/strapi/locale.d.ts +8 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/index.d.ts +25 -0
- package/dist/server/src/routes/localazy-auth-routes.d.ts +9 -0
- package/dist/server/src/routes/localazy-project-routes.d.ts +9 -0
- package/dist/server/src/routes/localazy-transfer-routes.d.ts +9 -0
- package/dist/server/src/routes/localazy-user-routes.d.ts +9 -0
- package/dist/server/src/routes/plugin-settings-routes.d.ts +9 -0
- package/dist/server/src/routes/strapi-routes.d.ts +9 -0
- package/dist/server/src/services/helpers/job-notification-service.d.ts +14 -0
- package/dist/server/src/services/helpers/plugin-settings-service-helper.d.ts +16 -0
- package/dist/server/src/services/index.d.ts +92 -0
- package/dist/server/src/services/localazy-pubapi-service.d.ts +12 -0
- package/dist/server/src/services/localazy-transfer-download-service.d.ts +11 -0
- package/dist/server/src/services/localazy-transfer-upload-service.d.ts +11 -0
- package/dist/server/src/services/localazy-upload-service.d.ts +28 -0
- package/dist/server/src/services/localazy-user-service.d.ts +11 -0
- package/dist/server/src/services/plugin-settings-service.d.ts +16 -0
- package/dist/server/src/services/strapi-i18n-service.d.ts +19 -0
- package/dist/server/src/services/strapi-localazy-i18n-service.d.ts +9 -0
- package/dist/server/src/services/strapi-service.d.ts +10 -0
- package/dist/server/src/utils/delay.d.ts +1 -0
- package/dist/server/src/utils/drop-property-deep.d.ts +1 -0
- package/dist/server/src/utils/flatten-object.d.ts +2 -0
- package/dist/server/src/utils/generate-random-id.d.ts +2 -0
- package/dist/server/src/utils/get-full-populate-localazy-download-object.d.ts +17 -0
- package/dist/server/src/utils/get-full-populate-localazy-upload-object.d.ts +9 -0
- package/dist/server/src/utils/get-full-populate-object.d.ts +17 -0
- package/dist/server/src/utils/get-main-keys-of-nested-array-objects.d.ts +2 -0
- package/dist/server/src/utils/get-picked-flatten-keys-for-hook-entry.d.ts +5 -0
- package/dist/server/src/utils/intl-display-name.d.ts +1 -0
- package/dist/server/src/utils/is-generally-applicable-content-type.d.ts +2 -0
- package/dist/server/src/utils/is-localazy-applicable-content-type.d.ts +2 -0
- package/dist/server/src/utils/iso-locales-utils.d.ts +3 -0
- package/dist/server/src/utils/localazy-api-client-factory.d.ts +3 -0
- package/dist/server/src/utils/localazy-generic-connector-client-factory.d.ts +3 -0
- package/dist/server/src/utils/model-utils.d.ts +7 -0
- package/dist/server/src/utils/omit-deep.d.ts +2 -0
- package/dist/server/src/utils/parsed-localazy-entry-to-create-entry.d.ts +7 -0
- package/dist/server/src/utils/parsed-localazy-entry-to-update-entry.d.ts +1 -0
- package/dist/server/src/utils/pick-entries.d.ts +2 -0
- package/dist/server/src/utils/populate-create-update-entry-with-base-entry.d.ts +1 -0
- package/dist/server/src/utils/request-initiator-helper.d.ts +9 -0
- package/dist/server/src/utils/reset-array-keys-deep.d.ts +1 -0
- package/dist/server/src/utils/transfer-setup-utils.d.ts +7 -0
- package/install/index.mjs +88 -34
- package/install/vite.config.example.js +40 -0
- package/install/vite.config.example.ts +41 -0
- package/install/{webpack.example.js → webpack.config.example.js} +2 -2
- package/install/webpack.config.example.ts +30 -0
- package/package.json +93 -55
- package/.babelrc +0 -7
- package/.eslintrc +0 -13
- package/.github/workflows/qa.yml +0 -25
- package/.github/workflows/release.yml +0 -46
- package/.nvmrc +0 -1
- package/.strapi-updater.json +0 -4
- package/CHANGELOG.md +0 -60
- package/LICENSE +0 -21
- package/admin/src/components/Initializer/index.js +0 -26
- package/admin/src/components/PluginIcon/index.js +0 -14
- package/admin/src/config/development/index.js +0 -14
- package/admin/src/config/example/index.js +0 -14
- package/admin/src/config/index.js +0 -19
- package/admin/src/config/local/index.js +0 -14
- package/admin/src/config/production/index.js +0 -15
- package/admin/src/i18n.js +0 -41
- package/admin/src/index.js +0 -138
- package/admin/src/modules/@common/components/Icons/Localazy/index.js +0 -12
- package/admin/src/modules/@common/components/LanguagesSelector/index.js +0 -67
- package/admin/src/modules/@common/components/PluginPageLoader/index.js +0 -20
- package/admin/src/modules/@common/components/SideNav/index.js +0 -46
- package/admin/src/modules/@common/components/TransferReport/index.js +0 -53
- package/admin/src/modules/@common/locale/en.js +0 -14
- package/admin/src/modules/@common/models/supported-content-type-fields.js +0 -9
- package/admin/src/modules/@common/models/supported-custom-field-plugins.js +0 -6
- package/admin/src/modules/@common/services/i18n-service.js +0 -15
- package/admin/src/modules/@common/services/plugin.service.js +0 -16
- package/admin/src/modules/@common/services/product-analytics-service.js +0 -86
- package/admin/src/modules/@common/services/project-service.js +0 -15
- package/admin/src/modules/@common/services/user-service.js +0 -38
- package/admin/src/modules/@common/utils/__tests__/iso-locales-utils.test.js +0 -102
- package/admin/src/modules/@common/utils/are-locales-compatible.js +0 -42
- package/admin/src/modules/@common/utils/format-number.js +0 -1
- package/admin/src/modules/@common/utils/functions/flatten-deep.js +0 -23
- package/admin/src/modules/@common/utils/get-default-locale.js +0 -32
- package/admin/src/modules/@common/utils/get-header-subtitle.js +0 -21
- package/admin/src/modules/@common/utils/get-header-title.js +0 -24
- package/admin/src/modules/@common/utils/get-nav.js +0 -35
- package/admin/src/modules/@common/utils/history.js +0 -6
- package/admin/src/modules/@common/utils/is-plugin-route.js +0 -15
- package/admin/src/modules/@common/utils/iso-locales-utils.js +0 -58
- package/admin/src/modules/@common/utils/redirect-to-plugin-route.js +0 -22
- package/admin/src/modules/@common/utils/sort-by-model-name.js +0 -10
- package/admin/src/modules/alerts/constants/channels.js +0 -1
- package/admin/src/modules/alerts/constants/events.js +0 -4
- package/admin/src/modules/alerts/services/alerts-service.js +0 -41
- package/admin/src/modules/localazy-download/locale/en.js +0 -25
- package/admin/src/modules/localazy-download/services/download-alerts-service.js +0 -12
- package/admin/src/modules/localazy-download/services/localazy-download-service.js +0 -16
- package/admin/src/modules/localazy-upload/components/ReadDocsButton.js +0 -20
- package/admin/src/modules/localazy-upload/locale/en.js +0 -20
- package/admin/src/modules/localazy-upload/services/localazy-upload-service.js +0 -16
- package/admin/src/modules/localazy-upload/services/upload-alerts-service.js +0 -12
- package/admin/src/modules/login/components/LoginButton/index.js +0 -55
- package/admin/src/modules/login/components/LogoutButton/index.js +0 -49
- package/admin/src/modules/login/locale/en.js +0 -7
- package/admin/src/modules/login/services/localazy-login-service.js +0 -29
- package/admin/src/modules/plugin-settings/components/ContentTransferSetup/index.js +0 -308
- package/admin/src/modules/plugin-settings/components/ContentTransferSetupEmpty/index.js +0 -86
- package/admin/src/modules/plugin-settings/components/GlobalSettings/index.js +0 -269
- package/admin/src/modules/plugin-settings/components/Tree/index.js +0 -145
- package/admin/src/modules/plugin-settings/components/TreeItem/index.js +0 -48
- package/admin/src/modules/plugin-settings/functions/build-content-transfer-setup-schema.js +0 -57
- package/admin/src/modules/plugin-settings/functions/get-content-transfer-setup-keys-sets.js +0 -85
- package/admin/src/modules/plugin-settings/functions/has-model-changed.js +0 -75
- package/admin/src/modules/plugin-settings/locale/en.js +0 -61
- package/admin/src/modules/plugin-settings/services/plugin-settings-service.js +0 -55
- package/admin/src/modules/plugin-settings/services/strapi-model-service.js +0 -26
- package/admin/src/modules/plugin-settings/services/strapi-users-service.js +0 -26
- package/admin/src/modules/plugin-settings/utils/__tests__/get-models-tree.test.js +0 -135
- package/admin/src/modules/plugin-settings/utils/array-of-models-to-object.js +0 -6
- package/admin/src/modules/plugin-settings/utils/find-model-value-by-key.js +0 -8
- package/admin/src/modules/plugin-settings/utils/get-filtered-models-schemas.js +0 -31
- package/admin/src/modules/plugin-settings/utils/get-models-tree.js +0 -94
- package/admin/src/modules/settings/components/OverviewItem/index.js +0 -44
- package/admin/src/modules/settings/components/OverviewItemLink/index.js +0 -34
- package/admin/src/modules/settings/components/PrerequisitiesInfo/index.js +0 -28
- package/admin/src/modules/settings/locale/en.js +0 -13
- package/admin/src/modules/user/model/localazy-identity.js +0 -14
- package/admin/src/modules/user/services/localazy-user-service.js +0 -38
- package/admin/src/pages/App/index.js +0 -154
- package/admin/src/pages/Download/index.js +0 -280
- package/admin/src/pages/Index/index.js +0 -8
- package/admin/src/pages/Login/index.js +0 -109
- package/admin/src/pages/PluginSettings/index.js +0 -56
- package/admin/src/pages/Settings/index.js +0 -132
- package/admin/src/pages/Upload/index.js +0 -241
- package/admin/src/pluginId.js +0 -5
- package/admin/src/plugins/generic-connector-client.js +0 -9
- package/admin/src/state/localazy-identity.js +0 -29
- package/admin/src/tests/fixtures/all-models.js +0 -877
- package/admin/src/tests/fixtures/restaurant-model.js +0 -230
- package/admin/src/translations/en.json +0 -4
- package/admin/src/translations/fr.json +0 -1
- package/admin/src/utils/createAxiosInstance.js +0 -54
- package/admin/src/utils/getTrad.js +0 -5
- package/jest.config.js +0 -0
- package/server/bootstrap.js +0 -63
- package/server/config/development/index.js +0 -16
- package/server/config/example/index.js +0 -16
- package/server/config/index.js +0 -20
- package/server/config/local/index.js +0 -16
- package/server/config/production/index.js +0 -17
- package/server/config/schema.graphql.js +0 -21
- package/server/constants/channels.js +0 -3
- package/server/constants/events.js +0 -6
- package/server/content-types/index.js +0 -3
- package/server/controllers/index.js +0 -17
- package/server/controllers/localazy-auth-controller.js +0 -22
- package/server/controllers/localazy-project-controller.js +0 -21
- package/server/controllers/localazy-transfer-controller.js +0 -62
- package/server/controllers/localazy-user-controller.js +0 -24
- package/server/controllers/plugin-settings-controller.js +0 -31
- package/server/controllers/strapi-controller.js +0 -27
- package/server/db/model/content-transfer-setup.js +0 -13
- package/server/db/model/localazy-user.js +0 -23
- package/server/db/model/plugin-settings.js +0 -13
- package/server/db/model/utils/get-strapi-store.js +0 -9
- package/server/destroy.js +0 -5
- package/server/functions/should-set-downloaded-property.js +0 -94
- package/server/index.js +0 -25
- package/server/lifecycles/deep-populate-hook.js +0 -12
- package/server/lifecycles/deprecate-event-entry-in-localazy-hook.js +0 -73
- package/server/lifecycles/upload-event-entry-to-localazy-hook.js +0 -36
- package/server/middlewares/index.js +0 -7
- package/server/middlewares/verify-webhook.js +0 -77
- package/server/models/supported-content-type-fields.js +0 -9
- package/server/models/supported-custom-field-plugins.js +0 -6
- package/server/policies/index.js +0 -3
- package/server/register.js +0 -5
- package/server/routes/index.js +0 -28
- package/server/routes/localazy-auth.js +0 -22
- package/server/routes/localazy-project.js +0 -14
- package/server/routes/localazy-public-transfer.js +0 -20
- package/server/routes/localazy-transfer.js +0 -22
- package/server/routes/localazy-user.js +0 -30
- package/server/routes/plugin-settings.js +0 -38
- package/server/routes/strapi.js +0 -38
- package/server/services/helpers/job-notification-service.js +0 -30
- package/server/services/helpers/plugin-settings-service-helper.js +0 -52
- package/server/services/index.js +0 -23
- package/server/services/localazy-pubapi-service.js +0 -53
- package/server/services/localazy-transfer-download-service.js +0 -445
- package/server/services/localazy-transfer-upload-service.js +0 -178
- package/server/services/localazy-upload-service.js +0 -52
- package/server/services/localazy-user-service.js +0 -29
- package/server/services/plugin-settings-service.js +0 -53
- package/server/services/strapi-i18n-service.js +0 -151
- package/server/services/strapi-localazy-i18n-service.js +0 -130
- package/server/services/strapi-service.js +0 -26
- package/server/tests/fixtures/all-models.js +0 -869
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-cookbook.js +0 -5761
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-lesson-dz.js +0 -402
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-page-dz.js +0 -658
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-restaurant-simple-menu.js +0 -536
- package/server/tests/fixtures/parsed-localazy-entry-to-update-entry.js +0 -35157
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-cookbook-empty-recipes.js +0 -202
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-cookbook.js +0 -2700
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-lesson-dz.js +0 -309
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-simple.js +0 -47
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-with-media.js +0 -169
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-empty.js +0 -3003
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-with-media.js +0 -2057
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-sample-json-dz.js +0 -884
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-sample-json.js +0 -46
- package/server/tests/fixtures/strapi-plugin-all-models.js +0 -7000
- package/server/utils/__tests__/build-populate.test.js +0 -85
- package/server/utils/__tests__/flatten-object.test.js +0 -171
- package/server/utils/__tests__/get-models-tree.test.js +0 -170
- package/server/utils/__tests__/iso-locales-utils.test.js +0 -104
- package/server/utils/__tests__/parsed-localazy-entry-to-create-entry.test.js +0 -258
- package/server/utils/__tests__/parsed-localazy-entry-to-update-entry.test.js +0 -456
- package/server/utils/__tests__/pick-entries.test.js +0 -963
- package/server/utils/__tests__/populate-create-update-entry-with-base-entry.test.js +0 -1176
- package/server/utils/build-populate.js +0 -48
- package/server/utils/delay.js +0 -6
- package/server/utils/flatten-object.js +0 -61
- package/server/utils/generate-random-id.js +0 -3
- package/server/utils/get-full-populate-object.js +0 -66
- package/server/utils/get-main-keys-of-nested-array-objects.js +0 -5
- package/server/utils/get-models-tree.js +0 -47
- package/server/utils/get-picked-flatten-keys-for-hook-entry.js +0 -270
- package/server/utils/intl-display-name.js +0 -4
- package/server/utils/is-generally-applicable-content-type.js +0 -33
- package/server/utils/is-localazy-applicable-content-type.js +0 -36
- package/server/utils/iso-locales-utils.js +0 -60
- package/server/utils/localazy-api-client-factory.js +0 -22
- package/server/utils/localazy-generic-connector-client-factory.js +0 -15
- package/server/utils/model-utils.js +0 -43
- package/server/utils/objectivise-entry.js +0 -41
- package/server/utils/omit-deep.js +0 -24
- package/server/utils/parsed-localazy-entry-to-create-entry.js +0 -194
- package/server/utils/parsed-localazy-entry-to-update-entry.js +0 -83
- package/server/utils/pick-deep.js +0 -22
- package/server/utils/pick-entries.js +0 -37
- package/server/utils/populate-create-update-entry-with-base-entry.js +0 -264
- package/server/utils/request-initiator-helper.js +0 -36
- package/server/utils/reset-array-keys-deep.js +0 -19
- package/server/utils/transfer-setup-utils.js +0 -93
- package/strapi-admin.js +0 -14
- package/strapi-server.js +0 -5
- package/test/helpers/mocks.js +0 -9
|
@@ -1,1176 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const allModels = require("../../tests/fixtures/strapi-plugin-all-models");
|
|
4
|
-
const simpleFlatSimpleModel = require("../../tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-simple");
|
|
5
|
-
const simpleFlatWithMediaModel = require("../../tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-with-media");
|
|
6
|
-
const simpleMenuWithMediaModel = require("../../tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-with-media");
|
|
7
|
-
const simpleMenuEmptyModel = require("../../tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-empty");
|
|
8
|
-
const sampleJSONModel = require("../../tests/fixtures/populate-create-update-entry-with-base-entry-sample-json");
|
|
9
|
-
const cookbookModel = require("../../tests/fixtures/populate-create-update-entry-with-base-entry-cookbook");
|
|
10
|
-
const cookbookEmptyRecipesModel = require("../../tests/fixtures/populate-create-update-entry-with-base-entry-cookbook-empty-recipes");
|
|
11
|
-
const sampleJSONWithDZsModel = require("../../tests/fixtures/populate-create-update-entry-with-base-entry-sample-json-dz");
|
|
12
|
-
const lessonWithDZsModel = require("../../tests/fixtures/populate-create-update-entry-with-base-entry-lesson-dz");
|
|
13
|
-
|
|
14
|
-
const populateCreateUpdateEntryWithBaseEntry = require("../populate-create-update-entry-with-base-entry");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const mocks = require("../../../test/helpers/mocks");
|
|
19
|
-
|
|
20
|
-
describe("populate-create-update-entry-with-base-entry.js", () => {
|
|
21
|
-
Object.defineProperty(global, "strapi", {
|
|
22
|
-
value: mocks.strapi,
|
|
23
|
-
});
|
|
24
|
-
jest.spyOn(mocks.strapi.entityService, "findOne").mockImplementation(() => {
|
|
25
|
-
return {
|
|
26
|
-
id: 24,
|
|
27
|
-
title: "Pro každý den v roce",
|
|
28
|
-
localizations: [],
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it("should populate a 'restaurant-simple-flat' correctly", async () => {
|
|
33
|
-
const populatedEntry = await populateCreateUpdateEntryWithBaseEntry(
|
|
34
|
-
allModels,
|
|
35
|
-
simpleFlatSimpleModel.updateEntry,
|
|
36
|
-
simpleFlatSimpleModel.baseEntry,
|
|
37
|
-
simpleFlatSimpleModel.fullyPopulatedLocalizedEntry,
|
|
38
|
-
simpleFlatSimpleModel.uid,
|
|
39
|
-
simpleFlatSimpleModel.locale,
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const expected = {
|
|
43
|
-
id: 47,
|
|
44
|
-
name: "hlad, okno",
|
|
45
|
-
description: "Orientální pouliční jídlo v ústech rychlé a snadné!",
|
|
46
|
-
established_at: "2022-10-01",
|
|
47
|
-
is_franchise: false,
|
|
48
|
-
contact_email: "david@localazy.com",
|
|
49
|
-
cuisine: "Thai",
|
|
50
|
-
featured_image: null,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
expect(populatedEntry).toEqual(expected);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it("should populate a 'restaurant-simple-flat' with media correctly", async () => {
|
|
57
|
-
const populatedEntry = await populateCreateUpdateEntryWithBaseEntry(
|
|
58
|
-
allModels,
|
|
59
|
-
simpleFlatWithMediaModel.updateEntry,
|
|
60
|
-
simpleFlatWithMediaModel.baseEntry,
|
|
61
|
-
simpleFlatWithMediaModel.fullyPopulatedLocalizedEntry,
|
|
62
|
-
simpleFlatWithMediaModel.uid,
|
|
63
|
-
simpleFlatWithMediaModel.locale,
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
const expected = {
|
|
67
|
-
id: 52,
|
|
68
|
-
name: "Michelin",
|
|
69
|
-
description: "Najbardziej wyszukana restauracja w Układzie Słonecznym. Sprawdź nasze menu stworzone przez jedynego Gordona Ramsaya.",
|
|
70
|
-
established_at: "2002-06-23",
|
|
71
|
-
is_franchise: true,
|
|
72
|
-
contact_email: "david@localazy.com",
|
|
73
|
-
cuisine: "French",
|
|
74
|
-
featured_image: {
|
|
75
|
-
id: 1,
|
|
76
|
-
name: "jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
77
|
-
alternativeText: "jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
78
|
-
caption: "jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
79
|
-
width: 5596,
|
|
80
|
-
height: 3731,
|
|
81
|
-
formats: {
|
|
82
|
-
thumbnail: {
|
|
83
|
-
name: "thumbnail_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
84
|
-
hash: "thumbnail_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
85
|
-
ext: ".jpg",
|
|
86
|
-
mime: "image/jpeg",
|
|
87
|
-
path: null,
|
|
88
|
-
width: 234,
|
|
89
|
-
height: 156,
|
|
90
|
-
size: 11.74,
|
|
91
|
-
url: "/uploads/thumbnail_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
92
|
-
},
|
|
93
|
-
large: {
|
|
94
|
-
name: "large_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
95
|
-
hash: "large_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
96
|
-
ext: ".jpg",
|
|
97
|
-
mime: "image/jpeg",
|
|
98
|
-
path: null,
|
|
99
|
-
width: 1000,
|
|
100
|
-
height: 666,
|
|
101
|
-
size: 140.2,
|
|
102
|
-
url: "/uploads/large_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
103
|
-
},
|
|
104
|
-
medium: {
|
|
105
|
-
name: "medium_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
106
|
-
hash: "medium_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
107
|
-
ext: ".jpg",
|
|
108
|
-
mime: "image/jpeg",
|
|
109
|
-
path: null,
|
|
110
|
-
width: 750,
|
|
111
|
-
height: 500,
|
|
112
|
-
size: 86.32,
|
|
113
|
-
url: "/uploads/medium_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
114
|
-
},
|
|
115
|
-
small: {
|
|
116
|
-
name: "small_jason-leung-poI7DelFiVA-unsplash.jpg",
|
|
117
|
-
hash: "small_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
118
|
-
ext: ".jpg",
|
|
119
|
-
mime: "image/jpeg",
|
|
120
|
-
path: null,
|
|
121
|
-
width: 500,
|
|
122
|
-
height: 333,
|
|
123
|
-
size: 42.51,
|
|
124
|
-
url: "/uploads/small_jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
hash: "jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b",
|
|
128
|
-
ext: ".jpg",
|
|
129
|
-
mime: "image/jpeg",
|
|
130
|
-
size: 3461.64,
|
|
131
|
-
url: "/uploads/jason_leung_po_I7_Del_Fi_VA_unsplash_508d22c55b.jpg",
|
|
132
|
-
previewUrl: null,
|
|
133
|
-
provider: "local",
|
|
134
|
-
provider_metadata: null,
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
expect(populatedEntry).toEqual(expected);
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
// with menu
|
|
142
|
-
it("should populate a 'restaurant-simple-menu' with menu and media correctly", async () => {
|
|
143
|
-
const populatedEntry = await populateCreateUpdateEntryWithBaseEntry(
|
|
144
|
-
allModels,
|
|
145
|
-
simpleMenuWithMediaModel.updateEntry,
|
|
146
|
-
simpleMenuWithMediaModel.baseEntry,
|
|
147
|
-
simpleMenuWithMediaModel.fullyPopulatedLocalizedEntry,
|
|
148
|
-
simpleMenuWithMediaModel.uid,
|
|
149
|
-
simpleMenuWithMediaModel.locale,
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
const expected = {
|
|
153
|
-
id: 37,
|
|
154
|
-
name: "Głodne okno",
|
|
155
|
-
description: "Orientalne jedzenie uliczne w ustach szybko i łatwo!",
|
|
156
|
-
established_at: "2022-10-01",
|
|
157
|
-
is_franchise: false,
|
|
158
|
-
contact_email: "david@localazy.com",
|
|
159
|
-
cuisine: "Thai",
|
|
160
|
-
capacity: 68,
|
|
161
|
-
our_story: "Za nami jest więcej**! Sprawdź naszą historię na [Localazy] (https://localazy.com).\n\n! [Logo_sq-01.png] (/uploads/Logo_sq_01_08b9bb6be1.png)",
|
|
162
|
-
used_cookbooks: {
|
|
163
|
-
id: 1,
|
|
164
|
-
},
|
|
165
|
-
menu: [
|
|
166
|
-
{
|
|
167
|
-
id: 40,
|
|
168
|
-
name: "Zupa Curry",
|
|
169
|
-
price: 5,
|
|
170
|
-
currency: "$",
|
|
171
|
-
description: "_Super pyszna zupa. _\n\n<u>Ostrzeżenie: Ostre jak diabli! </u>",
|
|
172
|
-
is_available: true,
|
|
173
|
-
food_gallery: [
|
|
174
|
-
{
|
|
175
|
-
id: 3,
|
|
176
|
-
name: "emy-XoByiBymX20-unsplash.jpg",
|
|
177
|
-
alternativeText: "emy-XoByiBymX20-unsplash.jpg",
|
|
178
|
-
caption: "emy-XoByiBymX20-unsplash.jpg",
|
|
179
|
-
width: 5184,
|
|
180
|
-
height: 3456,
|
|
181
|
-
formats: {
|
|
182
|
-
thumbnail: {
|
|
183
|
-
name: "thumbnail_emy-XoByiBymX20-unsplash.jpg",
|
|
184
|
-
hash: "thumbnail_emy_Xo_Byi_Bym_X20_unsplash_a5d1373d3a",
|
|
185
|
-
ext: ".jpg",
|
|
186
|
-
mime: "image/jpeg",
|
|
187
|
-
path: null,
|
|
188
|
-
width: 234,
|
|
189
|
-
height: 156,
|
|
190
|
-
size: 11.04,
|
|
191
|
-
url: "/uploads/thumbnail_emy_Xo_Byi_Bym_X20_unsplash_a5d1373d3a.jpg",
|
|
192
|
-
},
|
|
193
|
-
large: {
|
|
194
|
-
name: "large_emy-XoByiBymX20-unsplash.jpg",
|
|
195
|
-
hash: "large_emy_Xo_Byi_Bym_X20_unsplash_a5d1373d3a",
|
|
196
|
-
ext: ".jpg",
|
|
197
|
-
mime: "image/jpeg",
|
|
198
|
-
path: null,
|
|
199
|
-
width: 1000,
|
|
200
|
-
height: 667,
|
|
201
|
-
size: 97.59,
|
|
202
|
-
url: "/uploads/large_emy_Xo_Byi_Bym_X20_unsplash_a5d1373d3a.jpg",
|
|
203
|
-
},
|
|
204
|
-
medium: {
|
|
205
|
-
name: "medium_emy-XoByiBymX20-unsplash.jpg",
|
|
206
|
-
hash: "medium_emy_Xo_Byi_Bym_X20_unsplash_a5d1373d3a",
|
|
207
|
-
ext: ".jpg",
|
|
208
|
-
mime: "image/jpeg",
|
|
209
|
-
path: null,
|
|
210
|
-
width: 750,
|
|
211
|
-
height: 500,
|
|
212
|
-
size: 63.15,
|
|
213
|
-
url: "/uploads/medium_emy_Xo_Byi_Bym_X20_unsplash_a5d1373d3a.jpg",
|
|
214
|
-
},
|
|
215
|
-
small: {
|
|
216
|
-
name: "small_emy-XoByiBymX20-unsplash.jpg",
|
|
217
|
-
hash: "small_emy_Xo_Byi_Bym_X20_unsplash_a5d1373d3a",
|
|
218
|
-
ext: ".jpg",
|
|
219
|
-
mime: "image/jpeg",
|
|
220
|
-
path: null,
|
|
221
|
-
width: 500,
|
|
222
|
-
height: 333,
|
|
223
|
-
size: 33.98,
|
|
224
|
-
url: "/uploads/small_emy_Xo_Byi_Bym_X20_unsplash_a5d1373d3a.jpg",
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
hash: "emy_Xo_Byi_Bym_X20_unsplash_a5d1373d3a",
|
|
228
|
-
ext: ".jpg",
|
|
229
|
-
mime: "image/jpeg",
|
|
230
|
-
size: 1411.68,
|
|
231
|
-
url: "/uploads/emy_Xo_Byi_Bym_X20_unsplash_a5d1373d3a.jpg",
|
|
232
|
-
previewUrl: null,
|
|
233
|
-
provider: "local",
|
|
234
|
-
provider_metadata: null,
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
id: 4,
|
|
238
|
-
name: "ting-tian-al9eh9QkdPA-unsplash.jpg",
|
|
239
|
-
alternativeText: "ting-tian-al9eh9QkdPA-unsplash.jpg",
|
|
240
|
-
caption: "ting-tian-al9eh9QkdPA-unsplash.jpg",
|
|
241
|
-
width: 3840,
|
|
242
|
-
height: 5760,
|
|
243
|
-
formats: {
|
|
244
|
-
thumbnail: {
|
|
245
|
-
name: "thumbnail_ting-tian-al9eh9QkdPA-unsplash.jpg",
|
|
246
|
-
hash: "thumbnail_ting_tian_al9eh9_Qkd_PA_unsplash_d5132e8a85",
|
|
247
|
-
ext: ".jpg",
|
|
248
|
-
mime: "image/jpeg",
|
|
249
|
-
path: null,
|
|
250
|
-
width: 104,
|
|
251
|
-
height: 156,
|
|
252
|
-
size: 6.06,
|
|
253
|
-
url: "/uploads/thumbnail_ting_tian_al9eh9_Qkd_PA_unsplash_d5132e8a85.jpg",
|
|
254
|
-
},
|
|
255
|
-
large: {
|
|
256
|
-
name: "large_ting-tian-al9eh9QkdPA-unsplash.jpg",
|
|
257
|
-
hash: "large_ting_tian_al9eh9_Qkd_PA_unsplash_d5132e8a85",
|
|
258
|
-
ext: ".jpg",
|
|
259
|
-
mime: "image/jpeg",
|
|
260
|
-
path: null,
|
|
261
|
-
width: 667,
|
|
262
|
-
height: 1000,
|
|
263
|
-
size: 202.98,
|
|
264
|
-
url: "/uploads/large_ting_tian_al9eh9_Qkd_PA_unsplash_d5132e8a85.jpg",
|
|
265
|
-
},
|
|
266
|
-
medium: {
|
|
267
|
-
name: "medium_ting-tian-al9eh9QkdPA-unsplash.jpg",
|
|
268
|
-
hash: "medium_ting_tian_al9eh9_Qkd_PA_unsplash_d5132e8a85",
|
|
269
|
-
ext: ".jpg",
|
|
270
|
-
mime: "image/jpeg",
|
|
271
|
-
path: null,
|
|
272
|
-
width: 500,
|
|
273
|
-
height: 750,
|
|
274
|
-
size: 120.06,
|
|
275
|
-
url: "/uploads/medium_ting_tian_al9eh9_Qkd_PA_unsplash_d5132e8a85.jpg",
|
|
276
|
-
},
|
|
277
|
-
small: {
|
|
278
|
-
name: "small_ting-tian-al9eh9QkdPA-unsplash.jpg",
|
|
279
|
-
hash: "small_ting_tian_al9eh9_Qkd_PA_unsplash_d5132e8a85",
|
|
280
|
-
ext: ".jpg",
|
|
281
|
-
mime: "image/jpeg",
|
|
282
|
-
path: null,
|
|
283
|
-
width: 333,
|
|
284
|
-
height: 500,
|
|
285
|
-
size: 54.32,
|
|
286
|
-
url: "/uploads/small_ting_tian_al9eh9_Qkd_PA_unsplash_d5132e8a85.jpg",
|
|
287
|
-
},
|
|
288
|
-
},
|
|
289
|
-
hash: "ting_tian_al9eh9_Qkd_PA_unsplash_d5132e8a85",
|
|
290
|
-
ext: ".jpg",
|
|
291
|
-
mime: "image/jpeg",
|
|
292
|
-
size: 5952.03,
|
|
293
|
-
url: "/uploads/ting_tian_al9eh9_Qkd_PA_unsplash_d5132e8a85.jpg",
|
|
294
|
-
previewUrl: null,
|
|
295
|
-
provider: "local",
|
|
296
|
-
provider_metadata: null,
|
|
297
|
-
},
|
|
298
|
-
],
|
|
299
|
-
},
|
|
300
|
-
],
|
|
301
|
-
featured_image: null,
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
expect(populatedEntry).toEqual(expected);
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
it("should populate a 'restaurant-simple-menu' without menu correctly", async () => {
|
|
308
|
-
const populatedEntry = await populateCreateUpdateEntryWithBaseEntry(
|
|
309
|
-
allModels,
|
|
310
|
-
simpleMenuEmptyModel.updateEntry,
|
|
311
|
-
simpleMenuEmptyModel.baseEntry,
|
|
312
|
-
simpleMenuEmptyModel.fullyPopulatedLocalizedEntry,
|
|
313
|
-
simpleMenuEmptyModel.uid,
|
|
314
|
-
simpleMenuEmptyModel.locale,
|
|
315
|
-
);
|
|
316
|
-
|
|
317
|
-
const expected = {
|
|
318
|
-
id: 39,
|
|
319
|
-
name: "Niebieska ostryga",
|
|
320
|
-
description: "Widzisz jedzenie? Lepiej powiedzmy, że owoce morza!",
|
|
321
|
-
established_at: "1822-07-09",
|
|
322
|
-
is_franchise: null,
|
|
323
|
-
contact_email: "david@localazy.com",
|
|
324
|
-
cuisine: "Italian",
|
|
325
|
-
capacity: 16,
|
|
326
|
-
our_story: "Długa tradycja, mądrość przekazywana z pokolenia na pokolenie... Od 1822 roku.",
|
|
327
|
-
supported_restaurants: [
|
|
328
|
-
{
|
|
329
|
-
id: 2,
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
id: 1,
|
|
333
|
-
},
|
|
334
|
-
],
|
|
335
|
-
used_cookbooks: {
|
|
336
|
-
id: 1,
|
|
337
|
-
},
|
|
338
|
-
menu: [
|
|
339
|
-
],
|
|
340
|
-
featured_image: null,
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
expect(populatedEntry).toEqual(expected);
|
|
344
|
-
});
|
|
345
|
-
|
|
346
|
-
it("should populate a 'sample-json' correctly", async () => {
|
|
347
|
-
const populatedEntry = await populateCreateUpdateEntryWithBaseEntry(
|
|
348
|
-
allModels,
|
|
349
|
-
sampleJSONModel.updateEntry,
|
|
350
|
-
sampleJSONModel.baseEntry,
|
|
351
|
-
sampleJSONModel.fullyPopulatedLocalizedEntry,
|
|
352
|
-
sampleJSONModel.uid,
|
|
353
|
-
sampleJSONModel.locale,
|
|
354
|
-
);
|
|
355
|
-
|
|
356
|
-
const expected = {
|
|
357
|
-
id: 17,
|
|
358
|
-
purpose: "Foo CZ",
|
|
359
|
-
data: {
|
|
360
|
-
foo: "bar",
|
|
361
|
-
bar: {
|
|
362
|
-
foo: "baz",
|
|
363
|
-
},
|
|
364
|
-
},
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
expect(populatedEntry).toEqual(expected);
|
|
368
|
-
});
|
|
369
|
-
|
|
370
|
-
it("should populate a 'cookbook' correctly", async () => {
|
|
371
|
-
const populatedEntry = await populateCreateUpdateEntryWithBaseEntry(
|
|
372
|
-
allModels,
|
|
373
|
-
cookbookModel.updateEntry,
|
|
374
|
-
cookbookModel.baseEntry,
|
|
375
|
-
cookbookModel.fullyPopulatedLocalizedEntry,
|
|
376
|
-
cookbookModel.uid,
|
|
377
|
-
cookbookModel.locale,
|
|
378
|
-
);
|
|
379
|
-
|
|
380
|
-
const expected = {
|
|
381
|
-
id: 24,
|
|
382
|
-
title: "Pro každý den v roce",
|
|
383
|
-
used_in_restaurants: [
|
|
384
|
-
{
|
|
385
|
-
id: 1,
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
id: 3,
|
|
389
|
-
},
|
|
390
|
-
],
|
|
391
|
-
author_name: "David V.",
|
|
392
|
-
pages: 365,
|
|
393
|
-
recipes: [
|
|
394
|
-
{
|
|
395
|
-
id: 20,
|
|
396
|
-
name: "Bramborový salát",
|
|
397
|
-
recipe: "Oloupejte brambory, smíchejte je se všemi ingrediencemi a máte hotovo. Bon apetit!",
|
|
398
|
-
estimated_cook_time: "00:30:00.000",
|
|
399
|
-
difficulty: "easy",
|
|
400
|
-
author_name: "Mr. Bramborová hlava",
|
|
401
|
-
gallery: [
|
|
402
|
-
{
|
|
403
|
-
id: 100,
|
|
404
|
-
image_title: "Syrové brambory",
|
|
405
|
-
image_description: "Čerstvý!",
|
|
406
|
-
image: {
|
|
407
|
-
id: 6,
|
|
408
|
-
name: "rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
409
|
-
alternativeText: "rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
410
|
-
caption: "rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
411
|
-
width: 2268,
|
|
412
|
-
height: 4032,
|
|
413
|
-
formats: {
|
|
414
|
-
thumbnail: {
|
|
415
|
-
name: "thumbnail_rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
416
|
-
hash: "thumbnail_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea",
|
|
417
|
-
ext: ".jpg",
|
|
418
|
-
mime: "image/jpeg",
|
|
419
|
-
path: null,
|
|
420
|
-
width: 88,
|
|
421
|
-
height: 156,
|
|
422
|
-
size: 5.35,
|
|
423
|
-
url: "/uploads/thumbnail_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea.jpg",
|
|
424
|
-
},
|
|
425
|
-
large: {
|
|
426
|
-
name: "large_rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
427
|
-
hash: "large_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea",
|
|
428
|
-
ext: ".jpg",
|
|
429
|
-
mime: "image/jpeg",
|
|
430
|
-
path: null,
|
|
431
|
-
width: 563,
|
|
432
|
-
height: 1000,
|
|
433
|
-
size: 108.15,
|
|
434
|
-
url: "/uploads/large_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea.jpg",
|
|
435
|
-
},
|
|
436
|
-
medium: {
|
|
437
|
-
name: "medium_rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
438
|
-
hash: "medium_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea",
|
|
439
|
-
ext: ".jpg",
|
|
440
|
-
mime: "image/jpeg",
|
|
441
|
-
path: null,
|
|
442
|
-
width: 422,
|
|
443
|
-
height: 750,
|
|
444
|
-
size: 65.52,
|
|
445
|
-
url: "/uploads/medium_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea.jpg",
|
|
446
|
-
},
|
|
447
|
-
small: {
|
|
448
|
-
name: "small_rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
449
|
-
hash: "small_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea",
|
|
450
|
-
ext: ".jpg",
|
|
451
|
-
mime: "image/jpeg",
|
|
452
|
-
path: null,
|
|
453
|
-
width: 281,
|
|
454
|
-
height: 500,
|
|
455
|
-
size: 34.23,
|
|
456
|
-
url: "/uploads/small_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea.jpg",
|
|
457
|
-
},
|
|
458
|
-
},
|
|
459
|
-
hash: "rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea",
|
|
460
|
-
ext: ".jpg",
|
|
461
|
-
mime: "image/jpeg",
|
|
462
|
-
size: 1081.59,
|
|
463
|
-
url: "/uploads/rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea.jpg",
|
|
464
|
-
previewUrl: null,
|
|
465
|
-
provider: "local",
|
|
466
|
-
provider_metadata: null,
|
|
467
|
-
},
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
id: 101,
|
|
471
|
-
image_title: "Salát",
|
|
472
|
-
image_description: "Mňam!",
|
|
473
|
-
image: {
|
|
474
|
-
id: 7,
|
|
475
|
-
name: "jeffrey-betts-PeyzQt7tMk0-unsplash.jpg",
|
|
476
|
-
alternativeText: "jeffrey-betts-PeyzQt7tMk0-unsplash.jpg",
|
|
477
|
-
caption: "jeffrey-betts-PeyzQt7tMk0-unsplash.jpg",
|
|
478
|
-
width: 4608,
|
|
479
|
-
height: 3456,
|
|
480
|
-
formats: {
|
|
481
|
-
thumbnail: {
|
|
482
|
-
name: "thumbnail_jeffrey-betts-PeyzQt7tMk0-unsplash.jpg",
|
|
483
|
-
hash: "thumbnail_jeffrey_betts_Peyz_Qt7t_Mk0_unsplash_9650d628db",
|
|
484
|
-
ext: ".jpg",
|
|
485
|
-
mime: "image/jpeg",
|
|
486
|
-
path: null,
|
|
487
|
-
width: 208,
|
|
488
|
-
height: 156,
|
|
489
|
-
size: 9.03,
|
|
490
|
-
url: "/uploads/thumbnail_jeffrey_betts_Peyz_Qt7t_Mk0_unsplash_9650d628db.jpg",
|
|
491
|
-
},
|
|
492
|
-
large: {
|
|
493
|
-
name: "large_jeffrey-betts-PeyzQt7tMk0-unsplash.jpg",
|
|
494
|
-
hash: "large_jeffrey_betts_Peyz_Qt7t_Mk0_unsplash_9650d628db",
|
|
495
|
-
ext: ".jpg",
|
|
496
|
-
mime: "image/jpeg",
|
|
497
|
-
path: null,
|
|
498
|
-
width: 1000,
|
|
499
|
-
height: 750,
|
|
500
|
-
size: 102.77,
|
|
501
|
-
url: "/uploads/large_jeffrey_betts_Peyz_Qt7t_Mk0_unsplash_9650d628db.jpg",
|
|
502
|
-
},
|
|
503
|
-
medium: {
|
|
504
|
-
name: "medium_jeffrey-betts-PeyzQt7tMk0-unsplash.jpg",
|
|
505
|
-
hash: "medium_jeffrey_betts_Peyz_Qt7t_Mk0_unsplash_9650d628db",
|
|
506
|
-
ext: ".jpg",
|
|
507
|
-
mime: "image/jpeg",
|
|
508
|
-
path: null,
|
|
509
|
-
width: 750,
|
|
510
|
-
height: 563,
|
|
511
|
-
size: 66.26,
|
|
512
|
-
url: "/uploads/medium_jeffrey_betts_Peyz_Qt7t_Mk0_unsplash_9650d628db.jpg",
|
|
513
|
-
},
|
|
514
|
-
small: {
|
|
515
|
-
name: "small_jeffrey-betts-PeyzQt7tMk0-unsplash.jpg",
|
|
516
|
-
hash: "small_jeffrey_betts_Peyz_Qt7t_Mk0_unsplash_9650d628db",
|
|
517
|
-
ext: ".jpg",
|
|
518
|
-
mime: "image/jpeg",
|
|
519
|
-
path: null,
|
|
520
|
-
width: 500,
|
|
521
|
-
height: 375,
|
|
522
|
-
size: 35.17,
|
|
523
|
-
url: "/uploads/small_jeffrey_betts_Peyz_Qt7t_Mk0_unsplash_9650d628db.jpg",
|
|
524
|
-
},
|
|
525
|
-
},
|
|
526
|
-
hash: "jeffrey_betts_Peyz_Qt7t_Mk0_unsplash_9650d628db",
|
|
527
|
-
ext: ".jpg",
|
|
528
|
-
mime: "image/jpeg",
|
|
529
|
-
size: 1664.79,
|
|
530
|
-
url: "/uploads/jeffrey_betts_Peyz_Qt7t_Mk0_unsplash_9650d628db.jpg",
|
|
531
|
-
previewUrl: null,
|
|
532
|
-
provider: "local",
|
|
533
|
-
provider_metadata: null,
|
|
534
|
-
},
|
|
535
|
-
},
|
|
536
|
-
],
|
|
537
|
-
ingredients: [
|
|
538
|
-
{
|
|
539
|
-
id: 115,
|
|
540
|
-
name: "Brambory",
|
|
541
|
-
amount: 2,
|
|
542
|
-
unit: "kg",
|
|
543
|
-
is_required: true,
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
id: 116,
|
|
547
|
-
name: "Hrášek",
|
|
548
|
-
amount: 0.5,
|
|
549
|
-
unit: "plechovka",
|
|
550
|
-
is_required: true,
|
|
551
|
-
},
|
|
552
|
-
{
|
|
553
|
-
id: 117,
|
|
554
|
-
name: "Kukuřice",
|
|
555
|
-
amount: 0.5,
|
|
556
|
-
unit: "plechovka",
|
|
557
|
-
is_required: true,
|
|
558
|
-
},
|
|
559
|
-
{
|
|
560
|
-
id: 118,
|
|
561
|
-
name: "Majonéza",
|
|
562
|
-
amount: 4,
|
|
563
|
-
unit: "1",
|
|
564
|
-
is_required: true,
|
|
565
|
-
},
|
|
566
|
-
{
|
|
567
|
-
id: 119,
|
|
568
|
-
name: "Sýr",
|
|
569
|
-
amount: 1,
|
|
570
|
-
unit: "1",
|
|
571
|
-
is_required: true,
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
id: 120,
|
|
575
|
-
name: "Jablko",
|
|
576
|
-
amount: 1,
|
|
577
|
-
unit: "ks",
|
|
578
|
-
is_required: true,
|
|
579
|
-
},
|
|
580
|
-
],
|
|
581
|
-
},
|
|
582
|
-
],
|
|
583
|
-
gallery: {
|
|
584
|
-
id: 24,
|
|
585
|
-
optional_title: null,
|
|
586
|
-
annotation: "Podívejte se na naše chutné jídlo, pak čtěte dál a ponořte se do kulinářského nebe!",
|
|
587
|
-
main_image: {
|
|
588
|
-
id: 102,
|
|
589
|
-
image_title: "Kuchařka",
|
|
590
|
-
image_description: "Booklet",
|
|
591
|
-
image: {
|
|
592
|
-
id: 9,
|
|
593
|
-
name: "dan-gold-5O1ddenSM4g-unsplash.jpg",
|
|
594
|
-
alternativeText: "dan-gold-5O1ddenSM4g-unsplash.jpg",
|
|
595
|
-
caption: "dan-gold-5O1ddenSM4g-unsplash.jpg",
|
|
596
|
-
width: 6000,
|
|
597
|
-
height: 3376,
|
|
598
|
-
formats: {
|
|
599
|
-
thumbnail: {
|
|
600
|
-
name: "thumbnail_dan-gold-5O1ddenSM4g-unsplash.jpg",
|
|
601
|
-
hash: "thumbnail_dan_gold_5_O1dden_SM_4g_unsplash_5adef7d907",
|
|
602
|
-
ext: ".jpg",
|
|
603
|
-
mime: "image/jpeg",
|
|
604
|
-
path: null,
|
|
605
|
-
width: 245,
|
|
606
|
-
height: 138,
|
|
607
|
-
size: 7.44,
|
|
608
|
-
url: "/uploads/thumbnail_dan_gold_5_O1dden_SM_4g_unsplash_5adef7d907.jpg",
|
|
609
|
-
},
|
|
610
|
-
large: {
|
|
611
|
-
name: "large_dan-gold-5O1ddenSM4g-unsplash.jpg",
|
|
612
|
-
hash: "large_dan_gold_5_O1dden_SM_4g_unsplash_5adef7d907",
|
|
613
|
-
ext: ".jpg",
|
|
614
|
-
mime: "image/jpeg",
|
|
615
|
-
path: null,
|
|
616
|
-
width: 1000,
|
|
617
|
-
height: 563,
|
|
618
|
-
size: 52.67,
|
|
619
|
-
url: "/uploads/large_dan_gold_5_O1dden_SM_4g_unsplash_5adef7d907.jpg",
|
|
620
|
-
},
|
|
621
|
-
medium: {
|
|
622
|
-
name: "medium_dan-gold-5O1ddenSM4g-unsplash.jpg",
|
|
623
|
-
hash: "medium_dan_gold_5_O1dden_SM_4g_unsplash_5adef7d907",
|
|
624
|
-
ext: ".jpg",
|
|
625
|
-
mime: "image/jpeg",
|
|
626
|
-
path: null,
|
|
627
|
-
width: 750,
|
|
628
|
-
height: 422,
|
|
629
|
-
size: 35.15,
|
|
630
|
-
url: "/uploads/medium_dan_gold_5_O1dden_SM_4g_unsplash_5adef7d907.jpg",
|
|
631
|
-
},
|
|
632
|
-
small: {
|
|
633
|
-
name: "small_dan-gold-5O1ddenSM4g-unsplash.jpg",
|
|
634
|
-
hash: "small_dan_gold_5_O1dden_SM_4g_unsplash_5adef7d907",
|
|
635
|
-
ext: ".jpg",
|
|
636
|
-
mime: "image/jpeg",
|
|
637
|
-
path: null,
|
|
638
|
-
width: 500,
|
|
639
|
-
height: 281,
|
|
640
|
-
size: 19.95,
|
|
641
|
-
url: "/uploads/small_dan_gold_5_O1dden_SM_4g_unsplash_5adef7d907.jpg",
|
|
642
|
-
},
|
|
643
|
-
},
|
|
644
|
-
hash: "dan_gold_5_O1dden_SM_4g_unsplash_5adef7d907",
|
|
645
|
-
ext: ".jpg",
|
|
646
|
-
mime: "image/jpeg",
|
|
647
|
-
size: 972.68,
|
|
648
|
-
url: "/uploads/dan_gold_5_O1dden_SM_4g_unsplash_5adef7d907.jpg",
|
|
649
|
-
previewUrl: null,
|
|
650
|
-
provider: "local",
|
|
651
|
-
provider_metadata: null,
|
|
652
|
-
},
|
|
653
|
-
},
|
|
654
|
-
gallery: [
|
|
655
|
-
{
|
|
656
|
-
id: 103,
|
|
657
|
-
image_title: null,
|
|
658
|
-
image_description: "Brožura, listy a vidlička.",
|
|
659
|
-
image: {
|
|
660
|
-
id: 11,
|
|
661
|
-
name: "heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
662
|
-
alternativeText: "heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
663
|
-
caption: "heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
664
|
-
width: 6127,
|
|
665
|
-
height: 3844,
|
|
666
|
-
formats: {
|
|
667
|
-
thumbnail: {
|
|
668
|
-
name: "thumbnail_heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
669
|
-
hash: "thumbnail_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f",
|
|
670
|
-
ext: ".jpg",
|
|
671
|
-
mime: "image/jpeg",
|
|
672
|
-
path: null,
|
|
673
|
-
width: 245,
|
|
674
|
-
height: 154,
|
|
675
|
-
size: 9.54,
|
|
676
|
-
url: "/uploads/thumbnail_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f.jpg",
|
|
677
|
-
},
|
|
678
|
-
large: {
|
|
679
|
-
name: "large_heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
680
|
-
hash: "large_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f",
|
|
681
|
-
ext: ".jpg",
|
|
682
|
-
mime: "image/jpeg",
|
|
683
|
-
path: null,
|
|
684
|
-
width: 1000,
|
|
685
|
-
height: 628,
|
|
686
|
-
size: 117.56,
|
|
687
|
-
url: "/uploads/large_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f.jpg",
|
|
688
|
-
},
|
|
689
|
-
medium: {
|
|
690
|
-
name: "medium_heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
691
|
-
hash: "medium_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f",
|
|
692
|
-
ext: ".jpg",
|
|
693
|
-
mime: "image/jpeg",
|
|
694
|
-
path: null,
|
|
695
|
-
width: 750,
|
|
696
|
-
height: 471,
|
|
697
|
-
size: 66.32,
|
|
698
|
-
url: "/uploads/medium_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f.jpg",
|
|
699
|
-
},
|
|
700
|
-
small: {
|
|
701
|
-
name: "small_heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
702
|
-
hash: "small_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f",
|
|
703
|
-
ext: ".jpg",
|
|
704
|
-
mime: "image/jpeg",
|
|
705
|
-
path: null,
|
|
706
|
-
width: 500,
|
|
707
|
-
height: 314,
|
|
708
|
-
size: 31.42,
|
|
709
|
-
url: "/uploads/small_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f.jpg",
|
|
710
|
-
},
|
|
711
|
-
},
|
|
712
|
-
hash: "heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f",
|
|
713
|
-
ext: ".jpg",
|
|
714
|
-
mime: "image/jpeg",
|
|
715
|
-
size: 6971.47,
|
|
716
|
-
url: "/uploads/heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f.jpg",
|
|
717
|
-
previewUrl: null,
|
|
718
|
-
provider: "local",
|
|
719
|
-
provider_metadata: null,
|
|
720
|
-
},
|
|
721
|
-
},
|
|
722
|
-
{
|
|
723
|
-
id: 104,
|
|
724
|
-
image_title: "Koření",
|
|
725
|
-
image_description: null,
|
|
726
|
-
image: {
|
|
727
|
-
id: 10,
|
|
728
|
-
name: "calum-lewis-vA1L1jRTM70-unsplash.jpg",
|
|
729
|
-
alternativeText: "calum-lewis-vA1L1jRTM70-unsplash.jpg",
|
|
730
|
-
caption: "calum-lewis-vA1L1jRTM70-unsplash.jpg",
|
|
731
|
-
width: 3569,
|
|
732
|
-
height: 5353,
|
|
733
|
-
formats: {
|
|
734
|
-
thumbnail: {
|
|
735
|
-
name: "thumbnail_calum-lewis-vA1L1jRTM70-unsplash.jpg",
|
|
736
|
-
hash: "thumbnail_calum_lewis_v_A1_L1j_RTM_70_unsplash_5aff3a8997",
|
|
737
|
-
ext: ".jpg",
|
|
738
|
-
mime: "image/jpeg",
|
|
739
|
-
path: null,
|
|
740
|
-
width: 104,
|
|
741
|
-
height: 156,
|
|
742
|
-
size: 5.55,
|
|
743
|
-
url: "/uploads/thumbnail_calum_lewis_v_A1_L1j_RTM_70_unsplash_5aff3a8997.jpg",
|
|
744
|
-
},
|
|
745
|
-
large: {
|
|
746
|
-
name: "large_calum-lewis-vA1L1jRTM70-unsplash.jpg",
|
|
747
|
-
hash: "large_calum_lewis_v_A1_L1j_RTM_70_unsplash_5aff3a8997",
|
|
748
|
-
ext: ".jpg",
|
|
749
|
-
mime: "image/jpeg",
|
|
750
|
-
path: null,
|
|
751
|
-
width: 667,
|
|
752
|
-
height: 1000,
|
|
753
|
-
size: 116.32,
|
|
754
|
-
url: "/uploads/large_calum_lewis_v_A1_L1j_RTM_70_unsplash_5aff3a8997.jpg",
|
|
755
|
-
},
|
|
756
|
-
medium: {
|
|
757
|
-
name: "medium_calum-lewis-vA1L1jRTM70-unsplash.jpg",
|
|
758
|
-
hash: "medium_calum_lewis_v_A1_L1j_RTM_70_unsplash_5aff3a8997",
|
|
759
|
-
ext: ".jpg",
|
|
760
|
-
mime: "image/jpeg",
|
|
761
|
-
path: null,
|
|
762
|
-
width: 500,
|
|
763
|
-
height: 750,
|
|
764
|
-
size: 72.75,
|
|
765
|
-
url: "/uploads/medium_calum_lewis_v_A1_L1j_RTM_70_unsplash_5aff3a8997.jpg",
|
|
766
|
-
},
|
|
767
|
-
small: {
|
|
768
|
-
name: "small_calum-lewis-vA1L1jRTM70-unsplash.jpg",
|
|
769
|
-
hash: "small_calum_lewis_v_A1_L1j_RTM_70_unsplash_5aff3a8997",
|
|
770
|
-
ext: ".jpg",
|
|
771
|
-
mime: "image/jpeg",
|
|
772
|
-
path: null,
|
|
773
|
-
width: 333,
|
|
774
|
-
height: 500,
|
|
775
|
-
size: 36.52,
|
|
776
|
-
url: "/uploads/small_calum_lewis_v_A1_L1j_RTM_70_unsplash_5aff3a8997.jpg",
|
|
777
|
-
},
|
|
778
|
-
},
|
|
779
|
-
hash: "calum_lewis_v_A1_L1j_RTM_70_unsplash_5aff3a8997",
|
|
780
|
-
ext: ".jpg",
|
|
781
|
-
mime: "image/jpeg",
|
|
782
|
-
size: 2305.97,
|
|
783
|
-
url: "/uploads/calum_lewis_v_A1_L1j_RTM_70_unsplash_5aff3a8997.jpg",
|
|
784
|
-
previewUrl: null,
|
|
785
|
-
provider: "local",
|
|
786
|
-
provider_metadata: null,
|
|
787
|
-
},
|
|
788
|
-
},
|
|
789
|
-
],
|
|
790
|
-
},
|
|
791
|
-
};
|
|
792
|
-
|
|
793
|
-
expect(populatedEntry).toEqual(expected);
|
|
794
|
-
});
|
|
795
|
-
|
|
796
|
-
it("should populate a 'cookbook' without recipes correctly", async () => {
|
|
797
|
-
const populatedEntry = await populateCreateUpdateEntryWithBaseEntry(
|
|
798
|
-
allModels,
|
|
799
|
-
cookbookEmptyRecipesModel.updateEntry,
|
|
800
|
-
cookbookEmptyRecipesModel.baseEntry,
|
|
801
|
-
cookbookEmptyRecipesModel.fullyPopulatedLocalizedEntry,
|
|
802
|
-
cookbookEmptyRecipesModel.uid,
|
|
803
|
-
cookbookEmptyRecipesModel.locale,
|
|
804
|
-
);
|
|
805
|
-
|
|
806
|
-
const expected = {
|
|
807
|
-
id: 34,
|
|
808
|
-
title: "Jedna cholernie pusta książka kucharska",
|
|
809
|
-
author_name: "Jamie Oliver",
|
|
810
|
-
pages: 0,
|
|
811
|
-
recipes: [
|
|
812
|
-
],
|
|
813
|
-
gallery: {
|
|
814
|
-
id: 34,
|
|
815
|
-
optional_title: "Jamie's cookbook",
|
|
816
|
-
annotation: "Zupełnie nowy, zawiera zero przepisów. Stwórz własne!",
|
|
817
|
-
main_image: {
|
|
818
|
-
id: 140,
|
|
819
|
-
image_title: "Knajpa",
|
|
820
|
-
image_description: "Pub",
|
|
821
|
-
image: {
|
|
822
|
-
id: 12,
|
|
823
|
-
name: "rishabh-modi-ubEMIKHv9Jk-unsplash.jpg",
|
|
824
|
-
alternativeText: "rishabh-modi-ubEMIKHv9Jk-unsplash.jpg",
|
|
825
|
-
caption: "rishabh-modi-ubEMIKHv9Jk-unsplash.jpg",
|
|
826
|
-
width: 2839,
|
|
827
|
-
height: 3785,
|
|
828
|
-
formats: {
|
|
829
|
-
thumbnail: {
|
|
830
|
-
name: "thumbnail_rishabh-modi-ubEMIKHv9Jk-unsplash.jpg",
|
|
831
|
-
hash: "thumbnail_rishabh_modi_ub_EMIK_Hv9_Jk_unsplash_68bba86c28",
|
|
832
|
-
ext: ".jpg",
|
|
833
|
-
mime: "image/jpeg",
|
|
834
|
-
path: null,
|
|
835
|
-
width: 117,
|
|
836
|
-
height: 156,
|
|
837
|
-
size: 5.26,
|
|
838
|
-
url: "/uploads/thumbnail_rishabh_modi_ub_EMIK_Hv9_Jk_unsplash_68bba86c28.jpg",
|
|
839
|
-
},
|
|
840
|
-
large: {
|
|
841
|
-
name: "large_rishabh-modi-ubEMIKHv9Jk-unsplash.jpg",
|
|
842
|
-
hash: "large_rishabh_modi_ub_EMIK_Hv9_Jk_unsplash_68bba86c28",
|
|
843
|
-
ext: ".jpg",
|
|
844
|
-
mime: "image/jpeg",
|
|
845
|
-
path: null,
|
|
846
|
-
width: 750,
|
|
847
|
-
height: 1000,
|
|
848
|
-
size: 114.8,
|
|
849
|
-
url: "/uploads/large_rishabh_modi_ub_EMIK_Hv9_Jk_unsplash_68bba86c28.jpg",
|
|
850
|
-
},
|
|
851
|
-
medium: {
|
|
852
|
-
name: "medium_rishabh-modi-ubEMIKHv9Jk-unsplash.jpg",
|
|
853
|
-
hash: "medium_rishabh_modi_ub_EMIK_Hv9_Jk_unsplash_68bba86c28",
|
|
854
|
-
ext: ".jpg",
|
|
855
|
-
mime: "image/jpeg",
|
|
856
|
-
path: null,
|
|
857
|
-
width: 562,
|
|
858
|
-
height: 750,
|
|
859
|
-
size: 69.07,
|
|
860
|
-
url: "/uploads/medium_rishabh_modi_ub_EMIK_Hv9_Jk_unsplash_68bba86c28.jpg",
|
|
861
|
-
},
|
|
862
|
-
small: {
|
|
863
|
-
name: "small_rishabh-modi-ubEMIKHv9Jk-unsplash.jpg",
|
|
864
|
-
hash: "small_rishabh_modi_ub_EMIK_Hv9_Jk_unsplash_68bba86c28",
|
|
865
|
-
ext: ".jpg",
|
|
866
|
-
mime: "image/jpeg",
|
|
867
|
-
path: null,
|
|
868
|
-
width: 375,
|
|
869
|
-
height: 500,
|
|
870
|
-
size: 35.47,
|
|
871
|
-
url: "/uploads/small_rishabh_modi_ub_EMIK_Hv9_Jk_unsplash_68bba86c28.jpg",
|
|
872
|
-
},
|
|
873
|
-
},
|
|
874
|
-
hash: "rishabh_modi_ub_EMIK_Hv9_Jk_unsplash_68bba86c28",
|
|
875
|
-
ext: ".jpg",
|
|
876
|
-
mime: "image/jpeg",
|
|
877
|
-
size: 1736.7,
|
|
878
|
-
url: "/uploads/rishabh_modi_ub_EMIK_Hv9_Jk_unsplash_68bba86c28.jpg",
|
|
879
|
-
previewUrl: null,
|
|
880
|
-
provider: "local",
|
|
881
|
-
provider_metadata: null,
|
|
882
|
-
},
|
|
883
|
-
},
|
|
884
|
-
gallery: [
|
|
885
|
-
],
|
|
886
|
-
},
|
|
887
|
-
};
|
|
888
|
-
|
|
889
|
-
expect(populatedEntry).toEqual(expected);
|
|
890
|
-
});
|
|
891
|
-
|
|
892
|
-
it("should populate a 'sample-json' including DZs correctly", async () => {
|
|
893
|
-
const populatedEntry = await populateCreateUpdateEntryWithBaseEntry(
|
|
894
|
-
allModels,
|
|
895
|
-
sampleJSONWithDZsModel.updateEntry,
|
|
896
|
-
sampleJSONWithDZsModel.baseEntry,
|
|
897
|
-
sampleJSONWithDZsModel.fullyPopulatedLocalizedEntry,
|
|
898
|
-
sampleJSONWithDZsModel.uid,
|
|
899
|
-
sampleJSONWithDZsModel.locale,
|
|
900
|
-
);
|
|
901
|
-
|
|
902
|
-
const expected = {
|
|
903
|
-
id: 24,
|
|
904
|
-
purpose: "Bar",
|
|
905
|
-
data: {
|
|
906
|
-
bar: "baz",
|
|
907
|
-
},
|
|
908
|
-
dynamic_property: [
|
|
909
|
-
{
|
|
910
|
-
id: 170,
|
|
911
|
-
image_title: "Nějaký název obrázku",
|
|
912
|
-
image_description: "Nějaký popis obrázku",
|
|
913
|
-
image: {
|
|
914
|
-
id: 11,
|
|
915
|
-
name: "heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
916
|
-
alternativeText: "heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
917
|
-
caption: "heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
918
|
-
width: 6127,
|
|
919
|
-
height: 3844,
|
|
920
|
-
formats: {
|
|
921
|
-
thumbnail: {
|
|
922
|
-
name: "thumbnail_heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
923
|
-
hash: "thumbnail_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f",
|
|
924
|
-
ext: ".jpg",
|
|
925
|
-
mime: "image/jpeg",
|
|
926
|
-
path: null,
|
|
927
|
-
width: 245,
|
|
928
|
-
height: 154,
|
|
929
|
-
size: 9.54,
|
|
930
|
-
url: "/uploads/thumbnail_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f.jpg",
|
|
931
|
-
},
|
|
932
|
-
large: {
|
|
933
|
-
name: "large_heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
934
|
-
hash: "large_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f",
|
|
935
|
-
ext: ".jpg",
|
|
936
|
-
mime: "image/jpeg",
|
|
937
|
-
path: null,
|
|
938
|
-
width: 1000,
|
|
939
|
-
height: 628,
|
|
940
|
-
size: 117.56,
|
|
941
|
-
url: "/uploads/large_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f.jpg",
|
|
942
|
-
},
|
|
943
|
-
medium: {
|
|
944
|
-
name: "medium_heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
945
|
-
hash: "medium_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f",
|
|
946
|
-
ext: ".jpg",
|
|
947
|
-
mime: "image/jpeg",
|
|
948
|
-
path: null,
|
|
949
|
-
width: 750,
|
|
950
|
-
height: 471,
|
|
951
|
-
size: 66.32,
|
|
952
|
-
url: "/uploads/medium_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f.jpg",
|
|
953
|
-
},
|
|
954
|
-
small: {
|
|
955
|
-
name: "small_heather-ford-G4LFhuLXhLE-unsplash.jpg",
|
|
956
|
-
hash: "small_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f",
|
|
957
|
-
ext: ".jpg",
|
|
958
|
-
mime: "image/jpeg",
|
|
959
|
-
path: null,
|
|
960
|
-
width: 500,
|
|
961
|
-
height: 314,
|
|
962
|
-
size: 31.42,
|
|
963
|
-
url: "/uploads/small_heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f.jpg",
|
|
964
|
-
},
|
|
965
|
-
},
|
|
966
|
-
hash: "heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f",
|
|
967
|
-
ext: ".jpg",
|
|
968
|
-
mime: "image/jpeg",
|
|
969
|
-
size: 6971.47,
|
|
970
|
-
url: "/uploads/heather_ford_G4_L_Fhu_L_Xh_LE_unsplash_7a2c2cac8f.jpg",
|
|
971
|
-
previewUrl: null,
|
|
972
|
-
provider: "local",
|
|
973
|
-
provider_metadata: null,
|
|
974
|
-
},
|
|
975
|
-
__component: "food.gallery-item",
|
|
976
|
-
},
|
|
977
|
-
{
|
|
978
|
-
id: 191,
|
|
979
|
-
name: "Přísada I",
|
|
980
|
-
amount: null,
|
|
981
|
-
unit: null,
|
|
982
|
-
is_required: true,
|
|
983
|
-
__component: "food.recipe-ingredient",
|
|
984
|
-
},
|
|
985
|
-
{
|
|
986
|
-
id: 36,
|
|
987
|
-
name: "První položka CB",
|
|
988
|
-
recipe: null,
|
|
989
|
-
estimated_cook_time: "00:03:00.000",
|
|
990
|
-
difficulty: "beginner",
|
|
991
|
-
author_name: "Já",
|
|
992
|
-
gallery: [
|
|
993
|
-
{
|
|
994
|
-
id: 171,
|
|
995
|
-
image_title: "Obrázek G Jedna",
|
|
996
|
-
image_description: "Obrázek G Popis Jedna",
|
|
997
|
-
},
|
|
998
|
-
{
|
|
999
|
-
id: 172,
|
|
1000
|
-
image_title: "Img G Two",
|
|
1001
|
-
image_description: "Img G Desc Two",
|
|
1002
|
-
},
|
|
1003
|
-
],
|
|
1004
|
-
ingredients: [
|
|
1005
|
-
{
|
|
1006
|
-
id: 193,
|
|
1007
|
-
name: "První Ingr DZ",
|
|
1008
|
-
amount: null,
|
|
1009
|
-
unit: null,
|
|
1010
|
-
is_required: true,
|
|
1011
|
-
},
|
|
1012
|
-
],
|
|
1013
|
-
__component: "food.cookbook-item",
|
|
1014
|
-
},
|
|
1015
|
-
{
|
|
1016
|
-
id: 192,
|
|
1017
|
-
name: "Druhá přísada",
|
|
1018
|
-
amount: null,
|
|
1019
|
-
unit: null,
|
|
1020
|
-
is_required: true,
|
|
1021
|
-
__component: "food.recipe-ingredient",
|
|
1022
|
-
},
|
|
1023
|
-
],
|
|
1024
|
-
repeatable_component_property: [
|
|
1025
|
-
{
|
|
1026
|
-
id: 61,
|
|
1027
|
-
name: "Položka 1",
|
|
1028
|
-
price: 1,
|
|
1029
|
-
currency: "CZK",
|
|
1030
|
-
description: "Nějaký popis",
|
|
1031
|
-
is_available: null,
|
|
1032
|
-
food_gallery: null,
|
|
1033
|
-
},
|
|
1034
|
-
{
|
|
1035
|
-
id: 62,
|
|
1036
|
-
name: "Položka 2",
|
|
1037
|
-
price: 2,
|
|
1038
|
-
currency: "CZK",
|
|
1039
|
-
description: "Nějaký další popis",
|
|
1040
|
-
is_available: null,
|
|
1041
|
-
food_gallery: [
|
|
1042
|
-
{
|
|
1043
|
-
id: 6,
|
|
1044
|
-
name: "rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
1045
|
-
alternativeText: "rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
1046
|
-
caption: "rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
1047
|
-
width: 2268,
|
|
1048
|
-
height: 4032,
|
|
1049
|
-
formats: {
|
|
1050
|
-
thumbnail: {
|
|
1051
|
-
name: "thumbnail_rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
1052
|
-
hash: "thumbnail_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea",
|
|
1053
|
-
ext: ".jpg",
|
|
1054
|
-
mime: "image/jpeg",
|
|
1055
|
-
path: null,
|
|
1056
|
-
width: 88,
|
|
1057
|
-
height: 156,
|
|
1058
|
-
size: 5.35,
|
|
1059
|
-
url: "/uploads/thumbnail_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea.jpg",
|
|
1060
|
-
},
|
|
1061
|
-
large: {
|
|
1062
|
-
name: "large_rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
1063
|
-
hash: "large_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea",
|
|
1064
|
-
ext: ".jpg",
|
|
1065
|
-
mime: "image/jpeg",
|
|
1066
|
-
path: null,
|
|
1067
|
-
width: 563,
|
|
1068
|
-
height: 1000,
|
|
1069
|
-
size: 108.15,
|
|
1070
|
-
url: "/uploads/large_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea.jpg",
|
|
1071
|
-
},
|
|
1072
|
-
medium: {
|
|
1073
|
-
name: "medium_rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
1074
|
-
hash: "medium_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea",
|
|
1075
|
-
ext: ".jpg",
|
|
1076
|
-
mime: "image/jpeg",
|
|
1077
|
-
path: null,
|
|
1078
|
-
width: 422,
|
|
1079
|
-
height: 750,
|
|
1080
|
-
size: 65.52,
|
|
1081
|
-
url: "/uploads/medium_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea.jpg",
|
|
1082
|
-
},
|
|
1083
|
-
small: {
|
|
1084
|
-
name: "small_rodrigo-dos-reis-h3AkzboxK4Q-unsplash.jpg",
|
|
1085
|
-
hash: "small_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea",
|
|
1086
|
-
ext: ".jpg",
|
|
1087
|
-
mime: "image/jpeg",
|
|
1088
|
-
path: null,
|
|
1089
|
-
width: 281,
|
|
1090
|
-
height: 500,
|
|
1091
|
-
size: 34.23,
|
|
1092
|
-
url: "/uploads/small_rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea.jpg",
|
|
1093
|
-
},
|
|
1094
|
-
},
|
|
1095
|
-
hash: "rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea",
|
|
1096
|
-
ext: ".jpg",
|
|
1097
|
-
mime: "image/jpeg",
|
|
1098
|
-
size: 1081.59,
|
|
1099
|
-
url: "/uploads/rodrigo_dos_reis_h3_Akzbox_K4_Q_unsplash_d17e795cea.jpg",
|
|
1100
|
-
previewUrl: null,
|
|
1101
|
-
provider: "local",
|
|
1102
|
-
provider_metadata: null,
|
|
1103
|
-
},
|
|
1104
|
-
],
|
|
1105
|
-
},
|
|
1106
|
-
],
|
|
1107
|
-
};
|
|
1108
|
-
|
|
1109
|
-
expect(populatedEntry).toEqual(expected);
|
|
1110
|
-
});
|
|
1111
|
-
|
|
1112
|
-
it("should populate a 'lesson' including DZs correctly", async () => {
|
|
1113
|
-
const populatedEntry = await populateCreateUpdateEntryWithBaseEntry(
|
|
1114
|
-
allModels,
|
|
1115
|
-
lessonWithDZsModel.updateEntry,
|
|
1116
|
-
lessonWithDZsModel.baseEntry,
|
|
1117
|
-
lessonWithDZsModel.fullyPopulatedLocalizedEntry,
|
|
1118
|
-
lessonWithDZsModel.uid,
|
|
1119
|
-
lessonWithDZsModel.locale,
|
|
1120
|
-
);
|
|
1121
|
-
|
|
1122
|
-
const expected = {
|
|
1123
|
-
id: 4,
|
|
1124
|
-
title: "Test: Sčítání",
|
|
1125
|
-
start_time: "2022-10-01T13:00:00.000Z",
|
|
1126
|
-
duration: "02:00:00.000",
|
|
1127
|
-
description: "Otestujte si své dovednosti, které jsme se naučili v předchozí lekci.",
|
|
1128
|
-
lesson_type: [
|
|
1129
|
-
{
|
|
1130
|
-
id: 2,
|
|
1131
|
-
title: "Vyberte správnou odpověď",
|
|
1132
|
-
questions: [
|
|
1133
|
-
{
|
|
1134
|
-
id: 4,
|
|
1135
|
-
question: "1 + 1 = ",
|
|
1136
|
-
is_active: true,
|
|
1137
|
-
question_number: 1,
|
|
1138
|
-
},
|
|
1139
|
-
{
|
|
1140
|
-
id: 5,
|
|
1141
|
-
question: "5 + 15 = ",
|
|
1142
|
-
is_active: false,
|
|
1143
|
-
question_number: 2,
|
|
1144
|
-
},
|
|
1145
|
-
{
|
|
1146
|
-
id: 6,
|
|
1147
|
-
question: "Kolik pohárů je na fotce?",
|
|
1148
|
-
is_active: false,
|
|
1149
|
-
question_number: 3,
|
|
1150
|
-
},
|
|
1151
|
-
],
|
|
1152
|
-
answers: [
|
|
1153
|
-
{
|
|
1154
|
-
id: 4,
|
|
1155
|
-
question_number: 1,
|
|
1156
|
-
correct_answer: "2",
|
|
1157
|
-
},
|
|
1158
|
-
{
|
|
1159
|
-
id: 5,
|
|
1160
|
-
question_number: 2,
|
|
1161
|
-
correct_answer: "20",
|
|
1162
|
-
},
|
|
1163
|
-
{
|
|
1164
|
-
id: 6,
|
|
1165
|
-
question_number: 3,
|
|
1166
|
-
correct_answer: "15",
|
|
1167
|
-
},
|
|
1168
|
-
],
|
|
1169
|
-
__component: "lesson.quiz",
|
|
1170
|
-
},
|
|
1171
|
-
],
|
|
1172
|
-
};
|
|
1173
|
-
|
|
1174
|
-
expect(populatedEntry).toEqual(expected);
|
|
1175
|
-
});
|
|
1176
|
-
});
|