<app-common-dialog [dialogContent]="dialogContent" [dialogRef]="dialogRef">
  <ng-template #dialogContent>
    <p class="fl-detail fl-no-margin-top"
       i18n>Edit notification settings for user {{data.user.full_name || data.user.email}} in relation with client {{data.client.name}}.</p>
    <p class="fl-detail" *ngIf="this.data.user.invitation" i18n>User won't receive client related notifications until invitation is accepted.</p>
    <form appFormSubmit (ngSubmit)="save()"
          [formGroup]="userNotificationsSettingsForm" layoutDirection="column" class="fl-content">
      <app-form-errors #formErrors [formGroup]="userNotificationsSettingsForm"></app-form-errors>
      <div *ngFor="let item of keysList; let i=index;">
        <div [formGroupName]="item" class="display-flex">
          <mat-checkbox formControlName="enabled" [color]="'primary'">
            {{userNotificationsSettingsResponse.detail[item].display_name}}
          </mat-checkbox>
          <app-icon *ngIf="item === 'get_all_ticket_notifications'" [icon]="{
            name: 'info',
            class: 'small-info-icon',
            marginLeft: '10px',
            marginTop: '2px',
            tooltip: getAllTicketNotificationsTooltip
          }"></app-icon>
        </div>
      </div>
    </form>
  </ng-template>
</app-common-dialog>
