Skip to content

Commit 21b7a23

Browse files
committed
Merge branch 'master' into angular-upgrade
2 parents 7994051 + 2d192d4 commit 21b7a23

File tree

7 files changed

+211
-51
lines changed

7 files changed

+211
-51
lines changed

src/app/data.service.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,12 +597,26 @@ export class DataService {
597597
}
598598

599599
/** Return true if the current user can view the max content of the event and push email */
600-
canViewMaxContent(): boolean {
600+
canViewMaxContent(event: IEvent): boolean {
601+
if (
602+
!this._loggedIn ||
603+
!event ||
604+
!event.verification_bodies_id ||
605+
!event.verification_bodies_id.length
606+
)
607+
return false;
608+
609+
const verificationBodyId = event.verification_bodies_id[0];
610+
601611
for (const role of this._currentUser.roles) {
602-
if (role.permissions.includes("VerE")) {
612+
if (
613+
role.permissions.includes("VerE") &&
614+
role.bodies.some((body) => body.id === verificationBodyId)
615+
) {
603616
return true;
604617
}
605618
}
619+
return false;
606620
}
607621

608622
/** Mark a UNR for the current user */

src/app/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export module Helpers {
170170
/* Init times */
171171
event.start_time = new Date(event.start_time.toString());
172172
event.end_time = new Date(event.end_time.toString());
173-
173+
event.venue_room = event.venue_room || '';
174174
/* Check for ongoing/ended events */
175175
let subtitleTime = GetDate(event.start_time);
176176
const now = new Date();
@@ -183,7 +183,7 @@ export module Helpers {
183183
}
184184

185185
/* Get the subtitle */
186-
return subtitleTime + (event.venues.length > 0 ? ' | ' + event.venues_str : '');
186+
return subtitleTime + (event.venue_room.length > 0 ? ' | ' + event.venue_room : '')+ (event.venues.length > 0 ? ' | ' + event.venues_str : '');
187187
}
188188
return '';
189189
}

src/app/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export interface IEvent {
4646
venues: ILocation[];
4747
venue_names: string[];
4848
venues_str: string;
49+
venue_room: string;
4950
bodies: IBody[];
5051
verification_bodies: IBody[];
5152
verification_bodies_id: string[];

src/app/page/add-event/add-event.component.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@
8787
float: right;
8888
}
8989

90+
.venue-dropdown-panel {
91+
max-height: 250px !important;
92+
overflow-y: auto !important;
93+
}
94+
9095
@media (max-width: 1200px) {
9196
.full-width-details {
9297
left: 1%;

src/app/page/add-event/add-event.component.html

Lines changed: 52 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -93,32 +93,47 @@
9393
</mat-form-field>
9494
</div>
9595

96-
<div *ngFor="let vn of event.venues; let i = index">
97-
<mat-form-field class="full-width-details venue">
98-
<input
99-
matInput
100-
placeholder="Venue"
101-
aria-label="Venue"
102-
[matAutocomplete]="venueAuto"
103-
[formControl]="venueControls[i].form"
104-
/>
96+
<div>
97+
<!-- <mat-form-field class="full-width-details venue">
98+
<input matInput placeholder="Venue" aria-label="Venue" [matAutocomplete]="venueAuto"
99+
[formControl]="venueControls[0].form">
105100
</mat-form-field>
106101
107102
<mat-autocomplete #venueAuto="matAutocomplete">
108-
<mat-option
109-
*ngFor="let venue of venueControls[i].filteredLocations | async"
110-
[value]="venue.short_name"
111-
>
103+
<mat-option *ngFor="let venue of venueControls[0].filteredLocations | async" [value]="venue.short_name">
112104
{{ venue.short_name }}
113105
</mat-option>
114-
</mat-autocomplete>
106+
</mat-autocomplete> -->
107+
108+
<mat-form-field class="full-width-details venue">
109+
<mat-select
110+
placeholder="Venue / Building"
111+
[(ngModel)]="event.venues[0].short_name"
112+
required
113+
panelClass="venue-dropdown-panel"
114+
>
115+
<mat-option
116+
*ngFor="let location of predefinedLocations"
117+
[value]="location"
118+
>
119+
{{ location }}
120+
</mat-option>
121+
</mat-select>
122+
</mat-form-field>
115123

116-
<button *ngIf="i == 0" (click)="AddVenue()" mat-icon-button>
124+
<mat-form-field class="full-width-details">
125+
<input
126+
matInput
127+
placeholder="Specific Location / Room (optional)"
128+
[(ngModel)]="event.venue_room"
129+
/>
130+
</mat-form-field>
131+
<!-- <button *ngIf="i==0" (click)="AddVenue()" mat-icon-button>
117132
<mat-icon>add</mat-icon>
118133
</button>
119134
<button *ngIf="i !== 0" (click)="RemoveVenue(i)" mat-icon-button>
120135
<mat-icon>remove</mat-icon>
121-
</button>
136+
</button> -->
122137
</div>
123138

124139
<div>
@@ -146,9 +161,9 @@
146161
<div>
147162
<mat-form-field class="full-width-details">
148163
<mat-select
149-
[(ngModel)]="event.verification_bodies_id"
164+
[(ngModel)]="event.verification_bodies_id[0]"
150165
placeholder="Verification Bodies"
151-
multiple
166+
required
152167
>
153168
<mat-option
154169
*ngFor="let verification_body of verification_bodies"
@@ -167,14 +182,9 @@
167182
</mat-form-field>
168183
</div>
169184

170-
<div class="full-width-details">
171-
<app-search-box
172-
exploreProp="interests"
173-
displayProp="title"
174-
placeholder="Notify according to interests"
175-
hint="Enter a Interest"
176-
(change)="setInterest($event)"
177-
>
185+
<!-- <div class="full-width-details">
186+
<app-search-box exploreProp="interests" displayProp="title" placeholder="Notify according to interests"
187+
hint="Enter a Interest" (change)="setInterest($event)">
178188
</app-search-box>
179189
180190
<app-interest-card
@@ -184,7 +194,8 @@
184194
[deleteMethod]="deleteInterestFunc"
185195
>
186196
</app-interest-card>
187-
</div>
197+
198+
</div> -->
188199

189200
<div>
190201
<mat-form-field class="full-width-details">
@@ -214,24 +225,24 @@
214225
<textarea
215226
matInput
216227
placeholder="Email Content / InstiApp Description"
217-
[(ngModel)]="event.longdescription"
228+
[(ngModel)]="event.description"
218229
(ngModelChange)="event.description = $event"
219230
rows="8"
220231
></textarea>
221232
</mat-form-field>
222233
</div>
223234

224-
<div class="audience-panel" *ngIf="tagCategoryList">
235+
<!-- <div class="audience-panel" *ngIf="tagCategoryList">
225236
<div class="full-width-details">
226237
<div class="label tag-category">
227238
Offered Achievements
228-
<button mat-button class="has float-right" (click)="addOffer()">
229-
Add
230-
</button>
231-
<div class="sub">Make your event stand out</div>
232-
</div>
239+
<button mat-button class="has float-right" (click)="addOffer()">Add</button>
240+
<div class="sub">
241+
Make your event stand out
242+
</div>
243+
</div> -->
233244

234-
<mat-accordion>
245+
<!-- <mat-accordion>
235246
<mat-expansion-panel *ngFor="let offer of offeredAchievements">
236247
<mat-expansion-panel-header>
237248
<mat-panel-title>
@@ -266,9 +277,9 @@
266277
</mat-expansion-panel>
267278
</mat-accordion>
268279
</div>
269-
</div>
280+
</div> -->
270281

271-
<div class="audience-panel" *ngIf="tagCategoryList">
282+
<!-- <div class="audience-panel" *ngIf="tagCategoryList">
272283
<div class="full-width-details">
273284
<div class="label">
274285
Restricted Audience
@@ -320,15 +331,15 @@
320331
</mat-expansion-panel>
321332
</mat-accordion>
322333
</div>
323-
</div>
324-
334+
</div> -->
335+
<!--
325336
<div>
326337
<div class="full-width-details switch">
327338
<mat-slide-toggle [(ngModel)]="event.notify">
328339
Notify followers on creation/updation
329340
</mat-slide-toggle>
330341
</div>
331-
</div>
342+
</div> -->
332343

333344
<div>
334345
<button
@@ -367,6 +378,6 @@
367378
is supported
368379
</div>
369380
<markdown class="markdown" [data]="event.email_subject"></markdown>
370-
<markdown class="markdown" [data]="event.longdescription"></markdown>
381+
<markdown class="markdown" [data]="event.description"></markdown>
371382
</div>
372383
</app-desktop-split>

0 commit comments

Comments
 (0)