@ieeesa-npm/presentation 0.33.18 → 0.33.19

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.
@@ -0,0 +1,57 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import { CreditSelectionData, CreditSelectionTimeslotOption } from '../../models/credit-selection.model';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * CreditSelectionComponent is a generic, reusable dialog shown when the
7
+ * attendance log-in APIs (Pass 1) return a non-null creditSelectionPrompt.
8
+ *
9
+ * For each timeslot the user must choose which meeting receives attendance
10
+ * credit — the prior (credit-holding) meeting or the target meeting being
11
+ * attended. The prior meeting is pre-selected per timeslot. Save is enabled
12
+ * only when every timeslot has a selection (the backend rejects partial
13
+ * submissions).
14
+ *
15
+ * Footer (SP3M-677 — no Cancel button; the dialog is non-dismissable and a
16
+ * valid meeting is always pre-selected, so credit is resolved via Save):
17
+ * - Save → closes with { creditSelections: [{ timeslotId, creditedMeetingId }] }
18
+ *
19
+ * This component is feature-agnostic — all display text is supplied by the
20
+ * caller via MAT_DIALOG_DATA (CreditSelectionData). It performs no API calls;
21
+ * it collects selections and returns them so the caller can re-submit Pass 2.
22
+ * @export
23
+ * @class CreditSelectionComponent
24
+ * @implements {OnInit}
25
+ */
26
+ export declare class CreditSelectionComponent implements OnInit {
27
+ data: CreditSelectionData;
28
+ private dialogRef;
29
+ /** Timeslots the user must resolve, each with prior/target meeting options. */
30
+ timeslotOptions: CreditSelectionTimeslotOption[];
31
+ /** Map of timeslotId → selected creditedMeetingId. */
32
+ selections: Record<string, string>;
33
+ constructor(data: CreditSelectionData, dialogRef: MatDialogRef<CreditSelectionComponent>);
34
+ ngOnInit(): void;
35
+ /**
36
+ * trackBy for the timeslot list.
37
+ * @param {number} _index
38
+ * @param {CreditSelectionTimeslotOption} timeslot
39
+ * @return {string}
40
+ * @memberof CreditSelectionComponent
41
+ */
42
+ trackByTimeslotId(_index: number, timeslot: CreditSelectionTimeslotOption): string;
43
+ /**
44
+ * Whether Save should be enabled — true once every timeslot has a selection.
45
+ * @return {boolean}
46
+ * @memberof CreditSelectionComponent
47
+ */
48
+ get canSave(): boolean;
49
+ /**
50
+ * Save handler — builds one entry per timeslot and closes with the result.
51
+ * No-ops if any timeslot is unselected (backend rejects partial submissions).
52
+ * @memberof CreditSelectionComponent
53
+ */
54
+ onSave(): void;
55
+ static ɵfac: i0.ɵɵFactoryDeclaration<CreditSelectionComponent, never>;
56
+ static ɵcmp: i0.ɵɵComponentDeclaration<CreditSelectionComponent, "ieeesa-credit-selection", never, {}, {}, never, never, true, never>;
57
+ }
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Shared models for the reusable Credit Selection dialog.
3
+ *
4
+ * The dialog is generic and feature-agnostic: all display text is supplied by
5
+ * the calling feature library (e.g. attendance, attendees) via MAT_DIALOG_DATA,
6
+ * so this presentation-layer component never depends on any feature's constants.
7
+ */
8
+ /**
9
+ * A single selectable meeting option shown in the credit-selection dialog.
10
+ * Represents either the prior (credit-holding) meeting or the target meeting
11
+ * being attended, as returned per timeslot by the backend credit prompt.
12
+ */
13
+ export interface CreditSelectionMeetingOption {
14
+ meetingId: string;
15
+ meetingName: string;
16
+ }
17
+ /**
18
+ * A single timeslot the user must resolve credit for. Contains the prior
19
+ * (credit-holding) meeting and the target meeting being attended. The user
20
+ * picks exactly one of these two per timeslot.
21
+ * Mirrors creditSelectionPrompt.timeslotOptions[] from the attendance log-in APIs.
22
+ */
23
+ export interface CreditSelectionTimeslotOption {
24
+ timeslotId: string;
25
+ timeslotName: string;
26
+ priorMeeting: CreditSelectionMeetingOption;
27
+ targetMeeting: CreditSelectionMeetingOption;
28
+ }
29
+ /**
30
+ * The creditSelectionPrompt object returned by Pass 1 of the attendance log-in
31
+ * APIs. When present (non-null), the credit-selection dialog must be shown
32
+ * before the attendance can be finalized (Pass 2).
33
+ */
34
+ export interface CreditSelectionPrompt {
35
+ eventId: string;
36
+ timeslotOptions: CreditSelectionTimeslotOption[];
37
+ }
38
+ /**
39
+ * Data passed to the CreditSelectionComponent via MAT_DIALOG_DATA.
40
+ * All text is provided by the caller so the component stays generic.
41
+ */
42
+ export interface CreditSelectionData {
43
+ /** Timeslots the user must resolve, each with prior/target meeting options. */
44
+ timeslotOptions: CreditSelectionTimeslotOption[];
45
+ /** Dialog title. */
46
+ title: string;
47
+ /** First instruction paragraph (context — why credit must be chosen). */
48
+ messageLine1: string;
49
+ /** Second instruction paragraph (the actual "please select" prompt). */
50
+ messageLine2: string;
51
+ /** Save button label. */
52
+ saveLabel: string;
53
+ /** Accessibility label for each timeslot's radio group. */
54
+ meetingOptionAriaLabel: string;
55
+ }
56
+ /**
57
+ * One credit selection the user made — which meeting should receive credit for
58
+ * a given timeslot. Sent in Pass 2 as creditSelections[].
59
+ */
60
+ export interface CreditSelectionEntry {
61
+ timeslotId: string;
62
+ creditedMeetingId: string;
63
+ }
64
+ /**
65
+ * Result returned by CreditSelectionComponent when the user clicks Save.
66
+ * Contains one entry per timeslot.
67
+ */
68
+ export interface CreditSelectionResult {
69
+ creditSelections: CreditSelectionEntry[];
70
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ieeesa-npm/presentation",
3
- "version": "0.33.18",
3
+ "version": "0.33.19",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0",
package/public-api.d.ts CHANGED
@@ -46,6 +46,7 @@ export * from './lib/components/filter-popover/filter-popover.component';
46
46
  export * from './lib/components/policy-confirmation-dialog/policy-confirmation-dialog.component';
47
47
  export * from './lib/components/export-success-dialog/export-success-dialog.component';
48
48
  export * from './lib/components/home-group-selection/home-group-selection.component';
49
+ export * from './lib/components/credit-selection/credit-selection.component';
49
50
  export * from './lib/directives/dynamic-form-field/dynamic-form-field.directive';
50
51
  export * from './lib/directives/set-background/set-background.directive';
51
52
  export * from './lib/directives/text-truncated/text-truncated.directive';
@@ -107,6 +108,7 @@ export * from './lib/models/filter-popover.model';
107
108
  export * from './lib/models/policy-confirmation-dialog.model';
108
109
  export * from './lib/models/export-success-dialog.model';
109
110
  export * from './lib/models/home-group-selection.model';
111
+ export * from './lib/models/credit-selection.model';
110
112
  export * from './lib/services/datepicker.service';
111
113
  export * from './lib/services/form-utility.service';
112
114
  export * from './lib/services/file-upload.service';