Skip to content

Commit 4002659

Browse files
xflordJohaney-s
authored andcommitted
feat(admin): option to specify language of the email sent when creating sponsored members
* added select bar to select language of email when creating sponsored members (or generating via csv) * update openapi
1 parent cd42c32 commit 4002659

30 files changed

+378
-14
lines changed

apps/admin-gui/src/app/shared/components/dialogs/create-sponsored-member-dialog/create-sponsored-member-dialog.component.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,14 @@ <h5 class="mt-2">{{'DIALOGS.CREATE_SPONSORED_MEMBER.NAMESPACE_TITLE' | translate
124124
>{{'DIALOGS.CREATE_SPONSORED_MEMBER.PASSWORD_RESET' | translate}}
125125
</mat-checkbox>
126126
</span>
127+
<mat-form-field *ngIf="namespaceControl.get('passwordReset').value">
128+
<mat-label>{{'DIALOGS.INVITE_MEMBER.LANGUAGE' | translate}}</mat-label>
129+
<mat-select [(value)]="currentLanguage">
130+
<mat-option *ngFor="let lang of languages" value="{{lang}}">
131+
{{'SHARED_LIB.LANGUAGES.'+lang | uppercase | translate}}
132+
</mat-option>
133+
</mat-select>
134+
</mat-form-field>
127135

128136
<perun-web-apps-password-form
129137
[formGroup]="namespaceControl"

apps/admin-gui/src/app/shared/components/dialogs/create-sponsored-member-dialog/create-sponsored-member-dialog.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export class CreateSponsoredMemberDialogComponent implements OnInit {
5252
namespaceControl: UntypedFormGroup = null;
5353
selectedSponsor: User = null;
5454
sponsorType = 'self';
55+
languages = ['en'];
56+
currentLanguage = 'en';
5557

5658
finishedWithErrors = false;
5759
submitAllowed = false;
@@ -135,6 +137,7 @@ export class CreateSponsoredMemberDialogComponent implements OnInit {
135137
if (rules.password !== 'disabled') {
136138
sponsoredMember.sendActivationLink = this.namespaceControl.get('passwordReset')
137139
.value as boolean;
140+
sponsoredMember.language = this.currentLanguage;
138141
sponsoredMember.userData.password = this.namespaceControl.get('passwordCtrl').value as string;
139142
}
140143

@@ -270,6 +273,8 @@ export class CreateSponsoredMemberDialogComponent implements OnInit {
270273
titleAfter: [''],
271274
});
272275

276+
this.languages = this.store.getProperty('supported_languages');
277+
273278
this.namespaceControl = this.formBuilder.group(
274279
{
275280
namespace: ['', Validators.required],

apps/admin-gui/src/app/shared/components/dialogs/generate-sponsored-members-dialog/generate-sponsored-members-dialog.component.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ <h5 class="mb-4">
8989
{{'DIALOGS.GENERATE_SPONSORED_MEMBERS.PASSWORD_RESET' | translate}}
9090
</mat-radio-button>
9191
</mat-radio-group>
92+
<mat-form-field class="w-100" *ngIf="passwordReset === 'reset'">
93+
<mat-label>{{'DIALOGS.INVITE_MEMBER.LANGUAGE' | translate}}</mat-label>
94+
<mat-select [(value)]="currentLanguage">
95+
<mat-option *ngFor="let lang of languages" value="{{lang}}">
96+
{{'SHARED_LIB.LANGUAGES.'+lang | uppercase | translate}}
97+
</mat-option>
98+
</mat-select>
99+
</mat-form-field>
92100
</div>
93101
</mat-step>
94102
<mat-step>

apps/admin-gui/src/app/shared/components/dialogs/generate-sponsored-members-dialog/generate-sponsored-members-dialog.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ export class GenerateSponsoredMembersDialogComponent implements OnInit {
6868
submitAllowed = false;
6969

7070
groupsToAssign: Subject<void> = new Subject<void>();
71+
languages = ['en'];
72+
currentLanguage = 'en';
7173

7274
private namespaceRules: NamespaceRules[] = [];
7375
private resultData: MemberData[] = [];
@@ -99,6 +101,7 @@ export class GenerateSponsoredMembersDialogComponent implements OnInit {
99101
ngOnInit(): void {
100102
this.loading = true;
101103
this.theme = this.data.theme;
104+
this.languages = this.store.getProperty('supported_languages');
102105
this.usersInfoFormGroup = this.formBuilder.group({
103106
namespace: ['', Validators.required],
104107
sponsoredMembers: ['', [Validators.required, this.userInputValidator()]],
@@ -224,6 +227,7 @@ export class GenerateSponsoredMembersDialogComponent implements OnInit {
224227
sponsor: this.store.getPerunPrincipal().userId,
225228
vo: this.data.voId,
226229
sendActivationLinks: this.passwordReset === 'reset',
230+
language: this.currentLanguage,
227231
};
228232

229233
if (groupIds.length > 0) {

libs/perun/openapi/src/lib/.openapi-generator/FILES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ api/consentsManager.service.ts
1010
api/databaseManager.service.ts
1111
api/extSourcesManager.service.ts
1212
api/facilitiesManager.service.ts
13-
api/facilitiesManagerByFacilityName.service.ts
1413
api/groupsManager.service.ts
1514
api/integrationManager.service.ts
1615
api/membersManager.service.ts

libs/perun/openapi/src/lib/api.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { ConsentsManagerService } from './api/consentsManager.service';
1010
import { DatabaseManagerService } from './api/databaseManager.service';
1111
import { ExtSourcesManagerService } from './api/extSourcesManager.service';
1212
import { FacilitiesManagerService } from './api/facilitiesManager.service';
13-
import { FacilitiesManagerByFacilityNameService } from './api/facilitiesManagerByFacilityName.service';
1413
import { GroupsManagerService } from './api/groupsManager.service';
1514
import { IntegrationManagerService } from './api/integrationManager.service';
1615
import { MembersManagerService } from './api/membersManager.service';

libs/perun/openapi/src/lib/api/api.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ export * from './extSourcesManager.service';
1414
import { ExtSourcesManagerService } from './extSourcesManager.service';
1515
export * from './facilitiesManager.service';
1616
import { FacilitiesManagerService } from './facilitiesManager.service';
17-
export * from './facilitiesManagerByFacilityName.service';
18-
import { FacilitiesManagerByFacilityNameService } from './facilitiesManagerByFacilityName.service';
1917
export * from './groupsManager.service';
2018
import { GroupsManagerService } from './groupsManager.service';
2119
export * from './integrationManager.service';
@@ -51,7 +49,6 @@ export const APIS = [
5149
DatabaseManagerService,
5250
ExtSourcesManagerService,
5351
FacilitiesManagerService,
54-
FacilitiesManagerByFacilityNameService,
5552
GroupsManagerService,
5653
IntegrationManagerService,
5754
MembersManagerService,

0 commit comments

Comments
 (0)