Project

General

Profile

« Previous | Next » 

Revision 53741

manage-subscribers.component & manage-user-notifications.component: when Session is expired, redirect to '/user-info' page to show a proper message (fix unhandled cases).

View differences:

modules/uoa-admin-portal/trunk/src/app/pages/subscribers/manage-subscribers.component.ts
134 134
    }
135 135

  
136 136
    filterData(row: any, query: string) {
137
      if(!Session.isLoggedIn()){
138
        console.info(this._router.url);
139
        this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl":  this._router.url} });
140
      } else {
137 141
        let returnValue: boolean = false;
138 142

  
139 143
        if(query) {
......
150 154
            }
151 155
        }
152 156
        return true;
157
      }
153 158
    }
154 159

  
155 160
    filterQuery(data, query){
modules/uoa-admin-portal/trunk/src/app/pages/usernotifications/manage-user-notifications.component.ts
165 165
        }
166 166

  
167 167
        */
168
        this.mailPrefs.restoreNotification(0);
168
        if(!Session.isLoggedIn()){
169
          console.info(this._router.url);
170
          this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl":  this._router.url} });
171
        } else {
172
          this.mailPrefs.restoreNotification(0);
169 173

  
170
        if(this.userNotifications && this.initialUserNotifications) {
171
          this.successfulSaveMessage = "";
172
          this.showLoading = true;
173
          this.userNotifications = JSON.parse(JSON.stringify( this.initialUserNotifications ));
174
          this.showLoading = false;
175
        }
174
          if(this.userNotifications && this.initialUserNotifications) {
175
            this.successfulSaveMessage = "";
176
            this.showLoading = true;
177
            this.userNotifications = JSON.parse(JSON.stringify( this.initialUserNotifications ));
178
            this.showLoading = false;
179
          }
176 180

  
177 181

  
178
        this.resetChange();
182
          this.resetChange();
183
        }
179 184
    }
180 185

  
181 186
    public changeValueForNewManagers(notifyForManagers : any) {
187
      if(!Session.isLoggedIn()){
188
        console.info(this._router.url);
189
        this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl":  this._router.url} });
190
      } else {
182 191
        this.userNotifications.notifyForNewManagers = !notifyForManagers;
183 192
        this.change();
193
      }
184 194
    }
185 195

  
186 196
    public changeValueForNewSubscribers(notifyForSubscribers : any) {
197
      if(!Session.isLoggedIn()){
198
        console.info(this._router.url);
199
        this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl":  this._router.url} });
200
      } else {
187 201
        this.userNotifications.notifyForNewSubscribers = !notifyForSubscribers;
188 202
        this.change();
203
      }
189 204
    }
190 205

  
191 206
    private change() {
......
203 218
    }
204 219

  
205 220
    public mailPrefsChanged(): boolean {
206
      return this.mailPrefs.prefsChanged["0"];//(0);
221
      if(!Session.isLoggedIn()){
222
        console.info(this._router.url);
223
        this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl":  this._router.url} });
224
      } else {
225
        return this.mailPrefs.prefsChanged["0"];//(0);
226
      }
207 227
    }
208 228

  
209 229
    handleUpdateError(message: string, error) {

Also available in: Unified diff