summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-portal')
-rw-r--r--usecaseui-portal/CHANGELOG.md28
-rw-r--r--usecaseui-portal/src/app/shared/utils/http.ts49
-rw-r--r--usecaseui-portal/src/app/shared/utils/utils.ts18
3 files changed, 72 insertions, 23 deletions
diff --git a/usecaseui-portal/CHANGELOG.md b/usecaseui-portal/CHANGELOG.md
index adbdd354..aa20db72 100644
--- a/usecaseui-portal/CHANGELOG.md
+++ b/usecaseui-portal/CHANGELOG.md
@@ -1,32 +1,50 @@
-# [1.0.0](https://gerrit.onap.org/r/usecase-ui/compare/2.0.1...1.0.0) (2019-08-23)
+# [1.0.0](https://gerrit.onap.org/r/usecase-ui/compare/2.0.1...1.0.0) (2019-09-01)
### Bug Fixes
* fix bugs of positions of README.md ([ebd842c](https://gerrit.onap.org/r/usecase-ui/commits/ebd842c))
* fix bugs of table spinner and delete usless codes ([8455cd5](https://gerrit.onap.org/r/usecase-ui/commits/8455cd5))
+* fix the file path and delete console in mock data ([27b9342](https://gerrit.onap.org/r/usecase-ui/commits/27b9342))
### Features
+* add ajax request function ([1c5c010](https://gerrit.onap.org/r/usecase-ui/commits/1c5c010))
+* add copyright and comments ([feb28bd](https://gerrit.onap.org/r/usecase-ui/commits/feb28bd))
* add loading for page ([45fe372](https://gerrit.onap.org/r/usecase-ui/commits/45fe372))
+* add mock data routers config ([5d38fbf](https://gerrit.onap.org/r/usecase-ui/commits/5d38fbf))
+* change the mock data path config file ([0c1e82c](https://gerrit.onap.org/r/usecase-ui/commits/0c1e82c))
* change the project structure and add mock data function ([d0f5347](https://gerrit.onap.org/r/usecase-ui/commits/d0f5347))
+* customer page code optimization ([41747c4](https://gerrit.onap.org/r/usecase-ui/commits/41747c4))
+* home page code optimization ([5d9b41e](https://gerrit.onap.org/r/usecase-ui/commits/5d9b41e))
* Home page style optimization ([19a945d](https://gerrit.onap.org/r/usecase-ui/commits/19a945d))
+* optimization request function ([44b2c52](https://gerrit.onap.org/r/usecase-ui/commits/44b2c52))
* optimize e2e instance creation page code ([8464ca4](https://gerrit.onap.org/r/usecase-ui/commits/8464ca4))
-### BREAKING CHANGES
-* change the project structure
-* **mock:** this time, you can launch mock server easily by typing `npm run mock`!
+# [1.0.0](https://gerrit.onap.org/r/usecase-ui/compare/2.0.1...1.0.0) (2019-08-23)
+### Bug Fixes
-# [1.0.0](https://gerrit.onap.org/r/usecase-ui/compare/2.0.1...1.0.0) (2019-08-19)
+* fix bugs of positions of README.md ([ebd842c](https://gerrit.onap.org/r/usecase-ui/commits/ebd842c))
+* fix bugs of table spinner and delete usless codes ([8455cd5](https://gerrit.onap.org/r/usecase-ui/commits/8455cd5))
### Features
* add loading for page ([45fe372](https://gerrit.onap.org/r/usecase-ui/commits/45fe372))
+* change the project structure and add mock data function ([d0f5347](https://gerrit.onap.org/r/usecase-ui/commits/d0f5347))
* Home page style optimization ([19a945d](https://gerrit.onap.org/r/usecase-ui/commits/19a945d))
+* optimize e2e instance creation page code ([8464ca4](https://gerrit.onap.org/r/usecase-ui/commits/8464ca4))
+
+
+### BREAKING CHANGES
+
+* change the project structure
+* **mock:** this time, you can launch mock server easily by typing `npm run mock`!
+
+
diff --git a/usecaseui-portal/src/app/shared/utils/http.ts b/usecaseui-portal/src/app/shared/utils/http.ts
index c0fc3f29..0d63418b 100644
--- a/usecaseui-portal/src/app/shared/utils/http.ts
+++ b/usecaseui-portal/src/app/shared/utils/http.ts
@@ -1,32 +1,47 @@
-import axios from 'axios';
+/*
+ Copyright (C) 2019 CMCC, Inc. and others. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file 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.
+*/
+
+import axios from 'axios';
-export default function http (url:string,data:object = {},method:any = 'get',query?:string | object):any {
- return new Promise((resolve,reject) => {
+export default function http(url: string, data: object = {}, method: any = 'get', query?: string | object): any {
+ return new Promise((resolve, reject) => {
method = method.trim().toLocaleLowerCase()
- let promise:any;
- if(method === 'get' || method === 'delete'){
- let options:object;
- if(JSON.stringify(data) === '{}'){
+ let promise: any;
+ if (method === 'get' || method === 'delete') {
+ let options: object;
+ if (JSON.stringify(data) === '{}') {
options = { method, url };
- }else{
- options = { method, url, params: data};
+ } else {
+ options = { method, url, params: data };
}
- if(method === 'delete'){
+ if (method === 'delete') {
}
promise = axios(options);
- }else if (method === 'post' || method === 'put') {
- if(method === 'post' && query){
- let params:string = '';
- if(<string>query){
+ } else if (method === 'post' || method === 'put') {
+ if (method === 'post' && query) {
+ let params: string = '';
+ if (<string>query) {
query = JSON.parse((<string>query));
}
Object.keys(query).forEach(item => {
- params += '&' + item + '=' + query[item];
+ params += '&' + item + '=' + query[item];
})
params = params.slice(1);
url += '?' + params;
@@ -39,9 +54,9 @@ export default function http (url:string,data:object = {},method:any = 'get',que
}
promise
.then((response) => {
- if(response.status === 200 || 304){
+ if (response.status === 200 || 304) {
resolve(response.data)
- }else{
+ } else {
reject(response)
}
})
diff --git a/usecaseui-portal/src/app/shared/utils/utils.ts b/usecaseui-portal/src/app/shared/utils/utils.ts
index abdb9836..1aa9673e 100644
--- a/usecaseui-portal/src/app/shared/utils/utils.ts
+++ b/usecaseui-portal/src/app/shared/utils/utils.ts
@@ -1,4 +1,20 @@
-export class Util{
+/*
+ Copyright (C) 2019 CMCC, Inc. and others. All rights reserved.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file 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.
+*/
+
+export class Util {
// Time formatting milliseconds to normal
dateformater(vmstime) {
if (!vmstime) {