Skip to content

Commit 2d192d4

Browse files
committed
event related changes
1 parent a6e1f5e commit 2d192d4

File tree

8 files changed

+201
-33
lines changed

8 files changed

+201
-33
lines changed

package-lock.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/data.service.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,13 +596,25 @@ export class DataService {
596596
}
597597

598598
/** Return true if the current user can view the max content of the event and push email */
599-
canViewMaxContent(): boolean {
599+
canViewMaxContent(event: IEvent): boolean {
600+
if (
601+
!this._loggedIn ||
602+
!event ||
603+
!event.verification_bodies_id ||
604+
!event.verification_bodies_id.length
605+
) return false;
606+
607+
const verificationBodyId = event.verification_bodies_id[0];
608+
600609
for (const role of this._currentUser.roles) {
601-
if (role.permissions.includes("VerE")) {
610+
if (
611+
role.permissions.includes("VerE") &&
612+
role.bodies.some(body => body.id === verificationBodyId)
613+
) {
602614
return true;
603615
}
604616
}
605-
617+
return false;
606618
}
607619

608620
/** 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: 38 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,42 @@
4444
</mat-form-field>
4545
</div>
4646

47-
<div *ngFor="let vn of event.venues; let i = index">
48-
<mat-form-field class="full-width-details venue">
47+
<div>
48+
<!-- <mat-form-field class="full-width-details venue">
4949
<input matInput placeholder="Venue" aria-label="Venue" [matAutocomplete]="venueAuto"
50-
[formControl]="venueControls[i].form">
50+
[formControl]="venueControls[0].form">
5151
</mat-form-field>
5252
5353
<mat-autocomplete #venueAuto="matAutocomplete">
54-
<mat-option *ngFor="let venue of venueControls[i].filteredLocations | async" [value]="venue.short_name">
54+
<mat-option *ngFor="let venue of venueControls[0].filteredLocations | async" [value]="venue.short_name">
5555
{{ venue.short_name }}
5656
</mat-option>
57-
</mat-autocomplete>
57+
</mat-autocomplete> -->
5858

59-
<button *ngIf="i==0" (click)="AddVenue()" mat-icon-button>
59+
<mat-form-field class="full-width-details venue">
60+
<mat-select
61+
placeholder="Venue / Building"
62+
[(ngModel)]="event.venues[0].short_name"
63+
required
64+
panelClass="venue-dropdown-panel">
65+
<mat-option *ngFor="let location of predefinedLocations" [value]="location">
66+
{{ location }}
67+
</mat-option>
68+
</mat-select>
69+
</mat-form-field>
70+
71+
<mat-form-field class="full-width-details">
72+
<input
73+
matInput
74+
placeholder="Specific Location / Room (optional)"
75+
[(ngModel)]="event.venue_room">
76+
</mat-form-field>
77+
<!-- <button *ngIf="i==0" (click)="AddVenue()" mat-icon-button>
6078
<mat-icon>add</mat-icon>
6179
</button>
6280
<button *ngIf="i!=0" (click)="RemoveVenue(i)" mat-icon-button>
6381
<mat-icon>remove</mat-icon>
64-
</button>
82+
</button> -->
6583
</div>
6684

6785
<div>
@@ -79,7 +97,7 @@
7997

8098
<div>
8199
<mat-form-field class="full-width-details">
82-
<mat-select [(ngModel)]="event.verification_bodies_id" placeholder="Verification Bodies" multiple>
100+
<mat-select [(ngModel)]="event.verification_bodies_id[0]" placeholder="Verification Bodies" required>
83101
<mat-option *ngFor="let verification_body of verification_bodies" [value]="verification_body.id">
84102
{{ verification_body.name }}
85103
</mat-option>
@@ -90,7 +108,7 @@
90108
</mat-form-field>
91109
</div>
92110

93-
<div class="full-width-details">
111+
<!-- <div class="full-width-details">
94112
<app-search-box exploreProp="interests" displayProp="title" placeholder="Notify according to interests"
95113
hint="Enter a Interest" (change)="setInterest($event)">
96114
</app-search-box>
@@ -100,7 +118,7 @@
100118
101119
</app-interest-card>
102120
103-
</div>
121+
</div> -->
104122

105123
<div>
106124
<mat-form-field class="full-width-details">
@@ -117,21 +135,21 @@
117135

118136
<div>
119137
<mat-form-field class="full-width-details">
120-
<textarea matInput placeholder="Email Content / InstiApp Description" [(ngModel)]="event.longdescription" (ngModelChange)="event.description = $event" rows=8></textarea>
138+
<textarea matInput placeholder="Email Content / InstiApp Description" [(ngModel)]="event.description" (ngModelChange)="event.description = $event" rows=8></textarea>
121139
</mat-form-field>
122140
</div>
123141

124-
<div class="audience-panel" *ngIf="tagCategoryList">
142+
<!-- <div class="audience-panel" *ngIf="tagCategoryList">
125143
<div class="full-width-details">
126144
<div class="label tag-category">
127145
Offered Achievements
128146
<button mat-button class="has float-right" (click)="addOffer()">Add</button>
129147
<div class="sub">
130148
Make your event stand out
131149
</div>
132-
</div>
150+
</div> -->
133151

134-
<mat-accordion>
152+
<!-- <mat-accordion>
135153
<mat-expansion-panel *ngFor="let offer of offeredAchievements">
136154
<mat-expansion-panel-header>
137155
<mat-panel-title>
@@ -155,9 +173,9 @@
155173
</mat-expansion-panel>
156174
</mat-accordion>
157175
</div>
158-
</div>
176+
</div> -->
159177

160-
<div class="audience-panel" *ngIf="tagCategoryList">
178+
<!-- <div class="audience-panel" *ngIf="tagCategoryList">
161179
<div class="full-width-details">
162180
<div class="label">
163181
Restricted Audience
@@ -195,15 +213,15 @@
195213
</mat-expansion-panel>
196214
</mat-accordion>
197215
</div>
198-
</div>
199-
216+
</div> -->
217+
<!--
200218
<div>
201219
<div class="full-width-details switch">
202220
<mat-slide-toggle [(ngModel)]="event.notify">
203221
Notify followers on creation/updation
204222
</mat-slide-toggle>
205223
</div>
206-
</div>
224+
</div> -->
207225

208226

209227

@@ -229,7 +247,7 @@
229247
target="_blank">Markdown</a> is supported
230248
</div>
231249
<markdown class="markdown" [data]="event.email_subject"></markdown>
232-
<markdown class="markdown" [data]="event.longdescription"></markdown>
250+
<markdown class="markdown" [data]="event.description"></markdown>
233251
</div>
234252

235253
</app-desktop-split>

0 commit comments

Comments
 (0)