Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Dec 6, 2018
2 parents c8e04e7 + 53c9a90 commit c41ee50
Show file tree
Hide file tree
Showing 16 changed files with 1,570 additions and 325 deletions.
2 changes: 2 additions & 0 deletions .nodeenvrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[nodeenv]
node = 8.13.0
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
## (2018-11-23)



#### Bug Fixes

* **development:** remove nvmrc file

#### Features

* **applications:**
* facility applications now with approval
* now shows cc
* now vo also sees wfc status
* added modal
* added facility decline method and reassign
* added facility applications overview
* **approval:** now sets status auf wait for confirmation
* **development:** use nodeenv instead of nvm

## 0.1.0-beta.0.3.4 Release

#### Features

* **developemnt:** add nodeenv commands
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,29 @@ cd cloud-portal-webapp
127.0.0.1 portal-dev.denbi.de
~~~

3. Install node version manager and node version 8
3. Install nodejs virtual environment as decribed [here](https://github.com/ekalinin/nodeenv#install).

4. The environment can then be created with

~~~BASH
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
# follow the commands printed by nvm
nvm install
nodeenv -C .nodeenvrc env
~~~

Note that the actual used node version is defined in .nvmrc.
Note that the actual used node version is defined in .nodeenvrc.

4. In order to use the node version install with nvm just run the following command.
5. The environment can be activated with

~~~BASH
nvm use --delete-prefix
. env/bin/activate
~~~

5. Install all needed npm packages and angular cli
6. Install all needed npm packages and angular cli
~~~BASH
npm install
npm install -g @angular/cli
~~~

6. start the angular server with
7. start the angular server with
~~~BASH
ng serve
~~~
Expand Down
83 changes: 80 additions & 3 deletions src/app/api-connector/facility.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export class FacilityService {
}


getComputeCenters(): Observable<any> {
/**
* Get all available computecenters.
* @returns {Observable<any>}
*/
getComputeCenters(): Observable<any> {


return this.http.get(this.settings.getApiBaseURL() + 'computecenters/', {
Expand All @@ -25,6 +29,10 @@ export class FacilityService {
}).pipe(catchError((error: any) => throwError(error.error)));
}

/**
* Get all facility, where the current user is manager.
* @returns {Observable<any>}
*/
getManagerFacilities(): Observable<any> {

return this.http.get(this.settings.getApiBaseURL() + 'facilityManagers/current/facilities/', {
Expand All @@ -34,16 +42,85 @@ export class FacilityService {
}


/**
* Get allowed groups from a facility with a specific status.
* @param {number} facility
* @param {number} status
* @returns {Observable<any>}
*/
getFacilityAllowedGroupsWithDetailsAndSpecificStatus(facility: number, status: number): Observable<any> {

getFacilityAllowedGroupsWithDetails(facility): Observable<any> {
return this.http.get(this.settings.getApiBaseURL() + 'computecenters/' + facility + '/projects/', {
withCredentials: true,
params: {status: status.toString()}

}).pipe(catchError((error: any) => throwError(error)));


}


/**
* Gets all facility applications which are waiting for conirmation.
* @param {number} facility
* @returns {Observable<any>}
*/
getFacilityApplicationsWaitingForConfirmation(facility: number): Observable<any> {

return this.http.get(this.settings.getApiBaseURL() + 'computecenters/'+facility + '/projects/' , {
return this.http.get(this.settings.getApiBaseURL() + 'computecenters/' + facility + '/applications/', {
withCredentials: true,

}).pipe(catchError((error: any) => throwError(error)));


}

/**
* Approves an facility application.
* @param {number} facility
* @param {number} application_id
* @returns {Observable<any>}
*/
approveFacilityApplication(facility: number, application_id: number): Observable<any> {
let params = new HttpParams().set('action', 'approve');


return this.http.post(this.settings.getApiBaseURL() + 'computecenters/' + facility + '/applications/' + application_id + '/status/', params, {
withCredentials: true,
headers: header,
observe: 'response'
}).pipe(catchError((error: any) => throwError(error)));


}

/**
* Declines an application for the facility
* @param {number} facility
* @param {number} application_id
* @returns {Observable<any>}
*/
declineFacilityApplication(facility: number, application_id: number): Observable<any> {
let params = new HttpParams().set('action', 'decline');


return this.http.post(this.settings.getApiBaseURL() + 'computecenters/' + facility + '/applications/' + application_id + '/status/', params, {
withCredentials: true,
headers: header,
observe: 'response'
}).pipe(catchError((error: any) => throwError(error)));


}

/**
* Sends an email to all members of the facility.
* @param facility
* @param subject
* @param message
* @param reply
* @returns {Observable<any>}
*/
sendMailToFacility(facility, subject, message, reply?): Observable<any> {
let params = new HttpParams().set('subject', subject).set('facility_id', facility).set('message', message).set('reply', reply);

Expand Down
Loading

0 comments on commit c41ee50

Please sign in to comment.