summaryrefslogtreecommitdiffstats
path: root/portal-FE-common/src/app/pages/user-notification-admin/new-notification-modal/new-notification-modal.component.html
blob: b4325dbdb247e348133702edb4a1c346ed6e9fc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<!--
  ============LICENSE_START==========================================
  ONAP Portal
  ===================================================================
  Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
  ===================================================================
 
  Unless otherwise specified, all software contained herein is licensed
  under the Apache License, Version 2.0 (the "License");
  you may not use this software except in compliance with the License.
  You may obtain a copy of the License at
 
              http://www.apache.org/licenses/LICENSE-2.0
 
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
 
  Unless otherwise specified, all documentation contained herein is licensed
  under the Creative Commons License, Attribution 4.0 Intl. (the "License");
  you may not use this documentation except in compliance with the License.
  You may obtain a copy of the License at
 
              https://creativecommons.org/licenses/by/4.0/
 
  Unless required by applicable law or agreed to in writing, documentation
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
 
  ============LICENSE_END============================================
 
  
  -->
 
<div class="container">
  <!--Modal Headers-->
  <div class="modal-header">
    <h4 class="modal-title">Add a New Notification</h4>
    <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross')">
      <span aria-hidden="true">&times;</span>
    </button>
  </div>

  <!--Modal Body goes here-->
  <div class="modal-body" [ngClass]="{'disable-div': (isEditMode)}">
    <div class="user-notification-details-contents">
        <!-- Left Side container-->
        <div class="left-container">
            <div id="add-user-notif-broadcast" class="add-widget-field">
                <div class="user-notif-label" style="padding-bottom: 7px">Broadcast to All Categories</div>
                <mat-radio-group [(ngModel)]="notification.isForAllRoles" #radioGroup="matRadioGroup" aria-label="Select an option">
                    <span style="padding-left: 12px;"><mat-radio-button value="Y">Yes</mat-radio-button></span><br/>
                    <span style="padding-left: 12px;"><mat-radio-button value="N">No</mat-radio-button></span>
                </mat-radio-group>
                <div style="padding-bottom: 12px;"></div>

                <div class="categories-selection" [ngClass]="{'disable-category-selection': (!notification.isForAllRoles ||notification.isForAllRoles=='Y')}">
                  <div [ngClass]="{'required': (notification.isForAllRoles=='N')}" style="padding-bottom: 7px">
                    Categories
                  </div>
                  <mat-radio-group [(ngModel)]="notification.isFunctionalMenu" #radioGroup="matRadioGroup" aria-label="Select an option">
                      <span style="padding-left: 12px;"><mat-radio-button (click)="getFunctionalMenu()" value="Y">Functional Menu</mat-radio-button></span><br/>
                      <span style="padding-left: 12px;"><mat-radio-button (click)="getAppRoleIds()" value="N">Application Roles</mat-radio-button></span>
                  </mat-radio-group>
                  <br/>
                  <div id="user-notif-tree-div" class="tree-div" >
                    <!-- Mat Tree code will goes here..-->
                    <mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
                      <mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle matTreeNodePadding>
                        <button mat-icon-button disabled></button>
                        <mat-checkbox class="checklist-leaf-node"
                                      [checked]="checklistSelection.isSelected(node)"
                                      (change)="checklistSelection.toggle(node);">{{node.item}}</mat-checkbox>
                      </mat-tree-node>
                    
                      <mat-tree-node *matTreeNodeDef="let node; when: hasNoContent" matTreeNodePadding>
                        <button mat-icon-button disabled></button>                       
                      </mat-tree-node>
                    
                      <mat-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodePadding>
                        <button mat-icon-button matTreeNodeToggle
                                [attr.aria-label]="'toggle ' + node.filename">
                          <mat-icon class="mat-icon-rtl-mirror">
                            {{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
                          </mat-icon>
                        </button>
                        <mat-checkbox 
                            [indeterminate]="descendantsPartiallySelected(node)"
                            (change)="todoItemSelectionToggle(node)">{{node.item}}
                        </mat-checkbox>
                      </mat-tree-node>
                    </mat-tree>
                  </div>
                </div>
            </div>
        </div>

        <!-- Right Side container-->
        <div id="app-conatiner-right" class="right-container">
            <div id="add-user-notif-priority" class="add-widget-field">
                <div id="user-notification-priority-label" class="user-notif-label">Priority</div>
                <mat-radio-group [(ngModel)]="notification.priority" #radioGroup="matRadioGroup" aria-label="Select an option">
                    <span><mat-radio-button value="1">Normal</mat-radio-button></span><br/>
                    <span><mat-radio-button value="2">Important</mat-radio-button></span>
                </mat-radio-group>
            </div>
            <div id="add-user-notif-startdate" class="add-widget-field" style="padding-bottom: 12px; width: 301px !important;">
              <div id="user-notification-startdate-label" class="user-notif-label">
                <div class="user-notif-label">
                  <span runat="server" ID="required" class="notifcation-label-required">*</span>Start Date (Local Time)
                </div>
                <mat-form-field>
                    <input [(ngModel)]="notification.startTime" name="startTime" matInput [matDatepicker]="startdate" 
                      placeholder="MM/dd/yyyy">
                    <mat-datepicker-toggle matSuffix [for]="startdate"></mat-datepicker-toggle>
                    <mat-datepicker #startdate></mat-datepicker>
                </mat-form-field>
                <div class="user-notif-label">
                    <span runat="server" ID="required" class="notifcation-label-required">*</span>End Date (Local Time)
                </div>
                <mat-form-field>
                    <input [(ngModel)]="notification.endTime" name="endTime" matInput [matDatepicker]="enddate" 
                      placeholder="MM/dd/yyyy">
                    <mat-datepicker-toggle matSuffix [for]="enddate"></mat-datepicker-toggle>
                    <mat-datepicker #enddate></mat-datepicker>
                </mat-form-field>
              </div>
            </div>

            <div id="add-user-notif-title" class="add-widget-field" style="padding-bottom: 12px;">
              <div id="user-notification-title-label" class="user-notif-label">
                <span runat="server" ID="required" class="notifcation-label-required" visible="false"> *</span> Title
              </div>
              <textarea id="add-notification-input-title"
                 [(ngModel)]="notification.msgHeader" name="content" class="add-notification-input-title-ht">
              </textarea>
              <div id="user-title-required">
                <small *ngIf="notification.msgHeader ==''" class="mandatory-categories">Title is Required</small>
              </div>
            </div>

            <div id="add-user-notif-message" class="add-widget-field"
              style="padding-bottom: 12px;">
              <div id="user-notif-message-label" class="user-notif-label">
                <span runat="server" ID="required" class="notifcation-label-required"
                  visible="false"> *</span> Message
              </div>
              <textarea id="user-notif-input-message" class="add-notification-input-title-ht"
                [(ngModel)]="notification.msgDescription" name="content">
              </textarea>
              <div id="user-notif-message-required">
                <small *ngIf="notification.msgDescription ==''" class="mandatory-categories">Message is Required</small>
              </div>
            </div>
        </div>
    </div>
  </div>

  <!--Modal Footer goes Here-->
  <div class="modal-footer">
    <button type="button" [hidden]="isEditMode" class="btn btn-primary" (click)="addUserNotification('')">Save</button> &nbsp;
    <button type="button" class="btn btn-primary" (click)="activeModal.close('Close')">Cancel</button>
  </div>
</div>