Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge tallence master #3

Open
wants to merge 67 commits into
base: merge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
3082794
Workaround for the dot-problem in option texts
May 24, 2022
9997d73
Taking in account the options technicalValue for field visibilities
May 24, 2022
8c19a1b
Merge pull request #90 from tallence/small-fixes
May 25, 2022
fea84c7
2207 upgrade
Aug 17, 2022
10a225f
2207 upgrade
Aug 17, 2022
45c6d76
Adding a new Field: The HiddenField
Aug 17, 2022
e52380b
2207 upgrade fixes dependency configuration
Aug 17, 2022
c060d6b
updated the copyright
Aug 17, 2022
f1ee6e3
Merge pull request #93 from tallence/2207-upgrade
Aug 17, 2022
c4de9e0
Merge pull request #94 from tallence/hiddenField
Aug 17, 2022
aa1542c
fixes hiddenField components: using the correct svg icon and fixes gr…
Aug 22, 2022
1cb327c
Merge pull request #95 from tallence/hidden-field
Aug 22, 2022
4b2166e
Adding the PageElement which is used to structure other formElments
Aug 25, 2022
bd869cd
Adding the PageElement (cae part)
Aug 26, 2022
acfac64
added IBAN Field to Form Fields
jsiewert Aug 26, 2022
2466a63
added basic functionality for multiple form pages (studio)
JanHendrikPopp Aug 26, 2022
d7fad17
changed page type to PageElement
JanHendrikPopp Aug 26, 2022
f3531da
changed copyright year
jsiewert Aug 26, 2022
055a18f
minor fixes for page properties
JanHendrikPopp Aug 26, 2022
95cb376
minor fixes for page properties
JanHendrikPopp Aug 26, 2022
e08f782
PageElement studio validation
Aug 26, 2022
1b3b2b9
Merge remote-tracking branch 'origin/multi-page' into multi-page
JanHendrikPopp Aug 26, 2022
edd7496
fixed validation and changed frontend iban validation library
jsiewert Aug 26, 2022
34ab99a
using the "name" insted of "title" for PageElements
Aug 26, 2022
cd7a542
added comment in IbanFieldValidator
jsiewert Aug 29, 2022
b74a134
Merge pull request #96 from tallence/iban-field
Aug 29, 2022
e9c881d
Adding a studio complexValidator to handle more complex cases (taking…
Oct 10, 2022
c835989
Fixes the studio-lib pom
Oct 11, 2022
7f77efb
Merge pull request #97 from tallence/complex-studio-validator
Oct 11, 2022
4e4f8d3
initialize new field with default value; additional check in parser f…
svkroschwald Oct 13, 2022
217e222
Merge pull request #98 from tallence/copy_type_preselection
Oct 13, 2022
82cdf50
focus new form tabs
Oct 14, 2022
592ebe7
Page Buttons implemented: moveUp, moveDown, insertBefore, insertAfter
Oct 14, 2022
5787e98
pageabla forms: added feature setting
JanHendrikPopp Oct 14, 2022
2ee83bc
pageabla forms: added feature setting (studio) + change buttons
JanHendrikPopp Oct 14, 2022
9dd8185
fixed import
JanHendrikPopp Oct 14, 2022
eb818a4
fixed property binding
JanHendrikPopp Oct 14, 2022
2c73b01
fixed property binding
JanHendrikPopp Oct 14, 2022
aeea2b1
WIP PageElements
Oct 14, 2022
0652d73
Compare the magic numbers content-type to the file-extension content-…
Nov 2, 2022
784906d
Fixes the missing defaultValue field in the ComboBoxFieldBase.ts
Nov 22, 2022
2eb616d
Merge pull request #99 from tallence/magic-numbers-check
Nov 22, 2022
d503b4f
cmcc-11-2210 upgrade
Nov 22, 2022
6479349
pageabla forms: fixed switching mode between pageable and non pageabl…
JanHendrikPopp Dec 14, 2022
1326459
cmcc-11-2210 upgrade
Nov 22, 2022
fece812
keep old elements on a multi-page-mode switch
Dec 15, 2022
57f689a
adding the license header
Jan 5, 2023
5aa2be9
Small fixes
Jan 5, 2023
f39dbd8
Merge branch 'multi-page'
Jan 18, 2023
26f24ff
multi-page post-merge fixes
Jan 18, 2023
b8b2b9a
Removed request context lookup during studio validation
phempten Feb 1, 2023
1871475
a more elegant way of passing the currentForm into the formFields wit…
Feb 3, 2023
7b5a076
always use the generated field id for studio validation, required to …
svkroschwald Feb 16, 2023
5502aba
Merge pull request #104 from tallence/internalFieldId_for_studioValid…
Feb 17, 2023
1e4b159
Merge pull request #102 from CoreMedia/validation-fix
Feb 21, 2023
6af7012
Merge pull request #103 from tallence/current-form-refactoring
Feb 21, 2023
3b601e6
2301-upgrade
Feb 21, 2023
5b15f69
2301 upgrade
Feb 21, 2023
a1b0dea
Merge pull request #105 from tallence/2301-upgrade
Feb 21, 2023
8c1faa2
Bump commons-fileupload from 1.4 to 1.5 in /form-editor-cae
dependabot[bot] Feb 22, 2023
0bd0f96
Bump commons-fileupload from 1.4 to 1.5 in /form-editor-shared
dependabot[bot] Feb 22, 2023
3a72dac
Merge pull request #106 from tallence/dependabot/maven/form-editor-ca…
Feb 22, 2023
599f724
Merge pull request #107 from tallence/dependabot/maven/form-editor-sh…
Feb 22, 2023
0349793
Fixes #108 : using the correct cm package versions
Mar 9, 2023
c836d34
Merge pull request #109 from tallence/108-studio-client-versions-dont…
Mar 9, 2023
9850fdc
using the correct cm package versions for 2304.1
svkroschwald Jun 13, 2023
8ca8bb9
Merge pull request #111 from tallence/cmcc-2304-update
Jun 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ Form-Actions and -fields can be customized and added by your need.

# Getting started

The extension runs with CoreMedia 11 (v2201.2). And also runs with:
- v2110.1. See the release [cmcc-11-2110.1](https://github.com/tallence/core-forms/releases/tag/cmcc-11-2110.1).
- v2107.1. See the release [cmcc-10-2107.1](https://github.com/tallence/core-forms/releases/tag/cmcc-10-2107.1).
See the [releases](https://github.com/tallence/core-forms/releases) for tested compatibilities.
For earlier versions, have a look into these branches:
- v2010.2. See the branch [2010.2-compatible](https://github.com/tallence/core-forms/tree/2010.2-compatible).
- CoreMedia 9 (v19.04). See the branch: [1904.2-compatible](https://github.com/tallence/core-forms/tree/1904.2-compatible).
It is in general compatible with the versions 17.10 and 18.10, but some small changes could be required (import paths, names of artifacts)
- Other CoreMedia 9 versions: It is in general compatible with the versions 17.10 and 18.10, but some small changes could be required (import paths, names of artifacts)

This repo covers the studio- and the backend-cae part. If you are looking for an example implementation for the frontend part (a Vue.js-App wrapped in a CoreMedia-Frontend-Workspace-Theme) have a look here: [core-forms-frontend](https://github.com/tallence/core-forms-frontend)

Expand Down
32 changes: 16 additions & 16 deletions apps/studio-client/apps/main/form-editor-studio-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
"dependencies": {
"@coremedia-blueprint/studio-client.form-editor": "1.0.0-SNAPSHOT",
"@coremedia-blueprint/studio-client.main.blueprint-forms": "1.0.0-SNAPSHOT",
"@coremedia/studio-client.base-models": "2201.2.0",
"@coremedia/studio-client.cap-base-models": "2201.2.0",
"@coremedia/studio-client.cap-rest-client": "2201.2.0",
"@coremedia/studio-client.client-core": "2201.2.0",
"@coremedia/studio-client.core-icons": "2201.2.0",
"@coremedia/studio-client.ext.errors-validation-components": "2201.2.0",
"@coremedia/studio-client.ext.ui-components": "2201.2.0",
"@coremedia/studio-client.main.bpbase-studio-dynamic-query-list": "2201.2.0",
"@coremedia/studio-client.main.editor-components": "2201.2.0",
"@jangaroo/ext-ts": "^1.0.2",
"@jangaroo/runtime": "^1.1.1"
"@coremedia/studio-client.base-models": "2304.1.0",
"@coremedia/studio-client.cap-base-models": "2304.1.0",
"@coremedia/studio-client.cap-rest-client": "2304.1.0",
"@coremedia/studio-client.client-core": "2304.1.0",
"@coremedia/studio-client.core-icons": "2304.1.0",
"@coremedia/studio-client.ext.errors-validation-components": "2304.1.0",
"@coremedia/studio-client.ext.ui-components": "2304.1.0",
"@coremedia/studio-client.main.bpbase-studio-dynamic-query-list": "2304.1.0",
"@coremedia/studio-client.main.editor-components": "2304.1.0",
"@jangaroo/ext-ts": "^1.0.3",
"@jangaroo/runtime": "^1.4.2"
},
"devDependencies": {
"@jangaroo/build": "^1.1.1",
"@jangaroo/core": "^1.1.1",
"@jangaroo/eslint-config": "^1.1.1",
"@jangaroo/publish": "^1.1.1",
"eslint": "^7.27.0",
"@jangaroo/build": "^1.4.2",
"@jangaroo/core": "^1.4.2",
"@jangaroo/eslint-config": "^1.4.2",
"@jangaroo/publish": "^1.4.2",
"eslint": "^7.32.0",
"rimraf": "^3.0.2"
},
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
$_group_container: $_block + "--element-group-container";
$_applicable_element_container: $_block + "--applicable-element-container";

$form_page_block: "form-page-container";

$form_element_block: "form-element-drop-container";
$form_element_drag_active: $form_element_block + "--drag-active";
$form_element_drop_active: $form_element_block + "--drop-active";
Expand All @@ -28,6 +30,14 @@
color: rgba(0, 0, 0, 0.27);
}

.#{$form_page_block} {
margin: 10px 15px 0 10px;
background: transparent;
border: 2px solid rgba(0, 0, 0, 0.04);
padding: 6px;
color: rgba(0, 0, 0, 0.27);
}

.#{$form_element_drag_active} {
border: 2px dashed rgba(0, 0, 0, 0.61);
color: rgba(0, 0, 0, 0.61);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2018 Tallence AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import ValueExpression from "@coremedia/studio-client.client-core/data/ValueExpression";
import Container from "@jangaroo/ext-ts/container/Container";
import Config from "@jangaroo/runtime/Config";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2018 Tallence AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import OpenReferenceWindowAction from "@coremedia/studio-client.main.editor-components/sdk/actions/OpenReferenceWindowAction";
import CollapsiblePanel from "@coremedia/studio-client.main.editor-components/sdk/premular/CollapsiblePanel";
import Button from "@jangaroo/ext-ts/button/Button";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2018 Tallence AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import ValueExpression from "@coremedia/studio-client.client-core/data/ValueExpression";
import BindComponentsPlugin from "@coremedia/studio-client.ext.ui-components/plugins/BindComponentsPlugin";
import Container from "@jangaroo/ext-ts/container/Container";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2018 Tallence AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import ValueExpressionFactory from "@coremedia/studio-client.client-core/data/ValueExpressionFactory";
import IconButton from "@coremedia/studio-client.ext.ui-components/components/IconButton";
import BindPropertyPlugin from "@coremedia/studio-client.ext.ui-components/plugins/BindPropertyPlugin";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class AppliedFormElementsContainerBase extends Container {
const panel = as(this.queryById(AppliedFormElementsContainerBase.FORM_ELEMENT_PANEL), CollapsiblePanel);

const formElementEditor = as(reusableComponentsService.requestComponentForReuse(this.formElement.getType()), FormElement);
if (this.formElement != formElementEditor.getFormElementStructWrapper()) {
if (formElementEditor && this.formElement != formElementEditor.getFormElementStructWrapper()) {
formElementEditor.updateFormElementStructWrapper(this.formElement);
const component = as(formElementEditor, Component);
if (component.isInstance) {
Expand All @@ -129,15 +129,10 @@ class AppliedFormElementsContainerBase extends Container {
this.#panel = panel;
}

override destroy(...params): void {
this.#removeReusableFormElement();
super.destroy(params);
}

#collapsedElementChangeListener(ve: ValueExpression): void {
if (ve.getValue() == this.formElement.getId()) {
const formElementEditor = as(reusableComponentsService.requestComponentForReuse(this.formElement.getType()), FormElement);
if (this.formElement != formElementEditor.getFormElementStructWrapper()) {
if (formElementEditor && this.formElement != formElementEditor.getFormElementStructWrapper()) {
formElementEditor.updateFormElementStructWrapper(this.formElement);
const component = as(formElementEditor, Component);
if (component.isInstance) {
Expand Down Expand Up @@ -167,7 +162,7 @@ class AppliedFormElementsContainerBase extends Container {

iconClassTransformer(elementType: string): string {
const formElementEditor = as(reusableComponentsService.requestComponentForReuse(elementType), FormElement);
return formElementEditor.getFormElementIconCls() || "";
return formElementEditor ? formElementEditor.getFormElementIconCls() : "";
}

static getTitleUndefinedValue(formElement: FormElementStructWrapper): string {
Expand All @@ -181,11 +176,22 @@ class AppliedFormElementsContainerBase extends Container {

/**
* Before the applied form elements container is destroyed, the reusable form element must be removed from the
* container. This means that the component can still be reused and is not destroyed itself.
* container. This means that the component can still be reused and is not destroyed itself. It is checked whether a
* reusable component can be found for the given form element. This is not possible for a page as form element,
* because the container is not reusable as switching between pageable and a single page form is possible.
*/
#removeReusableFormElement(): void {
this.formElementsManager.getCollapsedElementVE().removeChangeListener(bind(this, this.#collapsedElementChangeListener));
reusableComponentsService.removeReusableComponentCleanly(reusableComponentsService.requestComponentForReuse(this.formElement.getType()));
let requestComponentForReuse = reusableComponentsService.requestComponentForReuse(this.formElement.getType());
if (requestComponentForReuse) {
reusableComponentsService.removeReusableComponentCleanly(requestComponentForReuse);
}
}


override destroy(...args): any {
this.#removeReusableFormElement();
return super.destroy(...args);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import ValueExpressionFactory from "@coremedia/studio-client.client-core/data/ValueExpressionFactory";
import Config from "@jangaroo/runtime/Config";
import ConfigUtils from "@jangaroo/runtime/ConfigUtils";
import StateFulCollapsiblePanel from "./components/StateFulCollapsiblePanel";
import ShowFormIssuesPlugin from "./plugins/ShowFormIssuesPlugin";
import AppliedFormPageContainerBase from "./AppliedFormPageContainerBase";
import PageElementEditor from "./elements/PageElementEditor";
import FormEditor_properties from "./bundles/FormEditor_properties";

interface AppliedFormPageContainerConfig extends Config<AppliedFormPageContainerBase> {
}

class AppliedFormPageContainer extends AppliedFormPageContainerBase {
declare Config: AppliedFormPageContainerConfig;

static override readonly xtype: string = "com.tallence.formeditor.studio.config.appliedFormPageContainer";

constructor(config: Config<AppliedFormPageContainer> = null) {
super((() => ConfigUtils.apply(Config(AppliedFormPageContainer, {

items: [
/* We need to overwrite the collapsedCls. Otherwise the header would have a transparent background. */
Config(StateFulCollapsiblePanel, {
margin: "10 15 0 10",
collapsible: false,
itemId: AppliedFormPageContainerBase.FORM_ELEMENT_PANEL,
collapsedCls: "collapsed-form-element",
animCollapse: false,
title: FormEditor_properties.FormEditor_pages_properties_title,
plugins: [
Config(ShowFormIssuesPlugin, {
issuesVE: config.bindTo.extendBy(["issues"]),
propertyPathVE: ValueExpressionFactory.createFromValue(config.formElement.getPropertyPath()),
}),
],
items: [
Config(PageElementEditor, {
itemId: AppliedFormPageContainerBase.FORM_PAGE_EDITOR,
bindTo: config.bindTo,
forceReadOnlyValueExpression: config.forceReadOnlyValueExpression,
formElement: config.formElement
})
],
})
],
}), config))());
}
}

export default AppliedFormPageContainer;
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* Copyright 2018 Tallence AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import ValueExpression from "@coremedia/studio-client.client-core/data/ValueExpression";
import PropertyEditorUtil from "@coremedia/studio-client.main.editor-components/sdk/util/PropertyEditorUtil";
import Container from "@jangaroo/ext-ts/container/Container";
import Config from "@jangaroo/runtime/Config";
import FormElementsManager from "./helper/FormElementsManager";
import FormElementStructWrapper from "./model/FormElementStructWrapper";
import PageElementEditor from "./elements/PageElementEditor";
import createComponentSelector from "@coremedia/studio-client.ext.ui-components/util/createComponentSelector";

interface AppliedFormPageContainerBaseConfig extends Config<Container>, Partial<Pick<AppliedFormPageContainerBase,
"bindTo" |
"forceReadOnlyValueExpression" |
"formElement" |
"formElementsManager">> {
}

class AppliedFormPageContainerBase extends Container {
declare Config: AppliedFormPageContainerBaseConfig;

protected static readonly FORM_ELEMENT_PANEL: string = "form-element-collapsible-panel";
protected static readonly FORM_ELEMENT_HEADER: string = "form-element-header";
protected static readonly FORM_PAGE_EDITOR: string = "pageEditor";

#bindTo: ValueExpression = null;
#forceReadOnlyValueExpression: ValueExpression = null;
#formElement: FormElementStructWrapper = null;
#formElementsManager: FormElementsManager = null;
#readOnlyVE: ValueExpression = null;

set bindTo(value: ValueExpression) {
this.#bindTo = value;
}

set forceReadOnlyValueExpression(value: ValueExpression) {
this.#forceReadOnlyValueExpression = value;
}

set formElement(value: FormElementStructWrapper) {
this.#formElement = value;
}

set formElementsManager(value: FormElementsManager) {
this.#formElementsManager = value;
}

constructor(config: Config<AppliedFormPageContainerBase> = null) {
super(config);
this.formElement = config.formElement;
this.formElementsManager = config.formElementsManager;
// Create a value expression to bind the disabled state of the drag source. It is necessary to use the two
// value expressions 'bindTo' and 'forceReadOnlyValueExpression' to create the read only value expression. If a
// content is checked out by another user, the read only value is not stored in the forceReadOnlyValueExpression.
this.#readOnlyVE = PropertyEditorUtil.createReadOnlyValueExpression(config.bindTo, config.forceReadOnlyValueExpression);
}

protected override afterRender(): void {
super.afterRender();
const formElementEditor = this.query(createComponentSelector().itemId(AppliedFormPageContainerBase.FORM_PAGE_EDITOR).build())[0] as PageElementEditor;
if (this.formElement != formElementEditor.getFormElementStructWrapper()) {
formElementEditor.updateFormElementStructWrapper(this.formElement);
}
}

}

export default AppliedFormPageContainerBase;
Loading