Browse Source

temp

pull/271/head
Sebastian Stehle 9 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> </ng-container>
</sqx-panel> </sqx-panel>
<div class="modal" *sqxModalView="eventConsumerErrorDialog;onRoot:true" @fade> <sqx-modal-dialog *sqxModalView="eventConsumerErrorDialog;onRoot:true" @fade (close)="eventConsumerErrorDialog.hide()">
<div class="modal-backdrop"></div> <ng-container #title>
<div class="modal-dialog"> Error
<div class="modal-content"> </ng-container>
<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>
<div class="modal-body"> <ng-container #content>
<textarea readonly class="form-control error-message">{{eventConsumerError}}</textarea> <textarea readonly class="form-control error-message">{{eventConsumerError}}</textarea>
</div> </ng-container>
</div> </sqx-modal-dialog>
</div>
</div>

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

@ -131,7 +131,7 @@ describe('UsersState', () => {
usersState.lockUser(oldUsers[0]).subscribe(); usersState.lockUser(oldUsers[0]).subscribe();
expect(usersState.snapshot.users.at(0).isLocked).toBeTruthy(); 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', () => { it('should raise notification when locking failed', () => {
@ -151,7 +151,7 @@ describe('UsersState', () => {
usersState.unlockUser(oldUsers[1]).subscribe(); usersState.unlockUser(oldUsers[1]).subscribe();
expect(usersState.snapshot.users.at(1).isLocked).toBeFalsy(); 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', () => { 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).email).toEqual('new@mail.com');
expect(usersState.snapshot.users.at(0).displayName).toEqual('New'); expect(usersState.snapshot.users.at(0).displayName).toEqual('New');
expect(usersState.snapshot.selectedUser!.email).toEqual('new@mail.com'); expect(usersState.snapshot.selectedUser).toBe(usersState.snapshot.users.at(0));
expect(usersState.snapshot.selectedUser!.displayName).toEqual('New');
}); });
it('should not raise notification when updating failed', () => { 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"> <form [formGroup]="createForm" (ngSubmit)="createApp()">
<div class="modal-content"> <sqx-modal-dialog (close)="complete()">
<form [formGroup]="createForm" (ngSubmit)="createApp()"> <ng-container title>
<div class="modal-header"> <ng-container *ngIf="template; else noTemplate">
<h4 class="modal-title" *ngIf="template">Create {{template}} Sample</h4> Create {{template}} Sample
<h4 class="modal-title" *ngIf="!template">Create App</h4> </ng-container>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" (click)="completed()"> <ng-template #noTemplate>
<span aria-hidden="true">&times;</span> Create App
</button> </ng-template>
</div> </ng-container>
<div class="modal-body"> <ng-container content>
<div *ngIf="createFormError"> <div *ngIf="createFormError">
<div class="form-alert form-alert-error" [innerHTML]="createFormError"></div> <div class="form-alert form-alert-error" [innerHTML]="createFormError"></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="appName">Name</label> <label for="appName">Name</label>
<sqx-control-errors for="name" submitOnly="true" [submitted]="createFormSubmitted"></sqx-control-errors> <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 /> <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"> <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>/. 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> </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>
</div> </div>
</ng-container>
<div class="modal-footer"> <ng-container footer>
<div class="clearfix"> <button type="reset" class="float-left btn btn-secondary" (click)="complete()" [disabled]="createFormSubmitted">Cancel</button>
<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>
<button type="submit" class="float-right btn btn-success">Create</button> </ng-container>
</div> </sqx-modal-dialog>
</div> </form>
</form>
</div>
</div>
Loading…
Cancel
Save