@ieeesa-npm/dashboard 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/assets/constants.json +7 -3
- package/esm2022/lib/components/event-group-card/event-group-card.component.mjs +103 -13
- package/esm2022/lib/components/meeting-attendance-row/meeting-attendance-row.component.mjs +101 -23
- package/esm2022/lib/components/upcoming-meetings-events/upcoming-meetings-events.component.mjs +70 -6
- package/esm2022/lib/components/your-groups/your-groups.component.mjs +132 -23
- package/esm2022/lib/dashboard.component.mjs +93 -9
- package/esm2022/lib/models/attendance-state.model.mjs +8 -1
- package/esm2022/lib/models/dashboard-route-config.model.mjs +1 -1
- package/esm2022/lib/models/event-meeting-list-item.model.mjs +1 -1
- package/esm2022/lib/models/event-meeting-list-payload.model.mjs +7 -5
- package/esm2022/lib/models/meeting-row.model.mjs +1 -1
- package/esm2022/lib/models/upcoming-event.model.mjs +1 -1
- package/esm2022/lib/services/dashboard.service.mjs +71 -126
- package/esm2022/lib/services/user-permissions.service.mjs +23 -9
- package/esm2022/lib/utils/event-meeting-mapper.util.mjs +47 -41
- package/fesm2022/ieeesa-npm-dashboard.mjs +657 -306
- package/fesm2022/ieeesa-npm-dashboard.mjs.map +1 -1
- package/lib/components/event-group-card/event-group-card.component.d.ts +75 -6
- package/lib/components/meeting-attendance-row/meeting-attendance-row.component.d.ts +61 -7
- package/lib/components/member-level-badge/member-level-badge.component.d.ts +12 -1
- package/lib/components/upcoming-meetings-events/upcoming-meetings-events.component.d.ts +51 -3
- package/lib/components/your-groups/your-groups.component.d.ts +72 -14
- package/lib/dashboard.component.d.ts +53 -3
- package/lib/models/attendance-state.model.d.ts +8 -1
- package/lib/models/dashboard-route-config.model.d.ts +14 -0
- package/lib/models/event-meeting-list-item.model.d.ts +68 -68
- package/lib/models/event-meeting-list-payload.model.d.ts +14 -25
- package/lib/models/meeting-row.model.d.ts +2 -0
- package/lib/models/upcoming-event.model.d.ts +9 -0
- package/lib/services/dashboard.service.d.ts +25 -53
- package/lib/services/user-permissions.service.d.ts +8 -4
- package/lib/utils/event-meeting-mapper.util.d.ts +15 -21
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
+
import { AttendanceState } from './attendance-state.model';
|
|
1
2
|
/**
|
|
2
|
-
* Raw list item returned by the
|
|
3
|
-
* (`POST {apiBaseUrl}/meetings/eventsAndMeetings`). A single list
|
|
4
|
-
* both EVENT rows (`isMeetingEvent === true
|
|
5
|
-
*
|
|
3
|
+
* Raw combined list item returned by the home events-&-meetings endpoint
|
|
4
|
+
* (`POST {apiBaseUrl}/meetings/home/eventsAndMeetings`). A single list contains
|
|
5
|
+
* both EVENT rows (`isMeetingEvent === true`, which own child meetings) and
|
|
6
|
+
* STANDALONE MEETING rows (`isMeetingEvent === false`).
|
|
6
7
|
*
|
|
7
|
-
* Dates are
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* `view-events-meetings-list` screen.
|
|
8
|
+
* Dates are ISO-8601 strings (e.g. "2026-09-19T09:00:00"). Row-type fields are
|
|
9
|
+
* omitted (NON_NULL) when not applicable:
|
|
10
|
+
* - EVENT rows carry {@link totalMeetingCount} / {@link meetingsOpenForAttendanceCount}; no `attendanceState`.
|
|
11
|
+
* - STANDALONE rows carry {@link attendanceState}; no event counts.
|
|
12
12
|
*/
|
|
13
13
|
export interface EventMeetingListItem {
|
|
14
14
|
/** Stable identifier of the event or standalone meeting. */
|
|
15
15
|
id: string;
|
|
16
16
|
/** Event / meeting display name. */
|
|
17
17
|
name: string;
|
|
18
|
-
/** Start date-time as an ISO-8601 string
|
|
19
|
-
startDateTime: string
|
|
20
|
-
/** End date-time as an ISO-8601 string
|
|
21
|
-
endDateTime: string
|
|
22
|
-
/** IANA
|
|
18
|
+
/** Start date-time as an ISO-8601 string. */
|
|
19
|
+
startDateTime: string;
|
|
20
|
+
/** End date-time as an ISO-8601 string. */
|
|
21
|
+
endDateTime: string;
|
|
22
|
+
/** IANA timezone string, e.g. "Asia/Kolkata". */
|
|
23
23
|
timeZone: string;
|
|
24
24
|
/** Owning group id. */
|
|
25
25
|
groupId?: string;
|
|
@@ -27,81 +27,81 @@ export interface EventMeetingListItem {
|
|
|
27
27
|
groupName?: string;
|
|
28
28
|
/** Owning group acronym, when provided. */
|
|
29
29
|
groupAcronym?: string;
|
|
30
|
-
/** Room / location text, when provided. */
|
|
30
|
+
/** Room / location text, when provided (null for virtual/none). */
|
|
31
31
|
meetingLocation?: string | null;
|
|
32
32
|
/** True when this row is an EVENT that owns child meetings. */
|
|
33
33
|
hasChildren?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*/
|
|
38
|
-
isMeetingEvent?: boolean;
|
|
39
|
-
/** Lifecycle status, e.g. "In Progress", "Upcoming", "Starts Soon". */
|
|
34
|
+
/** True when the row represents an EVENT (vs. a standalone meeting). */
|
|
35
|
+
isMeetingEvent: boolean;
|
|
36
|
+
/** Lifecycle status, e.g. "In Progress", "Upcoming", "Completed". */
|
|
40
37
|
status?: string;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
meetingTitle?: string;
|
|
53
|
-
/** Alternate status key (the list screen copies status here). */
|
|
54
|
-
contentUnderLink?: string;
|
|
55
|
-
/** Alternate location key used by some meeting payloads. */
|
|
56
|
-
room?: string | null;
|
|
57
|
-
/** Count of child meetings for an event, when the backend provides it. */
|
|
58
|
-
meetingCount?: number;
|
|
59
|
-
/** Count of child meetings open for attendance, when provided. */
|
|
60
|
-
openForAttendanceCount?: number;
|
|
61
|
-
/** "Day X of Y" indicator string, when the backend provides it. */
|
|
62
|
-
dayIndicator?: string;
|
|
38
|
+
registeredParticipants?: boolean;
|
|
39
|
+
hasAttendanceRecords?: boolean;
|
|
40
|
+
registrationRequired?: boolean;
|
|
41
|
+
registrationLink?: string | null;
|
|
42
|
+
creditEnabled?: boolean;
|
|
43
|
+
/** EVENT only: total active meetings in the event. */
|
|
44
|
+
totalMeetingCount?: number;
|
|
45
|
+
/** EVENT only: meetings upcoming/in-progress AND attendance-enabled. */
|
|
46
|
+
meetingsOpenForAttendanceCount?: number;
|
|
47
|
+
/** STANDALONE only: the user's attendance state for this meeting. */
|
|
48
|
+
attendanceState?: AttendanceState;
|
|
63
49
|
}
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
/** Body of the home events-&-meetings list response. */
|
|
51
|
+
export interface EventMeetingListBody {
|
|
52
|
+
totalRecords: number;
|
|
53
|
+
eventMeetingList: EventMeetingListItem[];
|
|
54
|
+
}
|
|
55
|
+
/** Response envelope for the home events-&-meetings list endpoint. */
|
|
68
56
|
export interface EventMeetingListResponse {
|
|
69
57
|
status: boolean;
|
|
70
58
|
message?: string;
|
|
71
|
-
body:
|
|
72
|
-
totalRecords: number;
|
|
73
|
-
eventMeetingList: EventMeetingListItem[];
|
|
74
|
-
};
|
|
59
|
+
body: EventMeetingListBody;
|
|
75
60
|
}
|
|
76
61
|
/**
|
|
77
|
-
* Child-meeting
|
|
78
|
-
* (`POST {apiBaseUrl}/meetings/
|
|
79
|
-
*
|
|
62
|
+
* Child-meeting item returned by the per-event drill-down endpoint
|
|
63
|
+
* (`POST {apiBaseUrl}/meetings/home/events/{eventId}/meetings`). Dates are
|
|
64
|
+
* ISO-8601 strings. `location` follows the backend rule (physical location, else
|
|
65
|
+
* "Virtual" when a virtual URL exists, else null).
|
|
80
66
|
*/
|
|
81
67
|
export interface EventMeetingDetailItem {
|
|
82
68
|
meetingId: string;
|
|
83
69
|
meetingTitle: string;
|
|
84
|
-
meetingStDate: string | number;
|
|
85
|
-
meetingEdDate: string | number;
|
|
86
|
-
meetingLocation?: string;
|
|
87
70
|
groupId?: string;
|
|
88
71
|
groupName?: string;
|
|
89
72
|
groupAcronym?: string;
|
|
73
|
+
location?: string | null;
|
|
74
|
+
meetingStDate: string;
|
|
75
|
+
meetingEdDate: string;
|
|
90
76
|
timeZone?: string;
|
|
91
77
|
status?: string;
|
|
92
|
-
|
|
93
|
-
isCurrentlyAttending?: boolean;
|
|
94
|
-
isOpenForAttendance?: boolean;
|
|
78
|
+
attendanceState?: AttendanceState;
|
|
95
79
|
}
|
|
96
|
-
/**
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
80
|
+
/** Body of the per-event drill-down response. */
|
|
81
|
+
export interface EventMeetingDetailBody {
|
|
82
|
+
eventId: string;
|
|
83
|
+
eventName: string;
|
|
84
|
+
status: string;
|
|
85
|
+
/** Current day index for the "Day X of Y" display. */
|
|
86
|
+
currentDay: number;
|
|
87
|
+
/** Total day span for the "Day X of Y" display. */
|
|
88
|
+
totalDays: number;
|
|
89
|
+
startDate: string;
|
|
90
|
+
endDate: string;
|
|
91
|
+
timeZone: string;
|
|
92
|
+
/** All active meetings in the event. */
|
|
93
|
+
totalMeetingCount: number;
|
|
94
|
+
/** Upcoming/in-progress AND attendance-enabled meetings. */
|
|
95
|
+
meetingsOpenForAttendanceCount: number;
|
|
96
|
+
/** Count of the user's tied upcoming meetings for this event (paginator length). */
|
|
97
|
+
totalRecords: number;
|
|
98
|
+
page: number;
|
|
99
|
+
size: number;
|
|
100
|
+
meetings: EventMeetingDetailItem[];
|
|
101
|
+
}
|
|
102
|
+
/** Response envelope for the per-event drill-down endpoint. */
|
|
100
103
|
export interface EventMeetingDetailResponse {
|
|
101
104
|
status: boolean;
|
|
102
105
|
message?: string;
|
|
103
|
-
body:
|
|
104
|
-
totalRecords: number;
|
|
105
|
-
meetings: EventMeetingDetailItem[];
|
|
106
|
-
};
|
|
106
|
+
body: EventMeetingDetailBody;
|
|
107
107
|
}
|
|
@@ -1,40 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Request payloads for the dashboard "events
|
|
3
|
-
*
|
|
4
|
-
* `
|
|
5
|
-
*
|
|
2
|
+
* Request payloads for the dashboard "home" events-&-meetings backend calls.
|
|
3
|
+
*
|
|
4
|
+
* `appId` is taken from the JWT, so it is never sent. `page` / `size` are
|
|
5
|
+
* required; `sortColumn` / `ascendingOrder` / `searchTerm` are optional on the
|
|
6
|
+
* list endpoint (the service always orders by start date asc, then name asc;
|
|
7
|
+
* `searchTerm`, when present, must be at least 3 characters).
|
|
6
8
|
*/
|
|
7
|
-
/**
|
|
8
|
-
export interface EventMeetingFilter {
|
|
9
|
-
/** Lifecycle statuses to include, e.g. ["In Progress", "Upcoming"]. */
|
|
10
|
-
status: string[];
|
|
11
|
-
/** Whether every meeting (regardless of membership) should be returned. */
|
|
12
|
-
isAllMeetingSelected: boolean;
|
|
13
|
-
/** Optional group-id scope. */
|
|
14
|
-
groupIds?: string[];
|
|
15
|
-
}
|
|
16
|
-
/** Payload for `POST {apiBaseUrl}/meetings/eventsAndMeetings` (the section list). */
|
|
9
|
+
/** Payload for `POST {apiBaseUrl}/meetings/home/eventsAndMeetings` (the section list). */
|
|
17
10
|
export interface EventMeetingListPayload {
|
|
18
11
|
payload: {
|
|
19
|
-
/** Null for the top-level list; an event id when scoping to one event. */
|
|
20
|
-
eventId: string | null;
|
|
21
|
-
sortColumn: string;
|
|
22
|
-
ascendingOrder: boolean;
|
|
23
12
|
page: number;
|
|
24
13
|
size: number;
|
|
14
|
+
sortColumn?: string;
|
|
15
|
+
ascendingOrder?: boolean;
|
|
25
16
|
searchTerm?: string | null;
|
|
26
|
-
filter: EventMeetingFilter;
|
|
27
17
|
};
|
|
28
18
|
}
|
|
29
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Payload for `POST {apiBaseUrl}/meetings/home/events/{eventId}/meetings`
|
|
21
|
+
* (per-event drill-down). The `eventId` is in the URL path, not the body; only
|
|
22
|
+
* `page` / `size` are used.
|
|
23
|
+
*/
|
|
30
24
|
export interface EventMeetingDetailPayload {
|
|
31
25
|
payload: {
|
|
32
|
-
eventId: string;
|
|
33
|
-
sortColumn: string;
|
|
34
|
-
ascendingOrder: boolean;
|
|
35
26
|
page: number;
|
|
36
27
|
size: number;
|
|
37
|
-
searchTerm?: string | null;
|
|
38
|
-
filter: EventMeetingFilter;
|
|
39
28
|
};
|
|
40
29
|
}
|
|
@@ -9,6 +9,8 @@ import { AttendanceState } from './attendance-state.model';
|
|
|
9
9
|
*/
|
|
10
10
|
export interface MeetingRow {
|
|
11
11
|
meetingId: string;
|
|
12
|
+
/** Owning event id, used to build the view-meeting navigation URL. */
|
|
13
|
+
eventId?: string;
|
|
12
14
|
meetingName: string;
|
|
13
15
|
groupOrCommittee?: string;
|
|
14
16
|
roomOrLocation?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AttendanceState } from './attendance-state.model';
|
|
1
2
|
import { MeetingRow } from './meeting-row.model';
|
|
2
3
|
/**
|
|
3
4
|
* Discriminates how a row in the "Upcoming Meetings & Events" list is rendered.
|
|
@@ -30,6 +31,12 @@ export interface UpcomingEvent {
|
|
|
30
31
|
status: string;
|
|
31
32
|
dayIndicator?: string;
|
|
32
33
|
meetingCount: number;
|
|
34
|
+
/**
|
|
35
|
+
* Paginator length for the drill-down meeting list — the count of the user's
|
|
36
|
+
* tied upcoming meetings for this event (a subset of {@link meetingCount}).
|
|
37
|
+
* Populated by the drill-down response; defaults to `meetingCount`.
|
|
38
|
+
*/
|
|
39
|
+
meetingPageTotal?: number;
|
|
33
40
|
openForAttendanceCount: number;
|
|
34
41
|
/** Start date-time as an ISO-8601 string (or epoch ms for fixtures). */
|
|
35
42
|
startDateTime?: string | number;
|
|
@@ -46,6 +53,8 @@ export interface UpcomingEvent {
|
|
|
46
53
|
roomOrLocation?: string;
|
|
47
54
|
/** True when the user is a member of the owning group. */
|
|
48
55
|
isMemberOfGroup?: boolean;
|
|
56
|
+
/** STANDALONE only: the user's attendance state for this meeting. */
|
|
57
|
+
attendanceState?: AttendanceState;
|
|
49
58
|
/** The event's child meetings (empty / lazily loaded for EVENT rows). */
|
|
50
59
|
meetings: MeetingRow[];
|
|
51
60
|
}
|
|
@@ -61,75 +61,47 @@ export declare class DashboardService {
|
|
|
61
61
|
*/
|
|
62
62
|
setAppConfig(apiBaseURL: string, userPermissions: UserPermission[]): void;
|
|
63
63
|
/**
|
|
64
|
-
* Loads the user's upcoming events & meetings from the
|
|
65
|
-
* `POST {apiBaseUrl}/meetings/eventsAndMeetings
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
64
|
+
* Loads the user's combined upcoming events & standalone meetings from the
|
|
65
|
+
* backend via `POST {apiBaseUrl}/meetings/home/eventsAndMeetings`. The response
|
|
66
|
+
* (which carries per-event `totalMeetingCount` / `meetingsOpenForAttendanceCount`
|
|
67
|
+
* and per-standalone `attendanceState` directly) is mapped into the dashboard
|
|
68
|
+
* view models (STANDALONE_MEETING rows ordered last), the per-meeting
|
|
69
|
+
* attendance-state map is seeded, and the section advances through
|
|
70
|
+
* LOADING → LOADED/EMPTY on success. `appId` is taken from the JWT, so it is
|
|
71
|
+
* not sent. Follows the shared `pipe(map, catchError(throw))` pattern.
|
|
72
|
+
* @return {Observable<EventMeetingListResponse>} The home events-&-meetings response envelope.
|
|
72
73
|
* @memberof DashboardService
|
|
73
74
|
*/
|
|
74
75
|
loadUpcomingEvents(): Observable<EventMeetingListResponse>;
|
|
75
76
|
/**
|
|
76
|
-
* Lazily loads (and paginates) the child meetings of an EVENT
|
|
77
|
-
* `POST {apiBaseUrl}/meetings/
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* attendance-state map is extended. Each event paginates
|
|
77
|
+
* Lazily loads (and paginates) the child meetings of an EVENT via
|
|
78
|
+
* `POST {apiBaseUrl}/meetings/home/events/{eventId}/meetings` (the drill-down
|
|
79
|
+
* endpoint). The `eventId` is sent in the URL path; only `page` / `size` are
|
|
80
|
+
* used in the body. On success the drill-down body (day indicator, counts,
|
|
81
|
+
* paginator total, and the paged meetings) is merged onto the matching event,
|
|
82
|
+
* and the per-meeting attendance-state map is extended. Each event paginates
|
|
83
|
+
* independently.
|
|
82
84
|
* @param {string} eventId - The event whose meetings to load.
|
|
83
85
|
* @param {number} [page=1] - The one-based page to request.
|
|
84
86
|
* @param {number} [size=EVENT_MEETINGS_PAGE_SIZE] - The page size.
|
|
85
|
-
* @return {Observable<EventMeetingDetailResponse>} The
|
|
87
|
+
* @return {Observable<EventMeetingDetailResponse>} The drill-down response envelope.
|
|
86
88
|
* @memberof DashboardService
|
|
87
89
|
*/
|
|
88
90
|
loadEventMeetings(eventId: string, page?: number, size?: number): Observable<EventMeetingDetailResponse>;
|
|
89
91
|
/**
|
|
90
|
-
* Merges a freshly loaded page
|
|
91
|
-
*
|
|
92
|
-
* `
|
|
93
|
-
* `
|
|
92
|
+
* Merges a freshly loaded drill-down page onto the matching event in the
|
|
93
|
+
* `upcomingEvents` list: the paged `meetings`, the paginator total
|
|
94
|
+
* (`totalRecords` = the user's tied upcoming meetings), the event's full
|
|
95
|
+
* `totalMeetingCount` / `meetingsOpenForAttendanceCount`, and the
|
|
96
|
+
* "Day X of Y" indicator derived from `currentDay` / `totalDays`. Leaves all
|
|
97
|
+
* other events untouched.
|
|
94
98
|
* @param {string} eventId - The event to merge meetings onto.
|
|
95
|
-
* @param {MeetingRow[]} meetings - The mapped
|
|
96
|
-
* @param {
|
|
99
|
+
* @param {MeetingRow[]} meetings - The mapped drill-down meetings for the page.
|
|
100
|
+
* @param {EventMeetingDetailBody | undefined} body - The drill-down response body.
|
|
97
101
|
* @return {void}
|
|
98
102
|
* @memberof DashboardService
|
|
99
103
|
*/
|
|
100
104
|
private mergeEventMeetings;
|
|
101
|
-
/**
|
|
102
|
-
* Eagerly fetches each EVENT's total meeting count and open-for-attendance
|
|
103
|
-
* count by requesting a large first page of its child meetings, then merging
|
|
104
|
-
* only the counts (not the rows) so the collapsed card summaries are accurate
|
|
105
|
-
* before the user expands. Standalone meetings are skipped. Failures per event
|
|
106
|
-
* are swallowed so one failing count never breaks the list.
|
|
107
|
-
* @param {UpcomingEvent[]} events - The loaded events to fetch counts for.
|
|
108
|
-
* @return {void}
|
|
109
|
-
* @memberof DashboardService
|
|
110
|
-
*/
|
|
111
|
-
private loadEventCounts;
|
|
112
|
-
/**
|
|
113
|
-
* Merges only the meeting counts onto the matching event, leaving its
|
|
114
|
-
* `meetings` rows untouched (used by the eager count prefetch).
|
|
115
|
-
* @param {string} eventId - The event to update.
|
|
116
|
-
* @param {number} totalRecords - The event's total meeting count.
|
|
117
|
-
* @param {number} openForAttendanceCount - The open-for-attendance count.
|
|
118
|
-
* @return {void}
|
|
119
|
-
* @memberof DashboardService
|
|
120
|
-
*/
|
|
121
|
-
private mergeEventCounts;
|
|
122
|
-
/**
|
|
123
|
-
* Builds and posts the `meetingsDetails` request for a single event page,
|
|
124
|
-
* returning the raw response envelope. Shared by {@link loadEventMeetings} and
|
|
125
|
-
* the eager count prefetch.
|
|
126
|
-
* @param {string} eventId - The event whose meetings to fetch.
|
|
127
|
-
* @param {number} page - The one-based page to request.
|
|
128
|
-
* @param {number} size - The page size.
|
|
129
|
-
* @return {Observable<EventMeetingDetailResponse>} The child-meetings response.
|
|
130
|
-
* @memberof DashboardService
|
|
131
|
-
*/
|
|
132
|
-
private fetchEventMeetingsPage;
|
|
133
105
|
/**
|
|
134
106
|
* Loads the user's groups, driving the groups section through
|
|
135
107
|
* LOADING → LOADED/EMPTY on success and leaving the caller to set ERROR on
|
|
@@ -2,9 +2,10 @@ import { UserPermission } from '@ieeesa-npm/models';
|
|
|
2
2
|
import { AttendanceActionPermissions } from '../models/attendance-action-permissions.model';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
/**
|
|
5
|
-
* Permission
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Permission display names that gate the dashboard attendance actions. These
|
|
6
|
+
* match the local demo mock. The real backend grants attendance capability via
|
|
7
|
+
* a permission id (see {@link ATTENDANCE_PERMISSION_IDS}) rather than these
|
|
8
|
+
* display names, so both are accepted.
|
|
8
9
|
*/
|
|
9
10
|
export declare enum DashboardPermissionType {
|
|
10
11
|
LOG_ATTENDANCE = "Log Attendance",
|
|
@@ -12,7 +13,10 @@ export declare enum DashboardPermissionType {
|
|
|
12
13
|
}
|
|
13
14
|
export declare class UserPermissionsService {
|
|
14
15
|
/**
|
|
15
|
-
* Returns access provision for the passed action/feature based on whether the
|
|
16
|
+
* Returns access provision for the passed action/feature based on whether the
|
|
17
|
+
* signed-in user has an appropriate permission — matched by the legacy display
|
|
18
|
+
* name (used by the local demo mock) OR by one of the real backend permission
|
|
19
|
+
* ids in {@link ATTENDANCE_PERMISSION_IDS}.
|
|
16
20
|
* @param {DashboardPermissionType} permission
|
|
17
21
|
* @param {UserPermission[]} userPermissions
|
|
18
22
|
* @return {boolean}
|
|
@@ -1,50 +1,44 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure mappers converting the raw "events & meetings" backend list/detail items
|
|
3
|
-
* into the dashboard view models. No Angular / service dependencies so they are
|
|
4
|
-
* trivially unit-testable and shared by {@link DashboardService}.
|
|
5
|
-
*
|
|
6
|
-
* Backend dates are epoch milliseconds; callers format them with luxon
|
|
7
|
-
* `DateTime.fromMillis` at render time. The list mapper enforces the dashboard
|
|
8
|
-
* rule that STANDALONE_MEETING rows always sort LAST within the section.
|
|
9
|
-
*/
|
|
10
1
|
import { EventMeetingDetailItem, EventMeetingListItem } from '../models/event-meeting-list-item.model';
|
|
11
2
|
import { MeetingRow } from '../models/meeting-row.model';
|
|
12
3
|
import { UpcomingEvent, UpcomingItemKind } from '../models/upcoming-event.model';
|
|
13
4
|
/**
|
|
14
5
|
* Determines whether a raw list item is an EVENT (owns child meetings) or a
|
|
15
|
-
* STANDALONE_MEETING
|
|
16
|
-
*
|
|
6
|
+
* STANDALONE_MEETING, using the backend `isMeetingEvent` discriminator (falling
|
|
7
|
+
* back to `hasChildren`).
|
|
17
8
|
* @param {EventMeetingListItem} item - The raw list item.
|
|
18
9
|
* @return {UpcomingItemKind} The resolved render kind.
|
|
19
10
|
*/
|
|
20
11
|
export declare function resolveItemKind(item: EventMeetingListItem): UpcomingItemKind;
|
|
21
12
|
/**
|
|
22
13
|
* Maps a raw backend list item to the {@link UpcomingEvent} view model. EVENT
|
|
23
|
-
* rows
|
|
24
|
-
*
|
|
14
|
+
* rows carry their total / open-for-attendance counts and start with an empty
|
|
15
|
+
* `meetings` array (child meetings are lazily loaded on drill-down);
|
|
16
|
+
* STANDALONE_MEETING rows carry their own group/location + attendance state.
|
|
25
17
|
* @param {EventMeetingListItem} item - The raw list item.
|
|
26
18
|
* @return {UpcomingEvent} The mapped view model.
|
|
27
19
|
*/
|
|
28
20
|
export declare function mapListItemToUpcomingEvent(item: EventMeetingListItem): UpcomingEvent;
|
|
29
21
|
/**
|
|
30
|
-
* Maps a raw backend list
|
|
31
|
-
*
|
|
32
|
-
*
|
|
22
|
+
* Maps a raw backend combined list into the dashboard view models, enforcing
|
|
23
|
+
* that STANDALONE_MEETING rows always sort LAST while preserving the backend's
|
|
24
|
+
* within-group ordering for each partition (stable sort).
|
|
33
25
|
* @param {EventMeetingListItem[]} items - The raw list items.
|
|
34
26
|
* @return {UpcomingEvent[]} The mapped, standalone-last ordered view models.
|
|
35
27
|
*/
|
|
36
28
|
export declare function mapEventMeetingList(items: EventMeetingListItem[]): UpcomingEvent[];
|
|
37
29
|
/**
|
|
38
|
-
* Maps a raw backend
|
|
30
|
+
* Maps a raw backend drill-down meeting item to the {@link MeetingRow} view
|
|
39
31
|
* model used by the event block's expanded meeting list.
|
|
40
32
|
* @param {EventMeetingDetailItem} item - The raw child-meeting item.
|
|
33
|
+
* @param {string} [eventId] - The owning event id (for navigation).
|
|
41
34
|
* @return {MeetingRow} The mapped meeting row.
|
|
42
35
|
*/
|
|
43
|
-
export declare function mapDetailItemToMeetingRow(item: EventMeetingDetailItem): MeetingRow;
|
|
36
|
+
export declare function mapDetailItemToMeetingRow(item: EventMeetingDetailItem, eventId?: string): MeetingRow;
|
|
44
37
|
/**
|
|
45
|
-
* Maps a raw backend
|
|
46
|
-
*
|
|
38
|
+
* Maps a raw backend drill-down meeting list to {@link MeetingRow} view models,
|
|
39
|
+
* tagging each with its owning event id for navigation.
|
|
47
40
|
* @param {EventMeetingDetailItem[]} items - The raw child-meeting items.
|
|
41
|
+
* @param {string} [eventId] - The owning event id.
|
|
48
42
|
* @return {MeetingRow[]} The mapped meeting rows.
|
|
49
43
|
*/
|
|
50
|
-
export declare function mapEventMeetingDetails(items: EventMeetingDetailItem[]): MeetingRow[];
|
|
44
|
+
export declare function mapEventMeetingDetails(items: EventMeetingDetailItem[], eventId?: string): MeetingRow[];
|