File tree 4 files changed +2
-29
lines changed
4 files changed +2
-29
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ export class M extends MD { // = Messages Dictionary. For reasons of brevity of
29
29
public static SETTINGS_SUCCESS = 'settings.success' ;
30
30
public static SETTINGS_ERROR_MALFORMED_ADDRESS = 'settings.error.malformedAddress' ;
31
31
public static SETTINGS_ERROR_MISSING_USERNAME = 'settings.error.missingUsername' ;
32
- public static SETTINGS_ERROR_INVALID_USERNAME = 'settings.error.invalidUsername' ;
33
32
34
33
// Projects Package
35
34
public static PROJECTS_DELETE_SUCCESS = 'projects.deleteSuccess' ;
@@ -323,16 +322,7 @@ export class M extends MD { // = Messages Dictionary. For reasons of brevity of
323
322
this . msgs [ M . SETTINGS_ERROR_MISSING_USERNAME ] = {
324
323
content : i18n ( {
325
324
id : 'messages.settings.error.missingUsername' ,
326
- value : 'Bitte geben Sie Ihren Vor- und Nachnamen im Feld "Name des Bearbeiters/der Bearbeiterin" ein.'
327
- } ) ,
328
- level : 'danger' ,
329
- params : [ ] ,
330
- hidden : false
331
- } ;
332
- this . msgs [ M . SETTINGS_ERROR_INVALID_USERNAME ] = {
333
- content : i18n ( {
334
- id : 'messages.settings.error.invalidUsername' ,
335
- value : 'Bitte geben Sie Ihren Vor- und Nachnamen ein.'
325
+ value : 'Bitte geben Sie Ihren Namen im Feld "Name des Bearbeiters/der Bearbeiterin" ein.'
336
326
} ) ,
337
327
level : 'danger' ,
338
328
params : [ ] ,
Original file line number Diff line number Diff line change @@ -52,10 +52,6 @@ export class UpdateUsernameModalComponent {
52
52
53
53
if ( ! this . isUsernameSet ( ) ) return ;
54
54
55
- if ( ! Settings . validateUsername ( this . username ) ) {
56
- return this . messages . add ( [ M . SETTINGS_ERROR_INVALID_USERNAME ] ) ;
57
- }
58
-
59
55
const settings : Settings = this . settingsProvider . getSettings ( ) ;
60
56
settings . username = this . username ;
61
57
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export class SettingsService {
73
73
*/
74
74
public async updateSettings ( newSettings : Settings , validate : validationMode = 'none' ) : Promise < Settings > {
75
75
76
- if ( validate === 'settings' && ! SettingsService . validateUsername ( newSettings ) ) {
76
+ if ( validate === 'settings' && ! Settings . hasUsername ( newSettings ) ) {
77
77
throw SettingsErrors . MISSING_USERNAME ;
78
78
}
79
79
@@ -312,11 +312,4 @@ export class SettingsService {
312
312
? true
313
313
: validateUrl ( address ) ;
314
314
}
315
-
316
-
317
- private static validateUsername ( settings : Settings ) : boolean {
318
-
319
- return Settings . hasUsername ( settings )
320
- && Settings . validateUsername ( settings . username ) ;
321
- }
322
315
}
Original file line number Diff line number Diff line change @@ -51,10 +51,4 @@ export module Settings {
51
51
&& username . trim ( ) . length > 0
52
52
&& username !== 'anonymous' ;
53
53
}
54
-
55
-
56
- export function validateUsername ( username : string ) : boolean {
57
-
58
- return username . trim ( ) . split ( ' ' ) . length > 1 ;
59
- }
60
54
}
You can’t perform that action at this time.
0 commit comments