Skip to content

Commit

Permalink
Merge pull request #70 from CoreMedia/develop
Browse files Browse the repository at this point in the history
Update to CMCC 2406.0.1
  • Loading branch information
mmichaelis authored Aug 8, 2024
2 parents 1bd1b54 + 8e0d89e commit 50cb564
Show file tree
Hide file tree
Showing 20 changed files with 1,601 additions and 1,919 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/update-ci-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Update CI Develop

on:
workflow_dispatch: {}
### Next proposed step is to automate the update on push.
# push:
# branches:
# - develop

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_USER_NAME: "${{ github.actor }}"
GIT_USER_EMAIL: "${{ github.actor }}@users.noreply.github.com"
SCRIPTS_PATH: "${{ github.workspace }}/sh"
UPDATE_CI_DEVELOP_SCRIPT: "${{ env.SCRIPTS_PATH }}/update-ci-develop.sh"

jobs:
update-ci-develop:
runs-on: ubuntu-latest
timeout-minutes: 2
permissions:
contents: write # Required to push changes to the repository

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Update ci/develop branch
run: ${UPDATE_CI_DEVELOP_SCRIPT}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

### IntelliJ IDEA ###

/.idea/
.idea/
*.iml

### Visual Studio Code ###

/.vscode/
.vscode/

### Emacs ###
# -*- mode: gitignore; -*-
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Changelog
================================================================================

v2406.0.1-1
--------------------------------------------------------------------------------

* Updated dependencies to CoreMedia Content Cloud v12.2406.0.1.
* Switched to recommended imports of `index.ts` in Studio Client where
applicable.
* Fixed Due Date handling for invalid configured values of
`globalLink.dayOffsetForDueDate`.
* Refactored access to settings for Translation Service in studio-client to
an extra class.

v2404.1-1
--------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Change "message" for GCC (Used) version to the recently used version.
-->

