+
Conditions
+
+
Conditions are javascript expressions that define when to trigger, for example:
+
+
+ -
+ Specific users:
+
+ event.mentionedUser.email === 'mail2stehle@gmail.com'
+
+ -
+ Only for text keywords:
+
+ event.text.indexOf('urgent') >= 0
+
+
+
+
\ No newline at end of file
diff --git a/frontend/app/features/rules/pages/rules/triggers/comment-trigger.component.scss b/frontend/app/features/rules/pages/rules/triggers/comment-trigger.component.scss
new file mode 100644
index 000000000..6e1eef5ec
--- /dev/null
+++ b/frontend/app/features/rules/pages/rules/triggers/comment-trigger.component.scss
@@ -0,0 +1,6 @@
+@import '_vars';
+@import '_mixins';
+
+textarea {
+ height: 100px;
+}
\ No newline at end of file
diff --git a/frontend/app/features/rules/pages/rules/triggers/comment-trigger.component.ts b/frontend/app/features/rules/pages/rules/triggers/comment-trigger.component.ts
new file mode 100644
index 000000000..75d1a8dc9
--- /dev/null
+++ b/frontend/app/features/rules/pages/rules/triggers/comment-trigger.component.ts
@@ -0,0 +1,30 @@
+/*
+ * Squidex Headless CMS
+ *
+ * @license
+ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
+ */
+
+import { Component, Input, OnInit } from '@angular/core';
+import { FormControl, FormGroup } from '@angular/forms';
+
+@Component({
+ selector: 'sqx-comment-trigger',
+ styleUrls: ['./comment-trigger.component.scss'],
+ templateUrl: './comment-trigger.component.html'
+})
+export class CommentTriggerComponent implements OnInit {
+ @Input()
+ public trigger: any;
+
+ @Input()
+ public triggerForm: FormGroup;
+
+ @Input()
+ public triggerFormSubmitted = false;
+
+ public ngOnInit() {
+ this.triggerForm.setControl('condition',
+ new FormControl(this.trigger.condition || ''));
+ }
+}
\ No newline at end of file
diff --git a/frontend/app/features/settings/pages/contributors/contributor-add-form.component.ts b/frontend/app/features/settings/pages/contributors/contributor-add-form.component.ts
index 77cb5eba7..b4c94911e 100644
--- a/frontend/app/features/settings/pages/contributors/contributor-add-form.component.ts
+++ b/frontend/app/features/settings/pages/contributors/contributor-add-form.component.ts
@@ -70,7 +70,7 @@ export class ContributorAddFormComponent implements OnChanges {
}
public ngOnChanges() {
- this.defaultValue = { role: this.roles[0].name, contributorId: '' };
+ this.defaultValue = { role: this.roles ? this.roles[0].name : null, user: '' };
this.assignContributorForm.submitCompleted({ newValue: this.defaultValue });
}
diff --git a/frontend/app/features/settings/pages/roles/role.component.ts b/frontend/app/features/settings/pages/roles/role.component.ts
index 68605dcff..e14eeb23f 100644
--- a/frontend/app/features/settings/pages/roles/role.component.ts
+++ b/frontend/app/features/settings/pages/roles/role.component.ts
@@ -18,10 +18,10 @@ import {
} from '@app/shared';
const Descriptions = {
- 'Developer': 'Can use the API view, edit assets, contents, schemas, rules, workflows and patterns.',
- 'Editor': 'Can edit assets and contents and view workflows.',
- 'Owner': 'Can do everything, including deleting the app.',
- 'Reader': 'Can only read assets and contents.'
+ Developer: 'Can use the API view, edit assets, contents, schemas, rules, workflows and patterns.',
+ Editor: 'Can edit assets and contents and view workflows.',
+ Owner: 'Can do everything, including deleting the app.',
+ Reader: 'Can only read assets and contents.'
};
@Component({
diff --git a/frontend/app/framework/angular/pipes/markdown.pipe.ts b/frontend/app/framework/angular/pipes/markdown.pipe.ts
index 39bc5aece..fe6e10804 100644
--- a/frontend/app/framework/angular/pipes/markdown.pipe.ts
+++ b/frontend/app/framework/angular/pipes/markdown.pipe.ts
@@ -11,7 +11,11 @@ import marked from 'marked';
const renderer = new marked.Renderer();
renderer.link = (href, _, text) => {
- return `