Project

General

Profile

« Previous | Next » 

Revision 60182

[Library | Trunk]: Add lock icon on disabled inputs

View differences:

modules/uoa-services-library/trunk/ng-openaire-library/src/app/role-verification/role-verification.component.ts
176 176
      this.loading = false;
177 177
      this.managerModal.cancel();
178 178
      this.error = null;
179
      this.subs.push(this.userManagementService.updateUserInfo(() => {
179
      this.userManagementService.updateUserInfo(() => {
180 180
        this.router.navigate(['/admin/' + this.verification.entity]);
181
      }));
181
      });
182 182
    }, error => {
183 183
      this.loading = false;
184 184
      this.error = 'The verification code is invalid';
......
190 190
    this.subs.push(this.userRegistryService.verify(this.verification.id, this.code.value, "member").subscribe(() => {
191 191
      this.loading = false;
192 192
      this.error = null;
193
      this.subs.push(this.userManagementService.updateUserInfo(() => {
193
      this.userManagementService.updateUserInfo(() => {
194 194
        this.isMember = true;
195
      }));
195
      });
196 196
    }, error => {
197 197
      this.loading = false;
198 198
      this.error = 'The verification code is invalid';
modules/uoa-services-library/trunk/ng-openaire-library/src/app/sharedComponents/input/input.component.ts
15 15
@Component({
16 16
  selector: '[dashboard-input]',
17 17
  template: `
18
    <div *ngIf="label && type != 'checkbox'"
19
         class="uk-text-bold uk-form-label uk-margin-small-bottom">{{label + (required ? ' *' : '')}}</div>
18
    <div *ngIf="label && type != 'checkbox'" class="uk-text-bold uk-form-label uk-margin-small-bottom">{{label + (required ? ' *' : '')}}</div>
20 19
    <div *ngIf="hint" class="uk-margin-bottom uk-text-small uk-form-hint">{{hint}}</div>
21 20
    <div class="uk-grid uk-flex uk-flex-middle" uk-grid>
22 21
      <ng-content></ng-content>
23
      <div [class.uk-hidden]="hideControl"  class="uk-width-expand@m uk-position-relative" [class.uk-flex-first]="!extraLeft">
24
        <ng-template [ngIf]="icon">
22
      <div [class.uk-hidden]="hideControl" class="uk-width-expand@m uk-position-relative" [class.uk-flex-first]="!extraLeft">
23
        <ng-template [ngIf]="icon && formControl.enabled">
25 24
          <span class="uk-text-muted" [ngClass]="iconLeft?('left'):'right'">
26 25
            <icon [name]="icon"></icon>
27 26
          </span>
28 27
        </ng-template>
28
        <ng-template [ngIf]="formControl.disabled">
29
          <span class="uk-text-muted left">
30
            <icon [name]="'lock'"></icon>
31
          </span>
32
        </ng-template>
29 33
        <ng-template [ngIf]="type === 'text'">
30
          <input class="uk-input input-box uk-text-small" [placeholder]="placeholder" [formControl]="formControl"
34
          <input class="uk-input input-box uk-text-small" [attr.uk-tooltip]="formControl.disabled?'title: This field is not editable; pos: bottom-left':''" [placeholder]="placeholder" [formControl]="formControl"
31 35
                 [class.uk-form-danger]="formControl.invalid && formControl.touched">
32 36
        </ng-template>
33 37
        <ng-template [ngIf]="type === 'textarea'">
34
          <textarea class="uk-textarea input-box uk-text-small" [rows]="rows" [placeholder]="placeholder"
38
          <textarea class="uk-textarea input-box uk-text-small" [attr.uk-tooltip]="formControl.disabled?'title: This field is not editable; pos: bottom-left':''" [rows]="rows" [placeholder]="placeholder"
35 39
                    [formControl]="formControl" [class.uk-form-danger]="formControl.invalid && formControl.touched">
36 40
          </textarea>
37 41
        </ng-template>
38 42
        <ng-template [ngIf]="type === 'select'">
39
          <div class="input-box clickable" [class.uk-form-danger]="formControl.invalid && formControl.touched" (click)="openSelect()">
43
          <div class="input-box" [attr.uk-tooltip]="formControl.disabled?'title: This field is not editable; pos: bottom-left':''" [class.clickable]="formControl.enabled"  [class.uk-form-danger]="formControl.invalid && formControl.touched" (click)="openSelect()">
40 44
            <mat-form-field class="uk-width-1-1">
41 45
              <mat-select #select *ngIf="type === 'select'" [required]="required" [value]="null"
42 46
                          (openedChange)="stopPropagation()" [formControl]="formControl" [disableOptionCentering]="true">
modules/uoa-services-library/trunk/ng-openaire-library/src/app/sharedComponents/input/input.module.ts
6 6
import {MatSelectModule} from "@angular/material/select";
7 7
import {MatCheckboxModule} from '@angular/material/checkbox';
8 8
import {IconsModule} from "../../utils/icons/icons.module";
9
import {IconsService} from "../../utils/icons/icons.service";
10
import {lock} from "../../utils/icons/icons";
11

  
9 12
@NgModule({
10 13
  imports: [
11 14
    SharedModule,
......
23 26
  ]
24 27
})
25 28
export class InputModule {
29
  constructor(private iconsService: IconsService) {
30
    this.iconsService.registerIcons([lock]);
31
  }
26 32
}

Also available in: Unified diff