mirror of https://github.com/Squidex/squidex.git
21 changed files with 264 additions and 63 deletions
@ -0,0 +1,99 @@ |
|||
<div [formGroup]="actionForm" class="form-horizontal"> |
|||
<div class="form-group row"> |
|||
<label class="col col-3 col-form-label" for="url">Url</label> |
|||
|
|||
<div class="col col-9"> |
|||
<sqx-control-errors for="url" [submitted]="actionFormSubmitted"></sqx-control-errors> |
|||
|
|||
<input type="url" class="form-control" id="url" formControlName="url" /> |
|||
|
|||
<small class="form-text text-muted"> |
|||
The url where the events will be sent to. |
|||
</small> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group row"> |
|||
<label class="col col-3 col-form-label" for="apiKey">Api Key</label> |
|||
|
|||
<div class="col col-9"> |
|||
<sqx-control-errors for="apiKey" [submitted]="actionFormSubmitted"></sqx-control-errors> |
|||
|
|||
<input type="apiKey" class="form-control" id="apiKey" formControlName="apiKey" /> |
|||
|
|||
<small class="form-text text-muted"> |
|||
The api key to authenticate to your discourse server. |
|||
</small> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group row"> |
|||
<label class="col col-3 col-form-label" for="apiUsername">Api Username</label> |
|||
|
|||
<div class="col col-9"> |
|||
<sqx-control-errors for="apiUsername" [submitted]="actionFormSubmitted"></sqx-control-errors> |
|||
|
|||
<input type="apiUsername" class="form-control" id="apiUsername" formControlName="apiUsername" /> |
|||
|
|||
<small class="form-text text-muted"> |
|||
The api username to authenticate to your discourse server. |
|||
</small> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group row"> |
|||
<label class="col col-3 col-form-label" for="text">Text</label> |
|||
|
|||
<div class="col col-9"> |
|||
<sqx-control-errors for="text" [submitted]="actionFormSubmitted"></sqx-control-errors> |
|||
|
|||
<textarea class="form-control" id="text" formControlName="text"></textarea> |
|||
|
|||
<small class="form-text text-muted"> |
|||
The text for your topic or post. Read the <a routerLink="help">help</a> section for information about advanced formatting. |
|||
</small> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group row"> |
|||
<label class="col col-3 col-form-label" for="title">Title</label> |
|||
|
|||
<div class="col col-9"> |
|||
<sqx-control-errors for="title" [submitted]="actionFormSubmitted"></sqx-control-errors> |
|||
|
|||
<input type="title" class="form-control" id="title" formControlName="title" /> |
|||
|
|||
<small class="form-text text-muted"> |
|||
The optional title, when you want to create a topic. Read the <a routerLink="help">help</a> section for information about advanced formatting. |
|||
</small> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group row"> |
|||
<label class="col col-3 col-form-label" for="topic">Topic</label> |
|||
|
|||
<div class="col col-9"> |
|||
<sqx-control-errors for="topic" [submitted]="actionFormSubmitted"></sqx-control-errors> |
|||
|
|||
<input type="number" class="form-control" id="topic" formControlName="topic" /> |
|||
|
|||
<small class="form-text text-muted"> |
|||
The topic id when you want to create a post. |
|||
</small> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="form-group row"> |
|||
<label class="col col-3 col-form-label" for="category">Category</label> |
|||
|
|||
<div class="col col-9"> |
|||
<sqx-control-errors for="category" [submitted]="actionFormSubmitted"></sqx-control-errors> |
|||
|
|||
<input type="number" class="form-control" id="category" formControlName="category" /> |
|||
|
|||
<small class="form-text text-muted"> |
|||
The category id when you create a topic. |
|||
</small> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
@ -0,0 +1,6 @@ |
|||
@import '_vars'; |
|||
@import '_mixins'; |
|||
|
|||
textarea { |
|||
height: 150px; |
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
/* |
|||
* Squidex Headless CMS |
|||
* |
|||
* @license |
|||
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. |
|||
*/ |
|||
|
|||
import { Component, Input, OnInit } from '@angular/core'; |
|||
import { FormControl, FormGroup, Validators } from '@angular/forms'; |
|||
|
|||
@Component({ |
|||
selector: 'sqx-discourse-action', |
|||
styleUrls: ['./discourse-action.component.scss'], |
|||
templateUrl: './discourse-action.component.html' |
|||
}) |
|||
export class DiscourseActionComponent implements OnInit { |
|||
@Input() |
|||
public action: any; |
|||
|
|||
@Input() |
|||
public actionForm: FormGroup; |
|||
|
|||
@Input() |
|||
public actionFormSubmitted = false; |
|||
|
|||
public ngOnInit() { |
|||
this.actionForm.setControl('url', |
|||
new FormControl(this.action.url || '', [ |
|||
Validators.required |
|||
])); |
|||
|
|||
this.actionForm.setControl('apiKey', |
|||
new FormControl(this.action.apiKey || '', [ |
|||
Validators.required |
|||
])); |
|||
|
|||
this.actionForm.setControl('apiUsername', |
|||
new FormControl(this.action.apiUsername || '', [ |
|||
Validators.required |
|||
])); |
|||
|
|||
this.actionForm.setControl('text', |
|||
new FormControl(this.action.text || '', [ |
|||
Validators.required |
|||
])); |
|||
|
|||
this.actionForm.setControl('title', |
|||
new FormControl(this.action.title)); |
|||
|
|||
this.actionForm.setControl('topic', |
|||
new FormControl(this.action.topic)); |
|||
|
|||
this.actionForm.setControl('category', |
|||
new FormControl(this.action.category)); |
|||
} |
|||
} |
|||
@ -1,15 +0,0 @@ |
|||
/* |
|||
* Squidex Headless CMS |
|||
* |
|||
* @license |
|||
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. |
|||
*/ |
|||
|
|||
export * from './algolia-action.component'; |
|||
export * from './azure-queue-action.component'; |
|||
export * from './elastic-search-action.component'; |
|||
export * from './fastly-action.component'; |
|||
export * from './medium-action.component'; |
|||
export * from './slack-action.component'; |
|||
export * from './tweet-action.component'; |
|||
export * from './webhook-action.component'; |
|||
Loading…
Reference in new issue