Project

General

Profile

« Previous | Next » 

Revision 58444

[Trunk | Admin]:
1. community-edit-form.component.ts & manage-subscribers.component.ts &curator.component.ts & customization.component.ts & manage-user-notifications.component.ts & manage-user-notifications.service.ts:
create request path in service and "properties" as first parameter in methods (curator.service.ts, layout.service.ts, subscribe.service.ts).
2. manageContentProviders.service.ts & manageProjects.service.ts & manageZenodoCommunities.service.ts: Rename "communityId" to "pid".

View differences:

modules/uoa-admin-portal/trunk/src/app/pages/curator/curator.component.ts
72 72
          this.userManagementService.getUserInfo().subscribe(user => {
73 73
            this.user = user;
74 74
            this.curatorId = this.user.id;
75
            this.curatorService.getCurator(this.properties,
76
              this.properties.adminToolsAPIURL + 'curator/' + this.curatorId).subscribe(
75
            this.curatorService.getCurator(this.properties, this.curatorId).subscribe(
77 76
              curator => {
78 77
                if (curator && Object.keys(curator).length > 0) {
79 78
                  this.curator = curator;
......
120 119
      if (this.curatorId != null && this.curatorId !== '') {
121 120
        this.showLoading = true;
122 121
        this.updateErrorMessage = '';
123
        this.curatorService.getCurator(this.properties,
124
          this.properties.adminToolsAPIURL + 'curator/' + this.curatorId).subscribe(
122
        this.curatorService.getCurator(this.properties, this.curatorId).subscribe(
125 123
          curator => {
126 124
            if (curator) {
127 125
              this.curator = curator;
......
238 236
                this.utilitiesService.deletePhoto(this.properties.utilsService + '/delete/' + this.curator.photo).subscribe();
239 237
              }
240 238
              this.curator.photo = res.filename;
241
              this.curatorService.updateCurator(this.properties.adminToolsAPIURL + 'curator',
242
                this.curator).subscribe((curator) => {
239
              this.curatorService.updateCurator(this.properties, this.curator).subscribe((curator) => {
243 240
                  if (curator) {
244 241
                    this.handleSuccessfulSave('Your data has been saved successfully!');
245 242
                    this.newCurator = false;
......
259 256
            this.utilitiesService.deletePhoto(this.properties.utilsService + '/delete/' + this.curator.photo).subscribe();
260 257
            this.curator.photo = '';
261 258
          }
262
          this.curatorService.updateCurator(this.properties.adminToolsAPIURL + 'curator',
263
            this.curator).subscribe((curator) => {
259
          this.curatorService.updateCurator(this.properties, this.curator).subscribe((curator) => {
264 260
              if (curator) {
265 261
                this.handleSuccessfulSave('Your data has been saved successfully!');
266 262
                this.resetChange();
modules/uoa-admin-portal/trunk/src/app/pages/community/community-edit-form/community-edit-form.component.ts
166 166
                            this.sendMailToNewManagers(newManagers);
167 167
                            this.informOldManagersForTheNewOnes();
168 168
                            for (let i = 0; i < newManagers.length; i++) {
169
                                this._subscribeService.subscribeToCommunity(
170
                                    this.communityId, newManagers[i], this.properties.adminToolsAPIURL).
171
                                subscribe(
169
                                this._subscribeService.subscribeToCommunity(this.properties, this.communityId, newManagers[i]).subscribe(
172 170
                                    res => {
173 171
                                        // console.log(res);
174 172
                                    }
modules/uoa-admin-portal/trunk/src/app/pages/subscribers/manage-subscribers.component.ts
229 229
      if(!Session.isLoggedIn()){
230 230
        this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl":  this._router.url} });
231 231
      } else {
232
        this.subRemove = this._subscribeService.unSubscribeToCommunity(this.communityId, this.selectedSubscriberEmail, this.properties.adminToolsAPIURL).subscribe(
232
        this.subRemove = this._subscribeService.unSubscribeToCommunity(this.properties, this.communityId, this.selectedSubscriberEmail).subscribe(
233 233
            result => {
234 234
                this.communitySubscribers = result;
235 235
            },
modules/uoa-admin-portal/trunk/src/app/pages/customization/customization.component.ts
67 67
          this.showLoading = true;
68 68
          this.errorMessage = '';
69 69
          this.successfulSaveMessage = '';
70
          this.layoutService.getLayout(this.communityId, this.properties.adminToolsAPIURL + 'community/').subscribe(layout => {
70
          this.layoutService.getLayout(this.properties, this.communityId).subscribe(layout => {
71 71
            this.publishedCustomizationOptions = (layout?layout:new CustomizationOptions());
72 72
            this.initializeCustomizationOptions(true);
73 73
          }, error => {
......
89 89
        queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url}
90 90
      });
91 91
    }
92
    this.layoutService.saveLayout(this.communityId, this.properties.adminToolsAPIURL + 'community/', this.draftCustomizationOptions).subscribe(layout => {
92
    this.layoutService.saveLayout(this.properties, this.communityId, this.draftCustomizationOptions).subscribe(layout => {
93 93
      this.publishedCustomizationOptions = layout;
94 94
      this.initializeCustomizationOptions(JSON.stringify(this.publishedCustomizationOptions) != this.previewCustomization);
95 95
      this.successfulSaveMessage = "Customization Options saved!"
modules/uoa-admin-portal/trunk/src/app/pages/usernotifications/manage-user-notifications.service.ts
12 12
    constructor(private http: HttpClient) {
13 13
    }
14 14

  
15
    getUserNotifications(url: string, email: string) {
15
    getUserNotifications(properties: EnvProperties, pid: string, email: string) {
16
      let url: string = properties.adminToolsAPIURL + 'community/'+ pid + '/notifications';
16 17
        return this.http.get(url)//.map(res => <any> res.json())
17 18
                                 .pipe(map(res => this.parseUserNotifications(res, email)));
18 19
    }
19 20

  
20
    updateUserNotifications(url: string, userNotificationsRights: any) {
21
    updateUserNotifications(properties: EnvProperties, pid: string, userNotificationsRights: any) {
21 22
        //let headers = new Headers({'Content-Type': 'application/json'});
22 23
        //let options = new RequestOptions({headers: headers});
23 24
        let body = JSON.stringify(userNotificationsRights);
24

  
25
        let url: string = properties.adminToolsAPIURL + 'community/' + pid + '/notifications';
25 26
        return this.http.post(url, body, CustomOptions.getAuthOptionsWithBody());
26 27
                        //.do(request => console.log("Insert Response:"+request.status));
27 28
    }
modules/uoa-admin-portal/trunk/src/app/pages/usernotifications/manage-user-notifications.component.ts
67 67
                this.user = user;
68 68
                if (this.user) {
69 69
                    this.userEmail = this.user.email;
70
                    this._manageUserNotificationsService.getUserNotifications(
71
                      this.properties.adminToolsAPIURL + 'community/' + this.communityId + '/notifications', this.userEmail).subscribe(
70
                    this._manageUserNotificationsService.getUserNotifications(this.properties, this.communityId, this.userEmail).subscribe(
72 71
                      userNotifications => {
73 72
                          this.initialUserNotifications = userNotifications;
74 73
                          if (this.initialUserNotifications['notifyForNewManagers'] == null ||
......
120 119
        this.successfulSaveMessage = '';
121 120
        this.showLoading = true;
122 121
        const userNotifications = this.parseUpdatedUserNotifications();
123
        this._manageUserNotificationsService.updateUserNotifications(
124
          this.properties.adminToolsAPIURL + 'community/' + this.communityId + '/notifications',
125
          userNotifications).subscribe(
122
        this._manageUserNotificationsService.updateUserNotifications(this.properties, this.communityId, userNotifications).subscribe(
126 123
          userNotifications => {
127 124
            this.initialUserNotifications = JSON.parse(JSON.stringify(this.userNotifications));
128 125
            this.handleSuccessfulSave('Notification settings saved!');
modules/uoa-admin-portal/trunk/src/app/services/manageContentProviders.service.ts
9 9
  constructor(private http: HttpClient) {
10 10
  }
11 11

  
12
  removeContentProvider(properties: EnvProperties, communityId: string, id: string): any {
12
  removeContentProvider(properties: EnvProperties, pid: string, id: string): any {
13 13
    let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'});
14
    let url = properties.communityAPI + communityId + '/contentproviders';
14
    let url = properties.communityAPI + pid + '/contentproviders';
15 15
    return this.http.request('delete', url, {body: id, headers: headers});
16 16
  }
17 17

  
18
  addContentProvider(properties: EnvProperties, communityId: string, contentProvider: any): Observable<ContentProvider> {
19
    let url = properties.communityAPI + communityId + '/contentproviders';
20
    let communityContentProvider = this.convertSearchContentProviderToCommunityContentProvider(contentProvider, communityId);
18
  addContentProvider(properties: EnvProperties, pid: string, contentProvider: any): Observable<ContentProvider> {
19
    let url = properties.communityAPI + pid + '/contentproviders';
20
    let communityContentProvider = this.convertSearchContentProviderToCommunityContentProvider(contentProvider, pid);
21 21
    return this.http.post<ContentProvider>(url, communityContentProvider);
22 22
  }
23 23

  
modules/uoa-admin-portal/trunk/src/app/services/manageProjects.service.ts
6 6
export class ManageCommunityProjectsService {
7 7
  constructor(private http: HttpClient ) {}
8 8

  
9
  removeProject (properties:EnvProperties, communityId: string, id: string):any {
9
  removeProject (properties:EnvProperties, pid: string, id: string):any {
10 10
    //let headers = new Headers({'Content-Type': 'application/json', 'accept': 'application/json'});
11 11
    //let options = new RequestOptions({headers: headers, body: id});
12 12

  
13 13
    let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'});
14 14

  
15
    let url = properties.communityAPI+communityId+"/projects";
15
    let url = properties.communityAPI+pid+"/projects";
16 16
    //return this.http.delete(url, options)
17 17
    return this.http.request('delete', url, { body: id, headers: headers})
18 18
  }
19 19

  
20
  addProject(properties:EnvProperties, communityId: string, project: any) {
20
  addProject(properties:EnvProperties, pid: string, project: any) {
21 21
      //let headers = new Headers({'Content-Type': 'application/json'});
22 22
      //let options = new RequestOptions({headers: headers});
23 23

  
24 24
    let headers = new HttpHeaders({'Content-Type': 'application/json'});
25 25

  
26
    let url = properties.communityAPI+communityId+"/projects";
26
    let url = properties.communityAPI+pid+"/projects";
27 27

  
28
      let communityProject = this.convertSearchProjectToCommunityProject(project, communityId);
28
      let communityProject = this.convertSearchProjectToCommunityProject(project, pid);
29 29
      let testProject: any = {
30 30
        "acronym": "test",
31 31
        "communityId": "egi",
modules/uoa-admin-portal/trunk/src/app/services/manageZenodoCommunities.service.ts
6 6
export class  ManageZenodoCommunitiesService {
7 7
  constructor(private http: HttpClient ) {}
8 8

  
9
  removeZCommunity (properties: EnvProperties, communityId: string,id: string):any {
9
  removeZCommunity (properties: EnvProperties, pid: string,id: string):any {
10 10
    //let headers = new Headers({'Content-Type': 'application/json', 'accept': 'application/json'});
11 11
    //let options = new RequestOptions({headers: headers, body: id});
12 12

  
13 13
    let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'});
14
    let url = properties.communityAPI + communityId + "/zenodocommunities";
14
    let url = properties.communityAPI + pid + "/zenodocommunities";
15 15

  
16 16
    //return this.http.delete(url, options);
17 17
    return this.http.request('delete', url, { body: id, headers: headers})
18 18
  }
19 19

  
20
  addZCommunity(properties:EnvProperties, communityId: string,zenodoid: string) {
20
  addZCommunity(properties:EnvProperties, pid: string,zenodoid: string) {
21 21
      //let headers = new Headers({'Content-Type': 'application/json'});
22 22
      //let options = new RequestOptions({headers: headers});
23 23

  
24 24
    let headers = new HttpHeaders({'Content-Type': 'application/json'});
25 25

  
26
      let url = properties.communityAPI+communityId+"/zenodocommunities";
26
      let url = properties.communityAPI+pid+"/zenodocommunities";
27 27
      var zCommunity: any = {
28
        "communityId": communityId,
28
        "communityId": pid,
29 29

  
30 30
        "zenodoid": zenodoid
31 31
      };

Also available in: Unified diff