Browse Source

Metadata fixed and improvements in trigger UI.

pull/349/head
Sebastian Stehle 7 years ago
parent
commit
a1c7a4287f
  1. 2
      extensions/Squidex.Extensions/Actions/AzureQueue/AzureQueueAction.cs
  2. 4
      extensions/Squidex.Extensions/Actions/Discourse/DiscourseAction.cs
  3. 3
      extensions/Squidex.Extensions/Actions/Discourse/DiscourseActionHandler.cs
  4. 2
      extensions/Squidex.Extensions/Actions/ElasticSearch/ElasticSearchAction.cs
  5. 4
      extensions/Squidex.Extensions/Actions/ElasticSearch/ElasticSearchActionHandler.cs
  6. 27
      extensions/Squidex.Extensions/Actions/Email/EmailAction.cs
  7. 9
      extensions/Squidex.Extensions/Actions/Medium/MediumAction.cs
  8. 1
      extensions/Squidex.Extensions/Actions/Twitter/TweetAction.cs
  9. 2
      extensions/Squidex.Extensions/Actions/Webhook/WebhookAction.cs
  10. 4
      src/Squidex/app/features/rules/pages/rules/actions/generic-action.component.html
  11. 6
      src/Squidex/app/features/rules/pages/rules/actions/generic-action.component.scss
  12. 96
      src/Squidex/app/features/rules/pages/rules/rules-page.component.html
  13. 2
      src/Squidex/app/features/settings/pages/clients/clients-page.component.html
  14. 7
      src/Squidex/app/features/settings/pages/patterns/patterns-page.component.html
  15. 2
      src/Squidex/app/theme/_forms.scss

2
extensions/Squidex.Extensions/Actions/AzureQueue/AzureQueueAction.cs

