Browse Source

Feature/custom editors for all (#553)

* Custom editors for all field types.

* App settings cleanup.
pull/556/head
Sebastian Stehle 5 years ago
committed by GitHub
parent
commit
c877d6ca99
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 65
      backend/src/Squidex/appsettings.json
  2. 14
      frontend/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.html
  3. 3
      frontend/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.scss
  4. 13
      frontend/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.html
  5. 3
      frontend/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.scss
  6. 11
      frontend/app/features/schemas/pages/schema/fields/types/array-validation.component.html
  7. 11
      frontend/app/features/schemas/pages/schema/fields/types/assets-validation.component.html
  8. 11
      frontend/app/features/schemas/pages/schema/fields/types/boolean-ui.component.html
  9. 11
      frontend/app/features/schemas/pages/schema/fields/types/boolean-validation.component.html
  10. 11
      frontend/app/features/schemas/pages/schema/fields/types/date-time-ui.component.html
  11. 11
      frontend/app/features/schemas/pages/schema/fields/types/date-time-validation.component.html
  12. 11
      frontend/app/features/schemas/pages/schema/fields/types/geolocation-ui.component.html
  13. 12
      frontend/app/features/schemas/pages/schema/fields/types/geolocation-validation.component.html
  14. 3
      frontend/app/features/schemas/pages/schema/fields/types/geolocation-validation.component.scss
  15. 13
      frontend/app/features/schemas/pages/schema/fields/types/json-ui.component.html
  16. 3
      frontend/app/features/schemas/pages/schema/fields/types/json-ui.component.scss
  17. 12
      frontend/app/features/schemas/pages/schema/fields/types/json-validation.component.html
  18. 3
      frontend/app/features/schemas/pages/schema/fields/types/json-validation.component.scss
  19. 11
      frontend/app/features/schemas/pages/schema/fields/types/number-ui.component.html
  20. 11
      frontend/app/features/schemas/pages/schema/fields/types/number-validation.component.html
  21. 12
      frontend/app/features/schemas/pages/schema/fields/types/references-validation.component.html
  22. 11
      frontend/app/features/schemas/pages/schema/fields/types/string-ui.component.html
  23. 12
      frontend/app/features/schemas/pages/schema/fields/types/string-validation.component.html
  24. 11
      frontend/app/features/schemas/pages/schema/fields/types/tags-ui.component.html
  25. 11
      frontend/app/features/schemas/pages/schema/fields/types/tags-validation.component.html

65
backend/src/Squidex/appsettings.json

@ -53,8 +53,8 @@
/*
* Use custom langauges where the key is the language code and the value is the english name.
*/
"custom": ""
},
"custom": ""
},
"rules": {
/*
@ -102,26 +102,32 @@
* Redirect to login automatically.
*/
"redirectToLogin": false,
/*
* Hide the news dialog.
*/
"hideNews": false,
/*
* Hide all onboarding tooltips and dialogs.
*/
"hideOnboarding": false,
/*
* Hide the today and now button.
*/
"hideDateButtons": false,
/*
* True to disable scheduled content status changed, for example when you have your own scheduling system.
*/
"disableScheduledChanges": false,
/*
* Show the exposed values as information on the apps overview page.
*/
"showInfo": false,
/*
* The number of content items for dropdown selector.
*/
@ -141,23 +147,27 @@
* The host name to your email server.
*/
"server": "",
/*
* The sender email address.
*/
"sender": "hello@squidex.io",
/*
* The username to authenticate to your email server.
*/
"username": "",
/*
* The password to authenticate to your email server.
*/
"password": "",
/*
* Always use SSL if possible.
*/
"enableSsl": true,
/*
* The port to your email server.
*/
@ -168,22 +178,27 @@
* The email subject when a new user is added as contributor.
*/
"newUserSubject": "You have been invited to join Project $APP_NAME at Squidex CMS",
/*
* The email body when a new user is added as contributor.
*/
"newUserBody": "Welcome to Squidex\r\nDear User,\r\n\r\n$ASSIGNER_NAME ($ASSIGNER_EMAIL) has invited you to join Project (also called an App) $APP_NAME at Squidex Headless CMS. Login with your Github, Google or Microsoft credentials to create a new user account and start editing content now.\r\n\r\nThank you very much,\r\nThe Squidex Team\r\n\r\n<<Start now!>> [$UI_URL]",
/*
* The email subject when an existing user is added as contributor.
*/
"existingUserSubject": "[Squidex CMS] You have been invited to join App $APP_NAME",
/*
* The email body when an existing user is added as contributor.
*/
"existingUserBody": "Dear User,\r\n\r\n$ASSIGNER_NAME ($ASSIGNER_EMAIL) has invited you to join App $APP_NAME at Squidex Headless CMS.\r\n\r\nLogin or reload the Management UI to see the App.\r\n\r\nThank you very much,\r\nThe Squidex Team\r\n\r\n<<Start now!>> [$UI_URL]",
/*
* The email subject when app usage reached
*/
"usageSubject": "[Squidex CMS] You you are about to reach your usage limit for App $APP_NAME",
/*
* The email body when app usage reached
*/
@ -212,10 +227,12 @@
* The default page size if not specified by a query.
*/
"defaultPageSize": 200,
/*
* The default page size for graphql if not specified by a query.
*/
"defaultPageSizeGraphQL": 20,
/*
* The maximum number of items to return for each query.
*
@ -229,10 +246,12 @@
* The default page size if not specified by a query.
*/
"defaultPageSize": 200,
/*
* The default page size for graphql if not specified by a query.
*/
"defaultPageSizeGraphQL": 20,
/*
* The maximum number of items to return for each query.
*
@ -244,6 +263,7 @@
* The maximum file size in bytes. Default: 5MB
*/
"maxSize": 5242880,
/*
* True to delete assets recursively.
*/
@ -257,26 +277,32 @@
* Trace, Debug, Information, Warning, Error, Fatal
*/
"level": "Information",
/*
* Setting the flag to true, enables well formatteds json logs.
*/
"human": true,
/*
* Set to true, to use colors.
*/
"colors": true,
/*
* Set to false to disable logging of http requests.
*/
"logRequests": true,
/*
* Set to true to enable logging of profiler information.
*/
"logProfiler": false,
/*
* The number of days request log items will be stored.
*/
"storeRetentationInDays": 90,
/*
* True, to enable datadog integration.
*/
@ -307,13 +333,13 @@
* The name of the container in the Azure Blob Storage
*/
"containerName": "squidex-assets",
/*
* The connection string to the azure storage service.
*/
"connectionString": "UseDevelopmentStorage=true"
},
"AmazonS3": {
/*
* The url of the S3 API service. Leave it empty if using the one provided by Amazon
*/
@ -360,10 +386,12 @@
* Read More: https://docs.mongodb.com/manual/reference/connection-string/
*/
"configuration": "mongodb://localhost",
/*
* The name of the event store database.
*/
"database": "SquidexAssets",
/*
* The name of the Mongo Grid FS bucket.
*/
@ -374,15 +402,18 @@
*The host of the ftp service
*/
"serverHost": "",
/*
*The host of the ftp service
*/
"serverPort": "21",
/*
* Credentials.
*/
"username": "",
"password": "",
/*
* The relative or absolute path to the folder to store the assets.
*/
@ -401,14 +432,17 @@
* Supported: MongoDB, Development
*/
"clustering": "Development",
/*
* The port is used to share messages between all cluster members. Must be accessible within your cluster or network.
*/
"siloPort": "11111",
/*
* The ports used by Orleans to connect to external clients. Not used.
*/
"gatewayPort": "40000",
/*
* The advertised IP address. Usually not needed.
*/
@ -429,6 +463,7 @@
* Read More: https://docs.mongodb.com/manual/reference/connection-string/
*/
"configuration": "mongodb://localhost",
/*
* The name of the event store database.
*/
@ -441,10 +476,12 @@
* Read Mode: http://docs.geteventstore.com/dotnet-api/4.0.0/connecting-to-a-server/
*/
"configuration": "ConnectTo=tcp://admin:changeit@localhost:1113; HeartBeatTimeout=500; MaxReconnections=-1",
/*
* The host name of your EventStore where projection requests will be sent to.
*/
"projectionHost": "localhost",
/*
* Prefix for all streams and projections (for multiple installations).
*/
@ -455,10 +492,12 @@
* The connection string to your CosmosDB instance.
*/
"configuration": "https://localhost:8081",
/*
* The primary access key.
*/
"masterKey": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
/*
* The name of the event store database.
*/
@ -496,10 +535,12 @@
* Read More: https://docs.mongodb.com/manual/reference/connection-string/
*/
"configuration": "mongodb://localhost",
/*
* The database for all your content collections (one collection per app).
*/
"contentDatabase": "SquidexContent",
/*
* The database for all your other read collections.
*/
@ -512,34 +553,41 @@
* Set to true to show PII (Personally Identifiable Information) in the logs.
*/
"showPII": true,
/*
* Enable password auth. Set this to false if you want to disable local login, leaving only 3rd party login options.
*/
"allowPasswordAuth": true,
/*
* Initial admin user.
*/
"adminEmail": "",
"adminPassword": "",
/*
* Recreate the admin if it does not exist or the password does not match.
*/
"adminRecreate": false,
/*
* Client with all admin permissions.
*/
"adminClientId": "",
"adminClientSecret": "",
/*
* Settings for Google auth (keep empty to disable).
*/
"googleClient": "1006817248705-t3lb3ge808m9am4t7upqth79hulk456l.apps.googleusercontent.com",
"googleSecret": "QsEi-fHqkGw2_PjJmtNHf2wg",
/*
* Settings for Github auth (keep empty to disable).
*/
"githubClient": "211ea00e726baf754c78",
"githubSecret": "d0a0d0fe2c26469ae20987ac265b3a339fd73132",
/*
* Settings for Microsoft auth (keep empty to disable).
* Tennant is optional for using a specific AzureAD tenant
@ -547,6 +595,7 @@
"microsoftClient": "b55da740-6648-4502-8746-b9003f29d5f1",
"microsoftSecret": "idWbANxNYEF4cB368WXJhjN",
"microsoftTenant": null,
/*
* Settings for your custom oidc server.
*/
@ -557,10 +606,12 @@
"oidcScopes": [
"email"
],
/*
* Lock new users automatically, the administrator must unlock them.
*/
"lockAutomatically": false,
/*
* The url to you privacy statements, if you host squidex by yourself.
*/
@ -572,6 +623,7 @@
* The app name where the news are stored.
*/
"appName": "squidex-website",
/*
* The credentials to the app (Readonly).
*/
@ -593,22 +645,27 @@
* Set to true to rebuild apps.
*/
"apps": false,
/*
* Set to true to rebuild assets.
*/
"assets": false,
/*
* Set to true to rebuild contents.
*/
"contents": false,
/*
* Set to true to rebuild rules.
*/
"rules": false,
/*
* Set to true to rebuild schemas.
*/
"schemas": false,
/*
* Set to true to rebuild indexes.
*/

14
frontend/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.html

@ -1,3 +1,17 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_editorUrl">Editor Url</label>
<div class="col-6">
<input type="text" class="form-control" id="{{field.fieldId}}_editorUrl" formControlName="editorUrl" />
<sqx-form-hint>
Url to your plugin if you use a custom editor.
</sqx-form-hint>
</div>
</div>
</div>
<ng-container [ngSwitch]="field.rawProperties.fieldType">
<ng-container *ngSwitchCase="'Assets'">
<sqx-assets-ui [fieldForm]="fieldForm" [field]="field" [properties]="field.rawProperties"></sqx-assets-ui>

3
frontend/app/features/schemas/pages/schema/fields/forms/field-form-ui.component.scss

@ -0,0 +1,3 @@
.form-group {
margin-bottom: 1rem;
}

13
frontend/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.html

@ -1,3 +1,16 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="{{field.fieldId}}_fieldRequired" formControlName="isRequired" />
<label class="form-check-label" for="{{field.fieldId}}_fieldRequired">
Required
</label>
</div>
</div>
</div>
</div>
<ng-container [ngSwitch]="field.rawProperties.fieldType">
<ng-container *ngSwitchCase="'Array'">
<sqx-array-validation [fieldForm]="fieldForm" [field]="field" [properties]="field.rawProperties"></sqx-array-validation>

3
frontend/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.scss

@ -0,0 +1,3 @@
.form-group {
margin-bottom: .5rem;
}

11
frontend/app/features/schemas/pages/schema/fields/types/array-validation.component.html

@ -1,15 +1,4 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="{{field.fieldId}}_fieldRequired" formControlName="isRequired" />
<label class="form-check-label" for="{{field.fieldId}}_fieldRequired">
Required
</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label">Items</label>

11
frontend/app/features/schemas/pages/schema/fields/types/assets-validation.component.html

@ -1,15 +1,4 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="{{field.fieldId}}_fieldRequired" formControlName="isRequired" />
<label class="form-check-label" for="{{field.fieldId}}_fieldRequired">
Required
</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label">Items</label>

11
frontend/app/features/schemas/pages/schema/fields/types/boolean-ui.component.html

@ -1,15 +1,4 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_editorUrl">Editor Url</label>
<div class="col-6">
<input type="text" class="form-control" id="{{field.fieldId}}_editorUrl" formControlName="editorUrl" />
<sqx-form-hint>
Url to your plugin if you use a custom editor.
</sqx-form-hint>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_fieldPlaceholder">Placeholder</label>

11
frontend/app/features/schemas/pages/schema/fields/types/boolean-validation.component.html

@ -1,15 +1,4 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="{{field.fieldId}}_fieldRequired" formControlName="isRequired" />
<label class="form-check-label" for="{{field.fieldId}}_fieldRequired">
Required
</label>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">

11
frontend/app/features/schemas/pages/schema/fields/types/date-time-ui.component.html

@ -1,15 +1,4 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_editorUrl">Editor Url</label>
<div class="col-6">
<input type="text" class="form-control" id="{{field.fieldId}}_editorUrl" formControlName="editorUrl" />
<sqx-form-hint>
Url to your plugin if you use a custom editor.
</sqx-form-hint>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_fieldPlaceholder">Placeholder</label>

11
frontend/app/features/schemas/pages/schema/fields/types/date-time-validation.component.html

@ -1,15 +1,4 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="{{field.fieldId}}_fieldRequired" formControlName="isRequired" />
<label class="form-check-label" for="{{field.fieldId}}_fieldRequired">
Required
</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label">Min Value</label>

11
frontend/app/features/schemas/pages/schema/fields/types/geolocation-ui.component.html

@ -1,15 +1,4 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_editorUrl">Editor Url</label>
<div class="col-6">
<input type="text" class="form-control" id="{{field.fieldId}}_editorUrl" formControlName="editorUrl" />
<sqx-form-hint>
Url to your plugin if you use a custom editor.
</sqx-form-hint>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label">Editor</label>

12
frontend/app/features/schemas/pages/schema/fields/types/geolocation-validation.component.html

@ -1,12 +0,0 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="{{field.fieldId}}_fieldRequired" formControlName="isRequired" />
<label class="form-check-label" for="{{field.fieldId}}_fieldRequired">
Required
</label>
</div>
</div>
</div>
</div>

3
frontend/app/features/schemas/pages/schema/fields/types/geolocation-validation.component.scss

@ -1,3 +0,0 @@
.form-group {
margin-top: .5rem;
}

13
frontend/app/features/schemas/pages/schema/fields/types/json-ui.component.html

@ -1,13 +0,0 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_editorUrl">Editor Url</label>
<div class="col-6">
<input type="text" class="form-control" id="{{field.fieldId}}_editorUrl" formControlName="editorUrl" />
<sqx-form-hint>
Url to your plugin if you use a custom editor.
</sqx-form-hint>
</div>
</div>
</div>

3
frontend/app/features/schemas/pages/schema/fields/types/json-ui.component.scss

@ -1,3 +0,0 @@
.form-group {
margin: 0;
}

12
frontend/app/features/schemas/pages/schema/fields/types/json-validation.component.html

@ -1,12 +0,0 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="{{field.fieldId}}_fieldRequired" formControlName="isRequired" />
<label class="form-check-label" for="{{field.fieldId}}_fieldRequired">
Required
</label>
</div>
</div>
</div>
</div>

3
frontend/app/features/schemas/pages/schema/fields/types/json-validation.component.scss

@ -1,3 +0,0 @@
.form-group {
margin-top: .5rem;
}

11
frontend/app/features/schemas/pages/schema/fields/types/number-ui.component.html

@ -1,15 +1,4 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_editorUrl">Editor Url</label>
<div class="col-6">
<input type="text" class="form-control" id="{{field.fieldId}}_editorUrl" formControlName="editorUrl" />
<sqx-form-hint>
Url to your plugin if you use a custom editor.
</sqx-form-hint>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_fieldPlaceholder">Placeholder</label>

11
frontend/app/features/schemas/pages/schema/fields/types/number-validation.component.html

@ -10,17 +10,6 @@
</div>
</div>
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="{{field.fieldId}}_fieldRequired" formControlName="isRequired" />
<label class="form-check-label" for="{{field.fieldId}}_fieldRequired">
Required
</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label">Range</label>

12
frontend/app/features/schemas/pages/schema/fields/types/references-validation.component.html

@ -9,18 +9,6 @@
</div>
</div>
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="{{field.fieldId}}_fieldRequired" formControlName="isRequired" />
<label class="form-check-label" for="{{field.fieldId}}_fieldRequired">
Required
</label>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">

11
frontend/app/features/schemas/pages/schema/fields/types/string-ui.component.html

@ -1,15 +1,4 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_editorUrl">Editor Url</label>
<div class="col-6">
<input type="text" class="form-control" id="{{field.fieldId}}_editorUrl" formControlName="editorUrl" />
<sqx-form-hint>
Url to your plugin if you use a custom editor.
</sqx-form-hint>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_fieldPlaceholder">Placeholder</label>

12
frontend/app/features/schemas/pages/schema/fields/types/string-validation.component.html

@ -9,18 +9,6 @@
</div>
</div>
</div>
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="{{field.fieldId}}_fieldRequired" formControlName="isRequired" />
<label class="form-check-label" for="{{field.fieldId}}_fieldRequired">
Required
</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label">Length</label>

11
frontend/app/features/schemas/pages/schema/fields/types/tags-ui.component.html

@ -1,15 +1,4 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_editorUrl">Editor Url</label>
<div class="col-6">
<input type="text" class="form-control" id="{{field.fieldId}}_editorUrl" formControlName="editorUrl" />
<sqx-form-hint>
Url to your plugin if you use a custom editor.
</sqx-form-hint>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label" for="{{field.fieldId}}_fieldPlaceholder">Placeholder</label>

11
frontend/app/features/schemas/pages/schema/fields/types/tags-validation.component.html

@ -1,15 +1,4 @@
<div [formGroup]="fieldForm">
<div class="form-group row">
<div class="col-9 offset-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="{{field.fieldId}}_fieldRequired" formControlName="isRequired" />
<label class="form-check-label" for="{{field.fieldId}}_fieldRequired">
Required
</label>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-3 col-form-label">Items</label>

Loading…
Cancel
Save