diff --git a/client/src/app/core/repositories/users/user-repository.service.ts b/client/src/app/core/repositories/users/user-repository.service.ts index f647bca4a..67ecc2f8b 100644 --- a/client/src/app/core/repositories/users/user-repository.service.ts +++ b/client/src/app/core/repositories/users/user-repository.service.ts @@ -389,7 +389,7 @@ export class UserRepositoryService extends BaseRepository = {}; if (schema === 'lastCommaFirst') { const commaSeparated = inputUser.split(','); @@ -404,7 +404,7 @@ export class UserRepositoryService extends BaseRepository +
@@ -18,6 +23,11 @@
+ + + {{ noneTitle | translate }} diff --git a/client/src/app/shared/components/search-value-selector/search-value-selector.component.scss b/client/src/app/shared/components/search-value-selector/search-value-selector.component.scss index a66882f9c..d5e6a30bd 100644 --- a/client/src/app/shared/components/search-value-selector/search-value-selector.component.scss +++ b/client/src/app/shared/components/search-value-selector/search-value-selector.component.scss @@ -19,3 +19,12 @@ background: white; min-height: 39px; } + +.os-not-found-button { + font-size: 16px; + min-height: 48px; + font-weight: 400; + width: 100%; + display: block; + text-align: left; +} diff --git a/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts b/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts index 1bfeb8895..2197446af 100644 --- a/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts +++ b/client/src/app/shared/components/search-value-selector/search-value-selector.component.ts @@ -3,8 +3,10 @@ import { ChangeDetectionStrategy, Component, ElementRef, + EventEmitter, Input, Optional, + Output, Self, ViewChild, ViewEncapsulation @@ -73,6 +75,12 @@ export class SearchValueSelectorComponent extends BaseFormControlComponent(); + public searchValue: FormControl; public get empty(): boolean { @@ -147,6 +161,8 @@ export class SearchValueSelectorComponent extends BaseFormControlComponent -1; }); + } else { + return []; } } @@ -165,6 +181,14 @@ export class SearchValueSelectorComponent extends BaseFormControlComponent + [showNotFoundButton]="true" + (clickNotFound)="onCreateUser($event)" + > + + add + {{ 'Create user' | translate }} + + diff --git a/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts b/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts index 8e5060395..a00961eb2 100644 --- a/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts +++ b/client/src/app/site/agenda/components/list-of-speakers/list-of-speakers.component.ts @@ -470,6 +470,16 @@ export class ListOfSpeakersComponent extends BaseViewComponent implements OnInit return `${this.durationService.durationToString(duration, 'm')}`; } + /** + * Imports a new user by the given username. + * + * @param username The name of the new user. + */ + public onCreateUser(username: string): void { + this.userRepository.createFromString(username).then(result => { + this.addNewSpeaker(result.id); + }); + } /** * Triggers an update of the filter for the list of available potential speakers * (triggered on an update of users or config)