diff --git a/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/.eslintrc.js b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/.eslintrc.js index bc3a898..1d60a4e 100644 --- a/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/.eslintrc.js +++ b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/.eslintrc.js @@ -1,3 +1,3 @@ module.exports = { - extends: ["@jangaroo/eslint-config"], + extends: ["@coremedia/eslint-config-studio-client"], }; diff --git a/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/babel.config.js b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/babel.config.js new file mode 100644 index 0000000..c90f919 --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/babel.config.js @@ -0,0 +1,3 @@ +const { babelConfig } = require("@coremedia/studio-client.build-config"); + +module.exports = babelConfig; diff --git a/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/jangaroo.config.js b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/jangaroo.config.js deleted file mode 100644 index 60d7131..0000000 --- a/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/jangaroo.config.js +++ /dev/null @@ -1,9 +0,0 @@ -const { jangarooConfig } = require("@jangaroo/core"); - -module.exports = jangarooConfig({ - type: "code", - sencha: { - name: "com.coremedia.labs.publication.scheduled__scheduled-studio-client.main", - namespace: "com.coremedia.labs.translation.scheduled.main", - }, -}); diff --git a/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/package.json b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/package.json index 55a9bca..e5e78eb 100644 --- a/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/package.json +++ b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/package.json @@ -8,36 +8,45 @@ "@coremedia-labs/studio-client.ext.scheduled-publication-workflow-studio-client": "workspace:*" }, "devDependencies": { - "@jangaroo/build": "^3.3.1", - "@jangaroo/core": "^3.3.1", - "@coremedia/eslint-config-studio-client-ext": "^2506.0.0", - "@jangaroo/publish": "^3.1.0", + "@babel/core": "^7.24.7", + "@coremedia/eslint-config-studio-client": "2506.0.0", + "@coremedia/studio-client.build-config": "2506.0.0", + "@coremedia/studio-client.main.shared-modules": "2506.0.0", "eslint": "^8.57.0", - "rimraf": "^5.0.7" + "rimraf": "^5.0.7", + "typescript": "^5.8.2", + "webpack-cli": "^6.0.1", + "webpack": "^5.98.0" }, "scripts": { - "clean": "rimraf ./dist && rimraf ./build", - "build": "jangaroo build", - "watch": "jangaroo watch", - "publish": "jangaroo publish", - "lint": "eslint --fix \"src/**/*.ts\"" + "build": "tsc --project src && webpack build --mode=production", + "clean": "rimraf ./dist", + "lint": "eslint \"src/**/*.ts*\"", + "prepublishOnly": "prepare-package", + "watch": "webpack watch --mode=development" }, "exports": { - "./*": { - "types": "./src/*.ts", - "default": "./dist/src/*.js" + "./appEntry.js": { + "default": "./dist/appEntry.js" } }, "coremedia": { - "projectExtensionFor": "studio-client.main" + "projectExtensionFor": "studio-client.main", + "plugins": { + "main_scheduledPublicationWorkflowPlugin": "./dist/appEntry.js" + } }, "publishConfig": { "directory": "dist", "linkDirectory": false, "exports": { - "./*": { - "types": "./src/*.d.ts", - "default": "./src/*.js" + "./appEntry.js": { + "default": "./appEntry.js" + } + }, + "coremedia": { + "plugins": { + "main_scheduledPublicationWorkflowPlugin": "./appEntry.js" } } } diff --git a/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/src/index.ts b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/src/index.ts new file mode 100644 index 0000000..3ae7817 --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/src/index.ts @@ -0,0 +1 @@ +// empty, must be there for webpack... diff --git a/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/src/plugin.ts b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/src/plugin.ts new file mode 100644 index 0000000..202579a --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/src/plugin.ts @@ -0,0 +1,4 @@ +export const initPlugin = async () => { + const module = await import("@coremedia-labs/studio-client.ext.scheduled-publication-workflow-studio-client"); + await module.addScheduledPublicationWorkflowPlugin(); +}; diff --git a/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/src/tsconfig.json b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/src/tsconfig.json new file mode 100644 index 0000000..c392644 --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/src/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "@coremedia/studio-client.build-config/tsconfig-shared.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "../dist/src" + }, + "references": [ + { + "path": "../../../../shared/js/scheduled-publication-workflow/src" + }, + ] +} diff --git a/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/webpack.config.js b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/webpack.config.js new file mode 100644 index 0000000..e1a84e4 --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/apps/main/scheduled-publication-workflow/webpack.config.js @@ -0,0 +1,9 @@ +const { sharedModules } = require("@coremedia/studio-client.main.shared-modules"); +const { getPluginWebpackConfig } = require("@coremedia/studio-client.build-config"); + +module.exports = getPluginWebpackConfig({ + name: "main_scheduledPublicationWorkflowPlugin", + sharedModules: { + "@coremedia/studio-client.main.shared-modules": sharedModules, + }, +}); diff --git a/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/.eslintrc.js b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/.eslintrc.js index bc3a898..1d60a4e 100644 --- a/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/.eslintrc.js +++ b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/.eslintrc.js @@ -1,3 +1,3 @@ module.exports = { - extends: ["@jangaroo/eslint-config"], + extends: ["@coremedia/eslint-config-studio-client"], }; diff --git a/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/babel.config.js b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/babel.config.js new file mode 100644 index 0000000..c90f919 --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/babel.config.js @@ -0,0 +1,3 @@ +const { babelConfig } = require("@coremedia/studio-client.build-config"); + +module.exports = babelConfig; diff --git a/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/jangaroo.config.js b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/jangaroo.config.js deleted file mode 100644 index ac84122..0000000 --- a/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/jangaroo.config.js +++ /dev/null @@ -1,9 +0,0 @@ -const { jangarooConfig } = require("@jangaroo/core"); - -module.exports = jangarooConfig({ - type: "code", - sencha: { - name: "com.coremedia.labs.publication.scheduled__scheduled-studio-client.workflow", - namespace: "com.coremedia.labs.translation.scheduled.workflow", - }, -}); diff --git a/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/package.json b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/package.json index beb4784..169a1cd 100644 --- a/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/package.json +++ b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/package.json @@ -8,24 +8,46 @@ "@coremedia-labs/studio-client.ext.scheduled-publication-workflow-studio-client": "workspace:*" }, "devDependencies": { - "@jangaroo/build": "^3.3.1", - "@jangaroo/core": "^3.3.1", - "@coremedia/eslint-config-studio-client-ext": "^2506.0.0", - "@jangaroo/publish": "^3.1.0", + "@babel/core": "^7.24.7", + "@coremedia/eslint-config-studio-client": "2506.0.0", + "@coremedia/studio-client.build-config": "2506.0.0", + "@coremedia/studio-client.workflow.shared-modules": "2506.0.0", "eslint": "^8.57.0", - "rimraf": "^5.0.7" + "rimraf": "^5.0.7", + "typescript": "^5.8.2", + "webpack-cli": "^6.0.1", + "webpack": "^5.98.0" }, "scripts": { - "clean": "rimraf ./dist && rimraf ./build", - "build": "jangaroo build", - "watch": "jangaroo watch", - "publish": "jangaroo publish dist", - "lint": "eslint --fix \"src/**/*.ts\"" + "build": "tsc --project src && webpack build --mode=production", + "clean": "rimraf ./dist", + "lint": "eslint \"src/**/*.ts*\"", + "prepublishOnly": "prepare-package", + "watch": "webpack watch --mode=development" + }, + "exports": { + "./appEntry.js": { + "default": "./dist/appEntry.js" + } }, "coremedia": { - "projectExtensionFor": "studio-client.workflow" + "projectExtensionFor": "studio-client.workflow", + "plugins": { + "workflow_react_scheduledPublicationWorkflowPlugin": "./dist/appEntry.js" + } }, - "exports": { - "./*": "./dist/src/*.js" + "publishConfig": { + "directory": "dist", + "linkDirectory": false, + "exports": { + "./appEntry.js": { + "default": "./appEntry.js" + } + }, + "coremedia": { + "plugins": { + "workflow_react_scheduledPublicationWorkflowPlugin": "./appEntry.js" + } + } } } diff --git a/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/src/index.ts b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/src/index.ts new file mode 100644 index 0000000..3ae7817 --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/src/index.ts @@ -0,0 +1 @@ +// empty, must be there for webpack... diff --git a/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/src/plugin.ts b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/src/plugin.ts new file mode 100644 index 0000000..202579a --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/src/plugin.ts @@ -0,0 +1,4 @@ +export const initPlugin = async () => { + const module = await import("@coremedia-labs/studio-client.ext.scheduled-publication-workflow-studio-client"); + await module.addScheduledPublicationWorkflowPlugin(); +}; diff --git a/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/src/tsconfig.json b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/src/tsconfig.json new file mode 100644 index 0000000..c392644 --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/src/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "@coremedia/studio-client.build-config/tsconfig-shared.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "../dist/src" + }, + "references": [ + { + "path": "../../../../shared/js/scheduled-publication-workflow/src" + }, + ] +} diff --git a/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/webpack.config.js b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/webpack.config.js new file mode 100644 index 0000000..2fe06bf --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/apps/workflow/scheduled-publication-workflow/webpack.config.js @@ -0,0 +1,9 @@ +const { sharedModules } = require("@coremedia/studio-client.workflow.shared-modules"); +const { getPluginWebpackConfig } = require("@coremedia/studio-client.build-config"); + +module.exports = getPluginWebpackConfig({ + name: "workflow_react_scheduledPublicationWorkflowPlugin", + sharedModules: { + "@coremedia/studio-client.workflow.shared-modules": sharedModules, + }, +}); diff --git a/scheduled-publication-workflow/apps/studio-client/pnpm-workspace.yaml b/scheduled-publication-workflow/apps/studio-client/pnpm-workspace.yaml index 32b731b..87ea5c4 100644 --- a/scheduled-publication-workflow/apps/studio-client/pnpm-workspace.yaml +++ b/scheduled-publication-workflow/apps/studio-client/pnpm-workspace.yaml @@ -1,4 +1,4 @@ packages: - "apps/main/scheduled-publication-workflow" - "apps/workflow/scheduled-publication-workflow" - - "shared/ext/scheduled-publication-workflow" + - "shared/js/scheduled-publication-workflow" diff --git a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/.eslintrc.js b/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/.eslintrc.js deleted file mode 100644 index bc3a898..0000000 --- a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/.eslintrc.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - extends: ["@jangaroo/eslint-config"], -}; diff --git a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/jangaroo.config.js b/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/jangaroo.config.js deleted file mode 100644 index d917250..0000000 --- a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/jangaroo.config.js +++ /dev/null @@ -1,12 +0,0 @@ -const { jangarooConfig } = require("@jangaroo/core"); - -module.exports = jangarooConfig({ - type: "code", - sencha: { - name: "com.coremedia.labs.publication.scheduled__scheduled-studio-client", - namespace: "com.coremedia.labs.publication.scheduled", - }, - autoLoad: [ - "./src/ScheduledPublicationWorkflowPlugin", - ], -}); diff --git a/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/.eslintrc.js b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/.eslintrc.js new file mode 100644 index 0000000..1d60a4e --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ["@coremedia/eslint-config-studio-client"], +}; diff --git a/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/jangaroo.config.js b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/jangaroo.config.js new file mode 100644 index 0000000..e745220 --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/jangaroo.config.js @@ -0,0 +1,5 @@ +const { jangarooConfig } = require("@jangaroo/core"); + +module.exports = jangarooConfig({ + type: "code", +}); diff --git a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/package.json b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/package.json similarity index 82% rename from scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/package.json rename to scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/package.json index 4690c68..363d6ab 100644 --- a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/package.json +++ b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/package.json @@ -14,14 +14,13 @@ "@coremedia/studio-client.i18n-models": "^2506.0.0", "@coremedia/studio-client.workflow-models": "^2506.0.0", "@coremedia/studio-client.workflow-plugin-models": "^2506.0.0", - "@jangaroo/ext-ts": "^2.1.0", "@jangaroo/runtime": "^3.3.1" }, "devDependencies": { + "@coremedia/eslint-config-studio-client": "2506.0.0", "@jangaroo/build": "^3.3.1", "@jangaroo/core": "^3.3.1", - "@coremedia/eslint-config-studio-client-ext": "^2506.0.0", - "@jangaroo/publish": "^3.1.0", + "@jangaroo/publish": "^3.3.1", "eslint": "^8.57.0", "rimraf": "^5.0.7" }, @@ -33,15 +32,23 @@ "lint": "eslint --fix \"src/**/*.ts\"" }, "exports": { + ".": { + "types": "./src/index.ts", + "default": "./dist/src/index.js" + }, "./*": { "types": "./src/*.ts", - "default": "./build/src/*.js" + "default": "./dist/src/*.js" } }, "publishConfig": { "directory": "dist", "linkDirectory": false, "exports": { + ".": { + "types": "./src/index.d.ts", + "default": "./src/index.js" + }, "./*": { "types": "./src/*.d.ts", "default": "./src/*.js" diff --git a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_de_properties.ts b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_de_properties.ts similarity index 100% rename from scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_de_properties.ts rename to scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_de_properties.ts diff --git a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_ja_properties.ts b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_ja_properties.ts similarity index 100% rename from scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_ja_properties.ts rename to scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_ja_properties.ts diff --git a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_properties.ts b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_properties.ts similarity index 100% rename from scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_properties.ts rename to scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/ScheduledPublicationProcessDefinitions_properties.ts diff --git a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/ScheduledPublicationWorkflowPlugin.ts b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/ScheduledPublicationWorkflowPlugin.ts similarity index 59% rename from scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/ScheduledPublicationWorkflowPlugin.ts rename to scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/ScheduledPublicationWorkflowPlugin.ts index 4c00245..ff70eff 100644 --- a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/ScheduledPublicationWorkflowPlugin.ts +++ b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/ScheduledPublicationWorkflowPlugin.ts @@ -1,22 +1,34 @@ +import { session } from "@coremedia/studio-client.cap-rest-client"; +import { Calendar } from "@coremedia/studio-client.client-core"; import ContentRepositoryImpl from "@coremedia/studio-client.cap-rest-client-impl/content/impl/ContentRepositoryImpl"; -import session from "@coremedia/studio-client.cap-rest-client/common/session"; -import Calendar from "@coremedia/studio-client.client-core/data/Calendar"; -import { PublicationWorkflowConstants } from "@coremedia/studio-client.workflow-models/PublicationWorkflowConstants"; +import { getLocalizer } from "@coremedia/studio-client.i18n-models"; +import { PublicationWorkflowConstants } from "@coremedia/studio-client.workflow-models"; import { Binding, - DateTimeField, PublicationWorkflowPlugin, RunningWorkflowFormExtension, StartWorkflowFormExtension, + DateTimeField, + PublicationWorkflowPlugin, + RunningWorkflowFormExtension, + StartWorkflowFormExtension, TextField, - WorkflowState -} from "@coremedia/studio-client.workflow-plugin-models/CustomWorkflowApi"; -import { workflowLocalizationRegistry } from "@coremedia/studio-client.workflow-plugin-models/WorkflowLocalizationRegistry"; -import { workflowPlugins } from "@coremedia/studio-client.workflow-plugin-models/WorkflowPluginRegistry"; -import DateUtil from "@jangaroo/ext-ts/Date"; -import { is } from "@jangaroo/runtime"; + WorkflowIssuesLocalization, + WorkflowLocalization, + workflowLocalizationRegistry, + workflowPlugins, + WorkflowState, +} from "@coremedia/studio-client.workflow-plugin-models"; +import { is, joo } from "@jangaroo/runtime"; import ScheduledPublicationProcessDefinitions_properties from "./ScheduledPublicationProcessDefinitions_properties"; -import { getLocalizer } from "@coremedia/studio-client.i18n-models"; const SCHEDULE_TASK_NAME: string = "Schedule"; +const dateTimeFormat: Intl.DateTimeFormatOptions = { + year: "numeric", + month: "2-digit", + day: "2-digit", + hour: "numeric", + minute: "2-digit", +}; + function getCalendarOfTomorrow(): Calendar { const dayDate: Date = new Date(); const dayDateInMilliseconds = dayDate.getTime(); @@ -46,7 +58,8 @@ function dateToString(value): string { } if (date) { - return DateUtil.format(date, "m/d/Y g:i A"); + const locale = joo.localeSupport.getLocale(); + return new Intl.DateTimeFormat(locale, dateTimeFormat).format(date); } } @@ -134,19 +147,37 @@ getWorkflowPlugin().then((workflowPlugin) => { workflowPlugins._.addPublicationWorkflowPlugin(workflowPlugin); }); -workflowLocalizationRegistry._.addLocalization("StudioScheduledPublication", { - displayName: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_displayName, - description: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_displayName, - tasks: { - Schedule: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_task_Schedule_displayName, - Publish: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_task_Publish_displayName, - Wait: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_task_Wait_displayName, - }, - states: { - Schedule: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_state_Schedule_displayName, - Publish: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_state_Publish_displayName, - Wait: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_state_Wait_displayName, - }, +const getScheduledPublicationProcessLocalization = async (): Promise => { + const localizer = await getLocalizer(ScheduledPublicationProcessDefinitions_properties); + + return { + displayName: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_displayName, + description: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_displayName, + tasks: { + Schedule: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_task_Schedule_displayName, + Publish: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_task_Publish_displayName, + Wait: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_task_Wait_displayName, + }, + states: { + Schedule: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_state_Schedule_displayName, + Publish: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_state_Publish_displayName, + Wait: ScheduledPublicationProcessDefinitions_properties.StudioScheduledPublication_state_Wait_displayName, + }, + }; +}; + +getScheduledPublicationProcessLocalization().then((scheduledPublicationProcessLocalization) => { + workflowLocalizationRegistry._.addLocalization("StudioScheduledPublication", scheduledPublicationProcessLocalization); }); -workflowLocalizationRegistry._.addIssuesLocalization({ dateLiesInPast_scheduledDate: ScheduledPublicationProcessDefinitions_properties.ErrorCode_dateLiesInPast_scheduledDate_text }); +const getScheduledPublicationIssuesLocalization = async (): Promise => { + const localizer = await getLocalizer(ScheduledPublicationProcessDefinitions_properties); + + return { + dateLiesInPast_scheduledDate: ScheduledPublicationProcessDefinitions_properties.ErrorCode_dateLiesInPast_scheduledDate_text, + }; +}; + +getScheduledPublicationIssuesLocalization().then((scheduledPublicationIssuesLocalization) => { + workflowLocalizationRegistry._.addIssuesLocalization(scheduledPublicationIssuesLocalization); +}); diff --git a/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/index.ts b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/index.ts new file mode 100644 index 0000000..80a8735 --- /dev/null +++ b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/index.ts @@ -0,0 +1,3 @@ +export const addScheduledPublicationWorkflowPlugin = async () => { + await import("./ScheduledPublicationWorkflowPlugin"); +}; diff --git a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/tsconfig.json b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/tsconfig.json similarity index 74% rename from scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/tsconfig.json rename to scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/tsconfig.json index 536d850..1f37c93 100644 --- a/scheduled-publication-workflow/apps/studio-client/shared/ext/scheduled-publication-workflow/src/tsconfig.json +++ b/scheduled-publication-workflow/apps/studio-client/shared/js/scheduled-publication-workflow/src/tsconfig.json @@ -4,9 +4,6 @@ "extends": "@jangaroo/build/tsconfig-jangaroo.json", "compilerOptions": { "rootDir": ".", - "outDir": "../dist/src", - "types": [ - "@jangaroo/ext-ts" - ] + "outDir": "../dist/src" } }