docs: add copyright info and changelog 29/94729/1
authorcyuamber <xuranyjy@chinamobile.com>
Sun, 1 Sep 2019 14:05:42 +0000 (22:05 +0800)
committercyuamber <xuranyjy@chinamobile.com>
Sun, 1 Sep 2019 14:05:48 +0000 (22:05 +0800)
Change-Id: Ie2c7aa97aaf99c7a274f5ca45366f549223ba028
Issue-ID: USECASEUI-307
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
usecaseui-portal/CHANGELOG.md
usecaseui-portal/src/app/shared/utils/http.ts
usecaseui-portal/src/app/shared/utils/utils.ts

index adbdd35..aa20db7 100644 (file)
@@ -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`!
+
+
 
index c0fc3f2..0d63418 100644 (file)
@@ -1,32 +1,47 @@
-import axios from 'axios';\r
+/*\r
+    Copyright (C) 2019 CMCC, Inc. and others. All rights reserved.\r
+\r
+    Licensed under the Apache License, Version 2.0 (the "License");\r
+    you may not use this file except in compliance with the License.\r
+    You may obtain a copy of the License at\r
+\r
+            http://www.apache.org/licenses/LICENSE-2.0\r
 \r
+    Unless required by applicable law or agreed to in writing, software\r
+    distributed under the License is distributed on an "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+    See the License for the specific language governing permissions and\r
+    limitations under the License.\r
+*/\r
+\r
+import axios from 'axios';\r
 \r
-export default function http (url:string,data:object = {},method:any = 'get',query?:string | object):any {\r
-  return new Promise((resolve,reject) => {\r
+export default function http(url: string, data: object = {}, method: any = 'get', query?: string | object): any {\r
+  return new Promise((resolve, reject) => {\r
     method = method.trim().toLocaleLowerCase()\r
-    let promise:any;\r
-    if(method === 'get' || method === 'delete'){\r
-      let options:object;\r
-      if(JSON.stringify(data) === '{}'){\r
+    let promise: any;\r
+    if (method === 'get' || method === 'delete') {\r
+      let options: object;\r
+      if (JSON.stringify(data) === '{}') {\r
         options = { method, url };\r
-      }else{\r
-        options = { method, url, params: data};\r
+      } else {\r
+        options = { method, url, params: data };\r
       }\r
 \r
-      if(method === 'delete'){\r
+      if (method === 'delete') {\r
 \r
       }\r
 \r
       promise = axios(options);\r
 \r
-    }else if (method === 'post' || method === 'put') {\r
-      if(method === 'post' && query){\r
-        let params:string = '';\r
-        if(<string>query){\r
+    } else if (method === 'post' || method === 'put') {\r
+      if (method === 'post' && query) {\r
+        let params: string = '';\r
+        if (<string>query) {\r
           query = JSON.parse((<string>query));\r
         }\r
         Object.keys(query).forEach(item => {\r
-          params += '&' + item + '=' + query[item]; \r
+          params += '&' + item + '=' + query[item];\r
         })\r
         params = params.slice(1);\r
         url += '?' + params;\r
@@ -39,9 +54,9 @@ export default function http (url:string,data:object = {},method:any = 'get',que
     }\r
     promise\r
       .then((response) => {\r
-        if(response.status === 200 || 304){\r
+        if (response.status === 200 || 304) {\r
           resolve(response.data)\r
-        }else{\r
+        } else {\r
           reject(response)\r
         }\r
       })\r
index abdb983..1aa9673 100644 (file)
@@ -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) {