Skip to content
Snippets Groups Projects
Verified Commit 7d4ef654 authored by Damien's avatar Damien
Browse files

FEAT #14455 TIME 1:00 Parameter application name

parent 5888d50f
No related branches found
No related tags found
No related merge requests found
......@@ -96,7 +96,7 @@ class ParameterController
$body = $request->getParsedBody();
if ($args['id'] == 'logo' || $args['id'] == 'bodyImage') {
if (in_array($args['id'], ['logo', 'bodyImage', 'applicationName'])) {
$customId = CoreConfigModel::getCustomId();
if (empty($customId)) {
return $response->withStatus(400)->withJson(['errors' => 'A custom is needed for this operation']);
......@@ -144,7 +144,7 @@ class ParameterController
} elseif ($args['id'] == 'applicationName') {
$config = CoreConfigModel::getJsonLoaded(['path' => 'apps/maarch_entreprise/xml/config.json']);
$config['config']['applicationName'] = $body['applicationName'];
$fp = fopen("custom/{$body['customId']}/apps/maarch_entreprise/xml/config.json", 'w');
$fp = fopen("custom/{$customId}/apps/maarch_entreprise/xml/config.json", 'w');
fwrite($fp, json_encode($config, JSON_PRETTY_PRINT));
fclose($fp);
}
......
......@@ -2,7 +2,7 @@
<div class="col-md-6">
<mat-form-field appearance="outline">
<mat-label>{{'lang.applicationName' | translate}}</mat-label>
<input matInput formControlName="appName">
<input matInput formControlName="applicationName">
</mat-form-field>
<div>{{'lang.loginMsg' | translate}} : </div>
<textarea style="padding-top: 10px;" name="loginpage_message" id="loginpage_message"
......@@ -52,4 +52,4 @@
</mat-card>
</div>
</div>
</form>
\ No newline at end of file
</form>
......@@ -33,7 +33,7 @@ export class ParametersCustomizationComponent implements OnInit, OnDestroy {
const valIdentifier: ValidatorFn[] = [Validators.pattern(/^[a-zA-Z0-9_\-]*$/), Validators.required];
this.stepFormGroup = this._formBuilder.group({
appName: ['', Validators.required],
applicationName: ['', Validators.required],
loginpage_message: [''],
homepage_message: [''],
bodyImage: ['../rest/images?image=loginPage'],
......@@ -61,12 +61,12 @@ export class ParametersCustomizationComponent implements OnInit, OnDestroy {
}),
exhaustMap(() => this.http.get('../rest/authenticationInformations')),
tap((data: any) => {
this.stepFormGroup.controls['appName'].setValue(data.applicationName);
this.stepFormGroup.controls['applicationName'].setValue(data.applicationName);
setTimeout(() => {
this.stepFormGroup.controls['appName'].valueChanges.pipe(
this.stepFormGroup.controls['applicationName'].valueChanges.pipe(
debounceTime(500),
tap(() => this.saveParameter('appName'))
tap(() => this.saveParameter('applicationName'))
).subscribe();
......@@ -198,6 +198,8 @@ export class ParametersCustomizationComponent implements OnInit, OnDestroy {
let param = {};
if (parameterId === 'logo' || parameterId === 'bodyImage') {
param['image'] = this.stepFormGroup.controls[parameterId].value;
} else if (parameterId === 'applicationName') {
param['applicationName'] = this.stepFormGroup.controls[parameterId].value;
} else {
param = {
param_value_string: this.stepFormGroup.controls[parameterId].value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment