1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-01-12 04:23:09 +02:00

fixing settings saving bug

This commit is contained in:
Patrik J. Braun 2020-02-06 22:46:45 +01:00
parent 854bedc968
commit 5908bed64f
6 changed files with 9 additions and 10 deletions

6
package-lock.json generated
View File

@ -18721,9 +18721,9 @@
}
},
"typeconfig": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/typeconfig/-/typeconfig-2.0.6.tgz",
"integrity": "sha512-OnXPXSDaK1mzH6dJ1HB9Q70ruJYngEhemwL9Y8+nG5E40Je4MMODuEY+tfjMtIiFIN772DU5Q+NebulLZNDjpw==",
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/typeconfig/-/typeconfig-2.0.7.tgz",
"integrity": "sha512-aShKfhwvPQFnMwBBFWsJhl1QQmDsdkx/vs7aKgxbGnLMW7W2djucEPGlUsmK3isMrTJAErmsr5CElacO/YFA6A==",
"requires": {
"optimist": "0.6.1"
}

View File

@ -48,7 +48,7 @@
"sqlite3": "4.1.1",
"ts-exif-parser": "0.1.4",
"ts-node-iptc": "1.0.11",
"typeconfig": "2.0.6",
"typeconfig": "2.0.7",
"typeorm": "0.2.21",
"winston": "2.4.4"
},

View File

@ -11,6 +11,7 @@ import {ConfigProperty, IConfigClass} from 'typeconfig/common';
saveIfNotExist: true,
attachDescription: true,
enumsAsString: true,
softReadonly: true,
cli: {
enable: {
configPath: true,

View File

@ -6,7 +6,7 @@ import {WebConfigClass} from 'typeconfig/web';
import {ConfigProperty, ConfigState} from 'typeconfig/common';
@WebConfigClass()
@WebConfigClass({softReadonly: true})
export class WebConfig {
@ConfigState()
State: any;

View File

@ -99,7 +99,7 @@ export class SettingsEntryComponent implements ControlValueAccessor, Validator,
(this.state.arrayType === 'string' || this.isNumberArray)) {
value = value.replace(new RegExp(',', 'g'), ';');
value = value.replace(new RegExp(' ', 'g'), ';');
this.state.value = value.split(';');
this.state.value = value.split(';').filter((v: string) => v !== '');
if (this.isNumberArray) {
this.state.value = this.state.value.map((v: string) => parseFloat(v)).filter((v: number) => !isNaN(v));
}

View File

@ -37,8 +37,7 @@
name="Exclude Folder List"
i18n-name
placeholder="/media/images/family/private;private;family/private"
[ngModel]="states.excludeFolderList"
required="true">
[ngModel]="states.excludeFolderList">
<small class="form-text text-muted">
<ng-container i18n>Folders to exclude from indexing</ng-container>
<br/>
@ -54,8 +53,7 @@
name="Exclude File List"
i18n-name
placeholder=".ignore;.pg2ignore"
[ngModel]="states.excludeFileList"
required="true">
[ngModel]="states.excludeFileList">
<small class="form-text text-muted">
<ng-container i18n>Files that mark a folder to be excluded from indexing</ng-container>
<br/>