![CoreMedia Content Cloud Version](https://img.shields.io/static/v1?message=2404&label=CoreMedia%20Content%20Cloud&style=for-the-badge&color=672779)
![CoreMedia Content Cloud Version](https://img.shields.io/static/v1?message=2406.0&label=CoreMedia%20Content%20Cloud&style=for-the-badge&color=672779)
![GCC Used](https://img.shields.io/static/v1?message=v3.1.3&label=GCC%20REST%20API%20%28Used%29&style=for-the-badge&color=green)
[![Maven Central: GCC Recent](https://img.shields.io/maven-central/v/com.translations.globallink/gcc-restclient.svg?label=GCC%20REST%20API%20%28Recent%29&style=for-the-badge)](https://central.sonatype.com/search?q=com.translations.globallink%3Agcc-restclient)

Expand Down
8 changes: 4 additions & 4 deletions apps/studio-client/apps/main/gcc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"@coremedia-labs/studio-client.ext.gcc-studio-client": "1.0.0-SNAPSHOT"
},
"devDependencies": {
"@jangaroo/build": "^3.0.0",
"@jangaroo/core": "^3.0.0",
"@jangaroo/publish": "^3.0.0",
"rimraf": "^5.0.5"
"@jangaroo/build": "^3.0.1",
"@jangaroo/core": "^3.0.1",
"@jangaroo/publish": "^3.0.1",
"rimraf": "^5.0.7"
},
"scripts": {
"clean": "rimraf ./dist && rimraf ./build",
Expand Down
8 changes: 4 additions & 4 deletions apps/studio-client/apps/workflow/gcc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"@coremedia-labs/studio-client.ext.gcc-studio-client": "1.0.0-SNAPSHOT"
},
"devDependencies": {
"@jangaroo/build": "^3.0.0",
"@jangaroo/core": "^3.0.0",
"@jangaroo/publish": "^3.0.0",
"rimraf": "^5.0.5"
"@jangaroo/build": "^3.0.1",
"@jangaroo/core": "^3.0.1",
"@jangaroo/publish": "^3.0.1",
"rimraf": "^5.0.7"
},
"scripts": {
"clean": "rimraf ./dist && rimraf ./build",
Expand Down
30 changes: 15 additions & 15 deletions apps/studio-client/shared/js/gcc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
"license": "CoreMedia Open Source License",
"private": true,
"dependencies": {
"@coremedia/studio-client.cap-base-models": "2404.1.0",
"@coremedia/studio-client.cap-rest-client": "2404.1.0",
"@coremedia/studio-client.cap-rest-client-impl": "2404.1.0",
"@coremedia/studio-client.client-core": "2404.1.0",
"@coremedia/studio-client.client-core-impl": "2404.1.0",
"@coremedia/studio-client.core-icons": "2404.1.0",
"@coremedia/studio-client.workflow-models": "2404.1.0",
"@coremedia/studio-client.workflow-plugin-models": "2404.1.0",
"@coremedia/studio-client.cap-base-models": "2406.0.1",
"@coremedia/studio-client.cap-rest-client": "2406.0.1",
"@coremedia/studio-client.cap-rest-client-impl": "2406.0.1",
"@coremedia/studio-client.client-core": "2406.0.1",
"@coremedia/studio-client.client-core-impl": "2406.0.1",
"@coremedia/studio-client.core-icons": "2406.0.1",
"@coremedia/studio-client.workflow-models": "2406.0.1",
"@coremedia/studio-client.workflow-plugin-models": "2406.0.1",
"@jangaroo/ext-ts": "^2.0.0",
"@jangaroo/runtime": "^3.0.0"
"@jangaroo/runtime": "^3.0.1"
},
"devDependencies": {
"@jangaroo/build": "^3.0.0",
"@jangaroo/core": "^3.0.0",
"@coremedia/eslint-config-studio-client-ext": "2404.1.0",
"@jangaroo/publish": "^3.0.0",
"eslint": "^8.56.0",
"rimraf": "^5.0.5"
"@jangaroo/build": "^3.0.1",
"@jangaroo/core": "^3.0.1",
"@coremedia/eslint-config-studio-client-ext": "2406.0.1",
"@jangaroo/publish": "^3.0.1",
"eslint": "^8.57.0",
"rimraf": "^5.0.7"
},
"scripts": {
"clean": "rimraf ./dist && rimraf ./build",
Expand Down
75 changes: 18 additions & 57 deletions apps/studio-client/shared/js/gcc/src/GccWorkflowPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,29 @@ import ILocalesService from "@coremedia/studio-client.cap-base-models/locale/ILo
import localesService from "@coremedia/studio-client.cap-base-models/locale/localesService";
import ContentRepositoryImpl from "@coremedia/studio-client.cap-rest-client-impl/content/impl/ContentRepositoryImpl";
import TaskDefinitionImpl from "@coremedia/studio-client.cap-rest-client-impl/workflow/impl/TaskDefinitionImpl";
import session from "@coremedia/studio-client.cap-rest-client/common/session";
import Content from "@coremedia/studio-client.cap-rest-client/content/Content";
import Struct from "@coremedia/studio-client.cap-rest-client/struct/Struct";
import StructRemoteBean from "@coremedia/studio-client.cap-rest-client/struct/StructRemoteBean";
import Process from "@coremedia/studio-client.cap-rest-client/workflow/Process";
import Task from "@coremedia/studio-client.cap-rest-client/workflow/Task";
import WorkflowObjectProperties from "@coremedia/studio-client.cap-rest-client/workflow/WorkflowObjectProperties";
import { session, Process, Task, WorkflowObjectProperties } from "@coremedia/studio-client.cap-rest-client";
import RemoteService from "@coremedia/studio-client.client-core-impl/data/impl/RemoteService";
import Blob from "@coremedia/studio-client.client-core/data/Blob";
import Calendar from "@coremedia/studio-client.client-core/data/Calendar";
import RemoteBeanUtil from "@coremedia/studio-client.client-core/data/RemoteBeanUtil";
import { Blob, Calendar, RemoteBeanUtil } from "@coremedia/studio-client.client-core";
import ProcessUtil from "@coremedia/studio-client.workflow-models/util/ProcessUtil";
import {
Binding,
Button,
DateTimeField,
TextField,
WorkflowState,
} from "@coremedia/studio-client.workflow-plugin-models/CustomWorkflowApi";
workflowPlugins,
} from "@coremedia/studio-client.workflow-plugin-models";
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 { as, is } from "@jangaroo/runtime";
import resourceManager from "@jangaroo/runtime/l10n/resourceManager";
import Logger from "@coremedia/studio-client.client-core-impl/logging/Logger";
import GccWorkflowLocalization_properties from "./GccWorkflowLocalization_properties";
import Gcc_properties from "./Gcc_properties";
import gccCanceledIcon from "./icons/global-link-workflow-canceled.svg";
import gccIcon from "./icons/global-link-workflow.svg";
import gccCancelActionIcon from "./icons/remove.svg";
import gccWarningIcon from "./icons/warning.svg";
import { translationServicesSettings } from "./TranslationServiceSettings";

const UNAVAILABLE_SUBMISSION_STATE: string = "unavailable";
const BLOB_FILE_PROCESS_VARIABLE_NAME: string = "translationResultXliff";
Expand All @@ -55,7 +47,6 @@ const HANDLE_SEND_TRANSLATION_REQUEST_ERROR_TASK_NAME: string = "HandleSendTrans
const HANDLE_DOWNLOAD_TRANSLATION_ERROR_TASK_NAME: string = "HandleDownloadTranslationError";
const HANDLE_CANCEL_TRANSLATION_ERROR_TASK_NAME: string = "HandleCancelTranslationError";
const MILLISECONDS_FOR_ONE_DAY: number = 86400000;
const CMSETTINGS_TYPE: string = "CMSettings";

interface GccViewModel {
globalLinkPdSubmissionIds?: string;
Expand Down Expand Up @@ -504,50 +495,20 @@ function createQuickTipText(locales: Array<any>, localesService: ILocalesService
return localeQuickTipText;
}

function getDefaultDueDate(): Calendar {
const translationServices: Content = session._.getConnection()
.getContentRepository()
.getChild("/Settings/Options/Settings/Translation Services");
const settings: Array<Content> = [];
if (!RemoteBeanUtil.isAccessible(translationServices)) {
function getDefaultDueDate(): Calendar | undefined {
const dayOffsetForDueDate = translationServicesSettings.getDayOffsetForDueDate();
if (dayOffsetForDueDate === undefined) {
return undefined;
} else if (translationServices.isFolder()) {
settings.push(...translationServices.getChildDocuments());
} else if (translationServices.getType().isSubtypeOf(CMSETTINGS_TYPE)) {
settings.push(translationServices);
} else {
return undefined;
}

for (const content of settings) {
if (RemoteBeanUtil.isAccessible(content) && content.getType().isSubtypeOf(CMSETTINGS_TYPE)) {
const calendar: Calendar = getDueDateFromSetting(content);
if (calendar) {
Logger.debug("Using due date from setting at " + content.getPath());
return calendar;
}
}
}

return undefined;
}

function getDueDateFromSetting(setting: Content): Calendar {
const gccConfig = setting.getProperties().get("settings") as StructRemoteBean;
if (RemoteBeanUtil.isAccessible(gccConfig) && gccConfig.get("globalLink")) {
const dayOffsetForDueDate: number = as(gccConfig.get("globalLink"), Struct).get("dayOffsetForDueDate");
if (dayOffsetForDueDate) {
const dateInFutureInMillieSeconds: number = new Date().getTime() + MILLISECONDS_FOR_ONE_DAY * dayOffsetForDueDate;
const dateInFuture = new Date(dateInFutureInMillieSeconds);
return new Calendar({
year: dateInFuture.getFullYear(),
month: dateInFuture.getMonth(),
day: dateInFuture.getDate(),
offset: -dateInFuture.getTimezoneOffset() * (60 * 1000),
timeZone: as(session._.getConnection().getContentRepository(), ContentRepositoryImpl).getDefaultTimeZone(),
normalized: true,
});
}
}
return undefined;
const dateInFutureInMillieSeconds = new Date().getTime() + MILLISECONDS_FOR_ONE_DAY * dayOffsetForDueDate;
const dateInFuture = new Date(dateInFutureInMillieSeconds);
return new Calendar({
year: dateInFuture.getFullYear(),
month: dateInFuture.getMonth(),
day: dateInFuture.getDate(),
offset: -dateInFuture.getTimezoneOffset() * (60 * 1000),
timeZone: as(session._.getConnection().getContentRepository(), ContentRepositoryImpl).getDefaultTimeZone(),
normalized: true,
});
}
Loading

0 comments on commit 50cb564

Please sign in to comment.