Skip to content

Commit

Permalink
Reintroduce registrationRequiresServerUser app config setting to make…
Browse files Browse the repository at this point in the history
… managing central user more flexible
  • Loading branch information
esurface committed Feb 7, 2024
1 parent a9c90ff commit 9d3f9b8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion client/src/app/shared/_classes/app-config.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ export class AppConfig {
// Profile configuration.
//

// This setting only applies to Sync Protocol 1.
// centrallyManagedUserProfile and registrationRequiresServerUser are mutually exclusive. If both are set to true, the app will default to using centrallyManagedUserProfile.
// The user profile is managed by the server and not the Device. This setting is only applicable to Sync Protocol 1.
centrallyManagedUserProfile = false
// The user profile is initially managed by the server and can be updated on the client. This setting is only applicable to Sync Protocol 2.
registrationRequiresServerUser = false
// Hides the user profile link to edit when on the Device.
hideProfile = false
// Hides the about page.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export class CreateProfileGuardService implements CanActivate {
} else {
const appConfig = await this.appConfigService.getAppConfig()
let navigateUrl = ''
if (appConfig.centrallyManagedUserProfile === true && (appConfig.syncProtocol === '1' || !appConfig.syncProtocol)) {
if ((appConfig.centrallyManagedUserProfile === true || appConfig.registrationRequiresServerUser === true) &&
(appConfig.syncProtocol === '1' || !appConfig.syncProtocol)
) {
navigateUrl = '/import-user-profile'
} else if (appConfig.syncProtocol === '2') {
navigateUrl = '/associate-user-profile'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p>
<paper-input [disabled]="state === STATE_SYNCING" name="user-short-code" label="enter import code here" #userShortCode></paper-input>
<paper-button [disabled]="state === STATE_SYNCING" (click)="onSubmit()">submit</paper-button>
<paper-input [disabled]="state === STATE_SYNCING" name="user-short-code" label="{{'Enter the provided import code'|translate}}" #userShortCode></paper-input>
<paper-button [disabled]="state === STATE_SYNCING" (click)="onSubmit()">{{'submit'|translate}}</paper-button>
</p>
<p *ngIf="state === STATE_SYNCING">
Syncing...
{{'Syncing'|translate}}...
</p>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Router } from '@angular/router';
import PouchDB from 'pouchdb';
import { AppConfigService } from 'src/app/shared/_services/app-config.service';
import { AppConfig } from 'src/app/shared/_classes/app-config.class';
import { _TRANSLATE } from 'src/app/shared/translation-marker';


@Component({
Expand Down
2 changes: 2 additions & 0 deletions translations/translation.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"Edit Item": "Edit Item",
"Email": "Email",
"End Date": "End Date",
"Enter the provided import code": "Enter the provided import code",
"Enter your response to above question here": "Enter your response to above question here",
"Error Downloading File": "Error Downloading File",
"Error restoring db ": "Error restoring db ",
Expand Down Expand Up @@ -253,6 +254,7 @@
"START": "START",
"STOP": "STOP",
"SUBMIT": "SUBMIT",
"SYNCING": "SYNCING",
"SYNC DATA FOR ALL USERS": "SYNC DATA FOR ALL USERS",
"Save": "Save",
"Save before switching or your changes will be deleted.": "Save before switching or your changes will be deleted.",
Expand Down
2 changes: 2 additions & 0 deletions translations/translation.es_gt.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"Edit Item": "Editar elemento",
"Email": "Correo electrónico",
"End Date": "End Date",
"Enter the provided import code": "Introduzca el código de importación",
"Enter your response to above question here": "Escriba aquí su respuesta a la pregunta anterior",
"Error Downloading File": "Error al descargar el archivo",
"Error restoring db ": "Error restoring db ",
Expand Down Expand Up @@ -433,6 +434,7 @@
"start form": "Iniciar formulario",
"submit": "Guardar",
"summary": "resumen",
"syncing": "sincronización",
"updated settings": "updated settings",
"yes": "yes",
"yes, continue": "sí, continuar",
Expand Down

0 comments on commit 9d3f9b8

Please sign in to comment.