Batch web provider fixes (#1113)

* Style provider set up toast

* Correct translation strings

* Do not show provider organization management for non admins

* Product feedback for provider org description

* Correct message grammar
This commit is contained in:
Matt Gibson 2021-08-04 21:53:15 -04:00 committed by GitHub
parent 7844c23fba
commit ebbdea8f88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 9 deletions

View File

@ -7,12 +7,13 @@
<input type="search" class="form-control form-control-sm" id="search" placeholder="{{'search' | i18n}}"
[(ngModel)]="searchText">
</div>
<a class="btn btn-sm btn-outline-primary ml-3" routerLink="create">
<a class="btn btn-sm btn-outline-primary ml-3" routerLink="create" *ngIf="manageOrganizations">
<i class="fa fa-plus fa-fw" aria-hidden="true"></i>
{{'newClientOrganization' | i18n}}
</a>
<button class="btn btn-sm btn-outline-primary ml-3" (click)="addExistingOrganization()" *ngIf="showAddExisting">
<i class="fa fa-arrow-circle-o-right fa-fw" aria-hidden="true"></i>
<button class="btn btn-sm btn-outline-primary ml-3" (click)="addExistingOrganization()"
*ngIf="manageOrganizations && showAddExisting">
<i class="fa fa-plus fa-fw" aria-hidden="true"></i>
{{'addExistingOrganization' | i18n}}
</button>
</div>

View File

@ -10,19 +10,23 @@ import { ToasterService } from 'angular2-toaster';
import { ApiService } from 'jslib-common/abstractions/api.service';
import { I18nService } from 'jslib-common/abstractions/i18n.service';
import { LogService } from 'jslib-common/abstractions/log.service';
import { PlatformUtilsService } from 'jslib-common/abstractions/platformUtils.service';
import { SearchService } from 'jslib-common/abstractions/search.service';
import { UserService } from 'jslib-common/abstractions/user.service';
import { ProviderUserType } from 'jslib-common/enums/providerUserType';
import { ValidationService } from 'jslib-angular/services/validation.service';
import {
ProviderOrganizationOrganizationDetailsResponse
} from 'jslib-common/models/response/provider/providerOrganizationResponse';
import { LogService } from 'jslib-common/abstractions';
import { ModalComponent } from 'src/app/modal.component';
import { ProviderService } from '../services/provider.service';
import { AddOrganizationComponent } from './add-organization.component';
@Component({
@ -35,6 +39,7 @@ export class ClientsComponent implements OnInit {
providerId: any;
searchText: string;
loading = true;
manageOrganizations = false;
showAddExisting = false;
clients: ProviderOrganizationOrganizationDetailsResponse[];
@ -71,6 +76,7 @@ export class ClientsComponent implements OnInit {
async load() {
const response = await this.apiService.getProviderClients(this.providerId);
this.clients = response.data != null && response.data.length > 0 ? response.data : [];
this.manageOrganizations = (await this.userService.getProvider(this.providerId)).type === ProviderUserType.ProviderAdmin;
this.showAddExisting = (await this.userService.getAllOrganizations()).some(org => org.providerId == null);
this.loading = false;
}

View File

@ -83,7 +83,7 @@ export class SetupComponent implements OnInit {
request.key = key;
const provider = await this.apiService.postProviderSetup(this.providerId, request);
this.toasterService.popAsync('success', this.i18nService.t('providerSetup'));
this.toasterService.popAsync('success', null, this.i18nService.t('providerSetup'));
await this.syncService.fullSync(true);
this.router.navigate(['/providers', provider.id]);

View File

@ -4064,7 +4064,7 @@
"message": "Provider Name"
},
"providerSetup": {
"message": "The provider has been setup."
"message": "The provider has been set up."
},
"clients": {
"message": "Clients"
@ -4103,13 +4103,13 @@
"message": "Provider"
},
"newClientOrganization": {
"message": "New client organization"
"message": "New Client Organization"
},
"newClientOrganizationDesc": {
"message": "Organizations allow you to share parts of your vault with others as well as manage related users for a specific entity such as a family, small team, or large company."
"message": "Create a new client organization that will be associated with you as the provider. You will be able to access and manage this organization."
},
"addExistingOrganization": {
"message": "Add existing organization"
"message": "Add Existing Organization"
},
"myProvider": {
"message": "My Provider"