Browse Source

temp

pull/271/head
Sebastian Stehle 8 years ago
parent
commit
9217647366
  1. 25
      src/Squidex/app/features/administration/pages/event-consumers/event-consumers-page.component.html
  2. 7
      src/Squidex/app/features/administration/state/users.state.spec.ts
  3. 73
      src/Squidex/app/shared/components/app-form.component.html

25
src/Squidex/app/features/administration/pages/event-consumers/event-consumers-page.component.html

@ -61,21 +61,12 @@
</ng-container>
</sqx-panel>
<div class="modal" *sqxModalView="eventConsumerErrorDialog;onRoot:true" @fade>
<div class="modal-backdrop"></div>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Error</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" (click)="eventConsumerErrorDialog.hide()">
<span aria-hidden="true">&times;</span>
</button>
</div>
<sqx-modal-dialog *sqxModalView="eventConsumerErrorDialog;onRoot:true" @fade (close)="eventConsumerErrorDialog.hide()">
<ng-container #title>
Error
</ng-container>
<div class="modal-body">
<textarea readonly class="form-control error-message">{{eventConsumerError}}</textarea>
</div>
</div>
</div>
</div>
<ng-container #content>
<textarea readonly class="form-control error-message">{{eventConsumerError}}</textarea>
</ng-container>
</sqx-modal-dialog>

7
src/Squidex/app/features/administration/state/users.state.spec.ts

@ -131,7 +131,7 @@ describe('UsersState', () => {
usersState.lockUser(oldUsers[0]).subscribe();
expect(usersState.snapshot.users.at(0).isLocked).toBeTruthy();
expect(usersState.snapshot.selectedUser!.isLocked).toBeTruthy();
expect(usersState.snapshot.selectedUser).toBe(usersState.snapshot.users.at(0));
});
it('should raise notification when locking failed', () => {
@ -151,7 +151,7 @@ describe('UsersState', () => {
usersState.unlockUser(oldUsers[1]).subscribe();
expect(usersState.snapshot.users.at(1).isLocked).toBeFalsy();
expect(usersState.snapshot.selectedUser!.isLocked).toBeFalsy();
expect(usersState.snapshot.selectedUser).toBe(usersState.snapshot.users.at(1));
});
it('should raise notification when unlocking failed', () => {
@ -174,8 +174,7 @@ describe('UsersState', () => {
expect(usersState.snapshot.users.at(0).email).toEqual('new@mail.com');
expect(usersState.snapshot.users.at(0).displayName).toEqual('New');
expect(usersState.snapshot.selectedUser!.email).toEqual('new@mail.com');
expect(usersState.snapshot.selectedUser!.displayName).toEqual('New');
expect(usersState.snapshot.selectedUser).toBe(usersState.snapshot.users.at(0));
});
it('should not raise notification when updating failed', () => {

73
src/Squidex/app/shared/components/app-form.component.html

@ -1,43 +1,40 @@
<div class="modal-dialog">
<div class="modal-content">
<form [formGroup]="createForm" (ngSubmit)="createApp()">
<div class="modal-header">
<h4 class="modal-title" *ngIf="template">Create {{template}} Sample</h4>
<h4 class="modal-title" *ngIf="!template">Create App</h4>
<form [formGroup]="createForm" (ngSubmit)="createApp()">
<sqx-modal-dialog (close)="complete()">
<ng-container title>
<ng-container *ngIf="template; else noTemplate">
Create {{template}} Sample
</ng-container>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" (click)="completed()">
<span aria-hidden="true">&times;</span>
</button>
</div>
<ng-template #noTemplate>
Create App
</ng-template>
</ng-container>
<div class="modal-body">
<div *ngIf="createFormError">
<div class="form-alert form-alert-error" [innerHTML]="createFormError"></div>
</div>
<div class="form-group">
<label for="appName">Name</label>
<sqx-control-errors for="name" submitOnly="true" [submitted]="createFormSubmitted"></sqx-control-errors>
<input type="text" class="form-control" id="appName" formControlName="name" autocomplete="off" sqxLowerCaseInput sqxFocusOnInit />
<ng-container content>
<div *ngIf="createFormError">
<div class="form-alert form-alert-error" [innerHTML]="createFormError"></div>
</div>
<div class="form-group">
<label for="appName">Name</label>
<sqx-control-errors for="name" submitOnly="true" [submitted]="createFormSubmitted"></sqx-control-errors>
<input type="text" class="form-control" id="appName" formControlName="name" autocomplete="off" sqxLowerCaseInput sqxFocusOnInit />
<small class="form-text text-muted">
The app name becomes part of the api url,<br /> e.g {{apiUrl.buildUrl("api/content/")}}<b>{{appName | async}}</b>/.
</small>
<small class="form-text text-muted">
The app name becomes part of the api url,<br /> e.g {{apiUrl.buildUrl("api/content/")}}<b>{{appName | async}}</b>/.
</small>
<small class="form-text text-muted">
It must contain lower case letters (a-z), numbers and dashes only, and cannot be longer than 40 characters. The name cannot be changed later.
</small>
</div>
<small class="form-text text-muted">
It must contain lower case letters (a-z), numbers and dashes only, and cannot be longer than 40 characters. The name cannot be changed later.
</small>
</div>
</ng-container>
<div class="modal-footer">
<div class="clearfix">
<button type="reset" class="float-left btn btn-secondary" (click)="cancel()" [disabled]="createFormSubmitted">Cancel</button>
<button type="submit" class="float-right btn btn-success">Create</button>
</div>
</div>
</form>
</div>
</div>
<ng-container footer>
<button type="reset" class="float-left btn btn-secondary" (click)="complete()" [disabled]="createFormSubmitted">Cancel</button>
<button type="submit" class="float-right btn btn-success">Create</button>
</ng-container>
</sqx-modal-dialog>
</form>
Loading…
Cancel
Save