1
0
mirror of https://github.com/bitwarden/web synced 2025-12-30 23:23:34 +00:00

Disable personal imports if Personal Ownership policy applies (#1176)

* Disable imports if personal ownership policy set

* Add missing await
This commit is contained in:
Thomas Rittson
2021-09-08 07:19:49 +10:00
committed by GitHub
parent f584950dda
commit dd47eed7c7
4 changed files with 32 additions and 9 deletions

View File

@@ -1,12 +1,16 @@
<div class="page-header">
<h1>{{'importData' | i18n}}</h1>
</div>
<app-callout type="info" *ngIf="importBlockedByPolicy">
{{'personalOwnershipPolicyInEffectImports' | i18n}}
</app-callout>
<form #form (ngSubmit)="submit()" ngNativeValidate>
<div class="row">
<div class="col-6">
<div class="form-group">
<label for="type">1. {{'selectFormat' | i18n}}</label>
<select id="type" name="Format" [(ngModel)]="format" class="form-control" required>
<select id="type" name="Format" [(ngModel)]="format" class="form-control"
[disabled]="importBlockedByPolicy" required>
<option *ngFor="let o of featuredImportOptions" [ngValue]="o.id">{{o.name}}</option>
<ng-container *ngIf="importOptions && importOptions.length">
<option value="-" disabled></option>
@@ -240,15 +244,17 @@
<div class="col-6">
<div class="form-group">
<label for="file">2. {{'selectImportFile' | i18n}}</label>
<input type="file" id="file" class="form-control-file" name="file">
<input type="file" id="file" class="form-control-file" name="file" [disabled]="importBlockedByPolicy">
</div>
</div>
</div>
<div class="form-group">
<label for="fileContents">{{'orCopyPasteFileContents' | i18n}}</label>
<textarea id="fileContents" class="form-control" name="FileContents" [(ngModel)]="fileContents"></textarea>
<textarea id="fileContents" class="form-control" name="FileContents" [(ngModel)]="fileContents"
[disabled]="importBlockedByPolicy"></textarea>
</div>
<button type="submit" class="btn btn-primary btn-submit" [disabled]="loading">
<button type="submit" class="btn btn-primary btn-submit" [disabled]="loading || importBlockedByPolicy"
[ngClass]="{manual:importBlockedByPolicy}">
<i class="fa fa-spinner fa-spin" title="{{'loading' | i18n}}" aria-hidden="true"></i>
<span>{{'importData' | i18n}}</span>
</button>