RequestsModal

A modal component to display and manage requests.

app-requests-modal

true

[CommonModule, FontAwesomeModule, RenderRequestComponent]

./requests-modal.component.html

./requests-modal.component.css

Service to handle request responses.

ngOnInit - Lifecycle hook that is called after data-bound properties are initialized.

ngOnChanges - Lifecycle hook that is called when any data-bound property changes.

Object of current and previous property values.

updateRequests - Updates the request list and counter based on the current parameters.

handleModalClose - Handles the modal close action.

handleFilterChange - Handles the filter change event.

The filter change event.

<app-requests-modal
[isRequestsModalVisible]="isModalVisible"
[requestCounter]="requestCounter"
[requestList]="requests"
[roomName]="roomName"
[socket]="socket"
[backgroundColor]="'#83c0e9'"
[position]="'topRight'"
[parameters]="requestParams"
(onRequestClose)="handleModalClose()"
(onRequestFilterChange)="handleFilterChange($event)"
(onRequestItemPress)="handleRequestPress($event)"
[updateRequestList]="updateRequestList">
</app-requests-modal>

Implements

  • OnInit
  • OnChanges

Constructors

Methods

  • A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

    Returns void

  • A callback method that is invoked immediately after the default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked.

    Parameters

    • changes: SimpleChanges

      The changed properties.

    Returns void

Properties

isRequestsModalVisible: boolean = false

Determines if the requests modal is visible.

requestCounter: number = 0

Counter for the number of requests.

requestList: Request[] = []

List of requests.

roomName: string

Name of the room.

socket: Socket<DefaultEventsMap, DefaultEventsMap> = ...

Socket instance for communication.

backgroundColor: string = '#83c0e9'

Background color of the modal.

position: string = 'topRight'

Position of the modal.

parameters: any

Additional parameters for the modal.

onRequestClose: (() => void)

Callback function when the modal is closed.

onRequestFilterChange: ((filter: string) => void)

Callback function when the request filter changes.

onRequestItemPress: ((params: any) => void)

Callback function when a request item is pressed.

updateRequestList: ((newRequestList: any[]) => void)

Function to update the request list.

faTimes: IconDefinition = faTimes

FontAwesome icon for closing the modal.

requestList_s: any[] = []

Filtered list of requests.

requestCounter_s: number = 0

Counter for the filtered list of requests.

reRender: boolean = false

Flag to trigger re-rendering.