@ -23,7 +23,7 @@ namespace Squidex.Extensions.Actions.AzureQueue
public sealed class AzureQueueAction : RuleAction
{
[Required]
[Display(Name = "Connection String", Description = "The connection string to the storage account.")]
[Display(Name = "Connection", Description = "The connection string to the storage account.")]
[DataType(DataType.Text)]
[Formattable]
public string ConnectionString { get; set; }

4
extensions/Squidex.Extensions/Actions/Discourse/DiscourseAction.cs

@ -23,7 +23,7 @@ namespace Squidex.Extensions.Actions.Discourse
{
[AbsoluteUrl]
[Required]
[Display(Name = "Url", Description = "The url to the discourse server.")]
[Display(Name = "Server Url", Description = "The url to the discourse server.")]
[DataType(DataType.Url)]
public Uri Url { get; set; }
@ -33,7 +33,7 @@ namespace Squidex.Extensions.Actions.Discourse
public string ApiKey { get; set; }
[Required]
[Display(Name = "Api Username", Description = "The api username to authenticate to your discourse server.")]
[Display(Name = "Api User", Description = "The api username to authenticate to your discourse server.")]
[DataType(DataType.Text)]
public string ApiUsername { get; set; }

3
extensions/Squidex.Extensions/Actions/Discourse/DiscourseActionHandler.cs

@ -34,7 +34,6 @@ namespace Squidex.Extensions.Actions.Discourse
var json = new Dictionary<string, object>
{
["raw"] = Format(action.Text, @event),
["title"] = Format(action.Title, @event)
};
@ -56,6 +55,8 @@ namespace Squidex.Extensions.Actions.Discourse
RequestBody = requestBody
};
json["raw"] = Format(action.Text, @event);
var description =
action.Topic.HasValue ?
DescriptionCreateTopic :

2
extensions/Squidex.Extensions/Actions/ElasticSearch/ElasticSearchAction.cs

@ -23,7 +23,7 @@ namespace Squidex.Extensions.Actions.ElasticSearch
{
[AbsoluteUrl]
[Required]
[Display(Name = "Host", Description = "The hostname of the elastic search instance or cluster.")]
[Display(Name = "Server Url", Description = "The url to the elastic search instance or cluster.")]
[DataType(DataType.Url)]
public Uri Host { get; set; }

4
extensions/Squidex.Extensions/Actions/ElasticSearch/ElasticSearchActionHandler.cs

@ -45,9 +45,9 @@ namespace Squidex.Extensions.Actions.ElasticSearch
var ruleJob = new ElasticSearchJob
{
Host = action.Host.ToString(),
ContentId = contentId,
IndexName = Format(action.IndexName, @event),
IndexType = Format(action.IndexType, @event)
IndexType = Format(action.IndexType, @event),
ContentId = contentId
};
if (contentEvent.Type == EnrichedContentEventType.Deleted ||

27
extensions/Squidex.Extensions/Actions/Email/EmailAction.cs

@ -20,50 +20,51 @@ namespace Squidex.Extensions.Actions.Email
public sealed class EmailAction : RuleAction
{
[Required]
[Display(Name = "ServerHost", Description = "The IP address or host to the SMTP server.")]
[Display(Name = "Server Host", Description = "The IP address or host to the SMTP server.")]
[DataType(DataType.Text)]
public string ServerHost { get; set; }
[Required]
[Display(Name = "ServerPort", Description = "The port to the SMTP server.")]
[Display(Name = "Server Port", Description = "The port to the SMTP server.")]
[DataType(DataType.Custom)]
public int ServerPort { get; set; }
[Required]
[Display(Name = "ServerUseSsl", Description = "Specify whether the SMPT client uses Secure Sockets Layer (SSL) to encrypt the connection.")]
[Display(Name = "Use SSL", Description = "Specify whether the SMPT client uses Secure Sockets Layer (SSL) to encrypt the connection.")]
[DataType(DataType.Custom)]
public bool ServerUseSsl { get; set; }
[Required]
[Display(Name = "ServerUsername", Description = "The username for the SMTP server.")]
[DataType(DataType.Text)]
public string ServerUsername { get; set; }
[Required]
[Display(Name = "ServerPassword", Description = "The password for the SMTP server.")]
[Display(Name = "Password", Description = "The password for the SMTP server.")]
[DataType(DataType.Password)]
public string ServerPassword { get; set; }
[Required]
[Display(Name = "MessageFrom", Description = "The email sending address.")]
[Display(Name = "Username", Description = "The username for the SMTP server.")]
[DataType(DataType.Text)]
[Formattable]
public string ServerUsername { get; set; }
[Required]
[Display(Name = "From Address", Description = "The email sending address.")]
[DataType(DataType.Text)]
[Formattable]
public string MessageFrom { get; set; }
[Required]
[Display(Name = "MessageTo", Description = "The email message will be sent to.")]
[Display(Name = "To Address", Description = "The email message will be sent to.")]
[DataType(DataType.Text)]
[Formattable]
public string MessageTo { get; set; }
[Required]
[Display(Name = "MessageSubject", Description = "The subject line for this email message.")]
[Display(Name = "Subject", Description = "The subject line for this email message.")]
[DataType(DataType.Text)]
[Formattable]
public string MessageSubject { get; set; }
[Required]
[Display(Name = "MessageBody", Description = "The message body.")]
[Display(Name = "Body", Description = "The message body.")]
[DataType(DataType.MultilineText)]
[Formattable]
public string MessageBody { get; set; }

9
extensions/Squidex.Extensions/Actions/Medium/MediumAction.cs

@ -41,14 +41,15 @@ namespace Squidex.Extensions.Actions.Medium
[Formattable]
public string CanonicalUrl { get; set; }
[Display(Name = "PublicationId", Description = "Optional publication id.")]
[DataType(DataType.Text)]
public string PublicationId { get; set; }
[Display(Name = "Tags", Description = "The optional comma separated list of tags.")]
[DataType(DataType.Text)]
[Formattable]
public string Tags { get; set; }
[Display(Name = "Publication Id", Description = "Optional publication id.")]
[DataType(DataType.Text)]
public string PublicationId { get; set; }
[Display(Name = "Is Html", Description = "Indicates whether the content is markdown or html.")]
[DataType(DataType.Custom)]
public bool IsHtml { get; set; }

1
extensions/Squidex.Extensions/Actions/Twitter/TweetAction.cs

@ -32,6 +32,7 @@ namespace Squidex.Extensions.Actions.Twitter
[Required]
[Display(Name = "Text", Description = "The text that is sent as tweet to twitter.")]
[DataType(DataType.MultilineText)]
[Formattable]
public string Text { get; set; }
}
}

2
extensions/Squidex.Extensions/Actions/Webhook/WebhookAction.cs

@ -9,7 +9,6 @@ using System;
using System.ComponentModel.DataAnnotations;
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules;
using Squidex.Infrastructure;
namespace Squidex.Extensions.Actions.Webhook
{
@ -21,7 +20,6 @@ namespace Squidex.Extensions.Actions.Webhook
ReadMore = "https://en.wikipedia.org/wiki/Webhook")]
public sealed class WebhookAction : RuleAction
{
[AbsoluteUrl]
[Required]
[Display(Name = "Url", Description = "The url to the webhook.")]
[DataType(DataType.Text)]

4
src/Squidex/app/features/rules/pages/rules/actions/generic-action.component.html

@ -1,6 +1,8 @@
<div [formGroup]="actionForm" class="form-horizontal">
<div class="form-group row" *ngFor="let property of definition.properties">
<label class="col-3 col-form-label" [for]="property.name">{{property.display}}</label>
<label class="col-3 col-form-label" [for]="property.name">
<span *ngIf="property.editor !== 'Checkbox'">{{property.display}}</span>
</label>
<div class="col-9">
<sqx-control-errors [for]="property.name" [submitted]="actionFormSubmitted"></sqx-control-errors>

6
src/Squidex/app/features/rules/pages/rules/actions/generic-action.component.scss

@ -2,5 +2,9 @@
@import '_mixins';
.form-check {
padding-top: .5rem;
margin-bottom: -.25rem;
}
textarea {
height: 15rem;
}

96
src/Squidex/app/features/rules/pages/rules/rules-page.component.html

@ -19,58 +19,56 @@
</ng-container>
<ng-container content>
<ng-container *ngIf="rulesState.rules | async; let rules">
<ng-container *ngIf="ruleActions && ruleTriggers">
<div class="table-items-row table-items-row-empty" *ngIf="rules.length === 0">
No Rule created yet.
<ng-container *ngIf="ruleActions && ruleTriggers && (rulesState.isLoaded | async) && (rulesState.rules | async); let rules">
<div class="table-items-row table-items-row-empty" *ngIf="rules.length === 0">
No rule created yet.
<button type="button" class="btn btn-success btn-sm ml-2" (click)="createNew()">
<i class="icon icon-plus"></i> Add Rule
</button>
</div>
<button type="button" class="btn btn-success btn-sm ml-2" (click)="createNew()">
<i class="icon icon-plus"></i> Add Rule
</button>
</div>
<table class="table table-items table-fixed" *ngIf="rules.length > 0">
<tbody *ngFor="let rule of rules; trackBy: trackByRule">
<tr>
<td class="cell-separator">
<h3>If</h3>
</td>
<td class="cell-auto">
<span (click)="editTrigger(rule)">
<sqx-rule-element [type]="rule.triggerType" [element]="ruleTriggers[rule.triggerType]"></sqx-rule-element>
</span>
</td>
<td class="cell-separator">
<h3>then</h3>
</td>
<td class="cell-auto">
<span (click)="editAction(rule)">
<sqx-rule-element [type]="rule.actionType" [element]="ruleActions[rule.actionType]"></sqx-rule-element>
</span>
</td>
<td class="cell-actions">
<sqx-toggle [ngModel]="rule.isEnabled" (ngModelChange)="toggle(rule)"></sqx-toggle>
</td>
<td class="cell-actions">
<button type="button" class="btn btn-text-danger"
(sqxConfirmClick)="delete(rule)"
confirmTitle="Delete rule"
confirmText="Do you really want to delete the rule?">
<i class="icon-bin2"></i>
</button>
</td>
</tr>
<tr class="spacer"></tr>
</tbody>
</table>
<table class="table table-items table-fixed">
<tbody *ngFor="let rule of rules; trackBy: trackByRule">
<tr>
<td class="cell-separator">
<h3>If</h3>
</td>
<td class="cell-auto">
<span (click)="editTrigger(rule)">
<sqx-rule-element [type]="rule.triggerType" [element]="ruleTriggers[rule.triggerType]"></sqx-rule-element>
</span>
</td>
<td class="cell-separator">
<h3>then</h3>
</td>
<td class="cell-auto">
<span (click)="editAction(rule)">
<sqx-rule-element [type]="rule.actionType" [element]="ruleActions[rule.actionType]"></sqx-rule-element>
</span>
</td>
<td class="cell-actions">
<sqx-toggle [ngModel]="rule.isEnabled" (ngModelChange)="toggle(rule)"></sqx-toggle>
</td>
<td class="cell-actions">
<button type="button" class="btn btn-text-danger"
(sqxConfirmClick)="delete(rule)"
confirmTitle="Delete rule"
confirmText="Do you really want to delete the rule?">
<i class="icon-bin2"></i>
</button>
</td>
</tr>
<tr class="spacer"></tr>
</tbody>
</table>
<ng-container *sqxModalView="addRuleDialog;onRoot:true;closeAuto:false">
<sqx-rule-wizard [schemas]="schemasState.schemas | async" [rule]="wizardRule" [mode]="wizardMode"
[ruleActions]="ruleActions"
[ruleTriggers]="ruleTriggers"
(completed)="addRuleDialog.hide()">
</sqx-rule-wizard>
</ng-container>
<ng-container *sqxModalView="addRuleDialog;onRoot:true;closeAuto:false">
<sqx-rule-wizard [schemas]="schemasState.schemas | async" [rule]="wizardRule" [mode]="wizardMode"
[ruleActions]="ruleActions"
[ruleTriggers]="ruleTriggers"
(completed)="addRuleDialog.hide()">
</sqx-rule-wizard>
</ng-container>
</ng-container>
</ng-container>

2
src/Squidex/app/features/settings/pages/clients/clients-page.component.html

@ -14,7 +14,7 @@
</ng-container>
<ng-container content>
<ng-container *ngIf="clientsState.clients | async; let clients">
<ng-container *ngIf="(clientsState.isLoaded | async) && (clientsState.clients | async); let clients">
<div class="table-items-row table-items-row-empty" *ngIf="clients.length === 0">
No client created yet.
</div>

7
src/Squidex/app/features/settings/pages/patterns/patterns-page.component.html

@ -14,12 +14,15 @@
</ng-container>
<ng-container content>
<ng-container *ngIf="patternsState.patterns | async; let patterns">
<ng-container *ngIf="(patternsState.isLoaded | async) && (patternsState.patterns | async); let patterns">
<div class="table-items-row table-items-row-empty" *ngIf="patterns.length === 0">
No pattern created yet.
</div>
<sqx-pattern *ngFor="let pattern of patterns; trackBy: trackByPattern" [pattern]="pattern"></sqx-pattern>
<sqx-pattern *ngFor="let pattern of patterns; trackBy: trackByPattern"
[pattern]="pattern">
</sqx-pattern>
<sqx-pattern></sqx-pattern>
</ng-container>
</ng-container>

2
src/Squidex/app/theme/_forms.scss

@ -6,6 +6,7 @@
//
.form-control {
&.ng-invalid {
&.ng-touched,
&.ng-dirty {
& {
border-color: $color-theme-error;
@ -199,6 +200,7 @@ input {
}
&.ng-invalid {
&.ng-touched,
&.ng-dirty {
& {
@include box-shadow-none;

Loading…
Cancel
Save