summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuyi Guo <guochuyi@chinamobile.com>2019-08-30 09:22:17 +0000
committerGerrit Code Review <gerrit@onap.org>2019-08-30 09:22:17 +0000
commite1f0160baa1f38cdb35705a39a0d42dc6d67f63d (patch)
treea170410a9505d73a5a75a1f2799c2f036d8e639f
parent264c3bc0f9cf7278c70327cebba8f5a482c30c4c (diff)
parent2bc671f0b8f5c8559ad67fa9b5fb398cd649ec2b (diff)
Merge "docs: add copyright info into mock files"
-rw-r--r--usecaseui-portal/src/app/mock/fake/fakedata.js16
-rw-r--r--usecaseui-portal/src/app/mock/fake/mock.js16
-rw-r--r--usecaseui-portal/src/app/mock/routes.js16
-rw-r--r--usecaseui-portal/src/app/mock/server.js32
4 files changed, 64 insertions, 16 deletions
diff --git a/usecaseui-portal/src/app/mock/fake/fakedata.js b/usecaseui-portal/src/app/mock/fake/fakedata.js
index 3fc3a588..adc1876b 100644
--- a/usecaseui-portal/src/app/mock/fake/fakedata.js
+++ b/usecaseui-portal/src/app/mock/fake/fakedata.js
@@ -1,3 +1,19 @@
+/*
+ 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.
+*/
+
const faker = require("faker");
const _ = require("lodash");
faker.locale = "en";
diff --git a/usecaseui-portal/src/app/mock/fake/mock.js b/usecaseui-portal/src/app/mock/fake/mock.js
index 74b9fc9f..e30215e3 100644
--- a/usecaseui-portal/src/app/mock/fake/mock.js
+++ b/usecaseui-portal/src/app/mock/fake/mock.js
@@ -1,3 +1,19 @@
+/*
+ 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.
+*/
+
const fakeData = require('./fakedata.js');
module.exports = {
//Mock json
diff --git a/usecaseui-portal/src/app/mock/routes.js b/usecaseui-portal/src/app/mock/routes.js
index 11dedb0f..97283fca 100644
--- a/usecaseui-portal/src/app/mock/routes.js
+++ b/usecaseui-portal/src/app/mock/routes.js
@@ -1,3 +1,19 @@
+/*
+ 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.
+*/
+
// proxy routers setting
module.exports =
{
diff --git a/usecaseui-portal/src/app/mock/server.js b/usecaseui-portal/src/app/mock/server.js
index b993734c..f0c46fb3 100644
--- a/usecaseui-portal/src/app/mock/server.js
+++ b/usecaseui-portal/src/app/mock/server.js
@@ -1,3 +1,19 @@
+/*
+ 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.
+*/
+
const jsonServer = require('json-server');
const server = jsonServer.create();
const middlewares = jsonServer.defaults();
@@ -19,8 +35,6 @@ fileDisplay(filePath);
function fileDisplay(filePath) {
let fileList = [];
- // let originPath = [];
- // let rewriter = {};
// Return filelist on based of filePath
const files = fs.readdirSync(filePath);
files.forEach((filename) => {
@@ -36,11 +50,6 @@ function fileDisplay(filePath) {
if (isFile) {
fileList.push(path.basename(filedir, '.json'));
fileList.forEach(item => {
- // let paser = item.split("_").join("/");
- // originPath.push({ route: `/${paser}`, origin: `/${item}` })
- // originPath.map(route => {
- // rewriter[route.route] = route.origin;
- // })
localJsonDb[item] = getjsonContent(item);
})
}
@@ -55,7 +64,6 @@ function fileDisplay(filePath) {
})
})
setTimeout(() => {
- // serverRewrite(rewriter);
serverRewrite();
runServer(localJsonDb);
}, 100)
@@ -68,15 +76,7 @@ function getjsonContent(path) {
//only multi router data needs jsonServer.rewriter
function serverRewrite() {
- // let routerpathArr = routerpath;
- // rewrite mock multiple routers here
- // Object.keys(fakeoriginalData).map(item => {
- // let newPath = item.split("_").join("/")
- // routerpathArr[`/${newPath}`] = `/${item}`;
- // })
- //start to rewrite routers
server.use(jsonServer.rewriter(customersRouters))
- // server.use(jsonServer.rewriter(routerpathArr));
}
function runServer(db) {