From ffd6d1e39c36a2133d329b975d5fe588bba36d35 Mon Sep 17 00:00:00 2001 From: cyuamber Date: Thu, 12 Sep 2019 14:45:19 +0800 Subject: feat: optimize the local API and json data on the onboard page Change-Id: I7dc02560d381161ce5687e850ce2cf882c579b75 Issue-ID: USECASEUI-307 Signed-off-by: cyuamber --- .../src/app/mock/json/DELETE_uui-lcm_deleteNsdPackage.json | 5 +++++ .../src/app/mock/json/DELETE_uui-lcm_deletePnfPackage.json | 5 +++++ .../src/app/mock/json/DELETE_uui-lcm_deleteVnfPackage.json | 5 +++++ usecaseui-portal/src/app/mock/json/uui-lcm_deleteNsdPackage.json | 5 ----- usecaseui-portal/src/app/mock/json/uui-lcm_deletePnfPackage.json | 5 ----- usecaseui-portal/src/app/mock/json/uui-lcm_deleteVnfPackage.json | 5 ----- usecaseui-portal/src/app/mock/routes.js | 3 +++ usecaseui-portal/src/app/mock/server.js | 4 +++- 8 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deleteNsdPackage.json create mode 100644 usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deletePnfPackage.json create mode 100644 usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deleteVnfPackage.json delete mode 100644 usecaseui-portal/src/app/mock/json/uui-lcm_deleteNsdPackage.json delete mode 100644 usecaseui-portal/src/app/mock/json/uui-lcm_deletePnfPackage.json delete mode 100644 usecaseui-portal/src/app/mock/json/uui-lcm_deleteVnfPackage.json diff --git a/usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deleteNsdPackage.json b/usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deleteNsdPackage.json new file mode 100644 index 00000000..41c06ec5 --- /dev/null +++ b/usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deleteNsdPackage.json @@ -0,0 +1,5 @@ +{ + "status": "200", + "statusDescription": "success", + "errorCode": "1" +} \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deletePnfPackage.json b/usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deletePnfPackage.json new file mode 100644 index 00000000..41c06ec5 --- /dev/null +++ b/usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deletePnfPackage.json @@ -0,0 +1,5 @@ +{ + "status": "200", + "statusDescription": "success", + "errorCode": "1" +} \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deleteVnfPackage.json b/usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deleteVnfPackage.json new file mode 100644 index 00000000..41c06ec5 --- /dev/null +++ b/usecaseui-portal/src/app/mock/json/DELETE_uui-lcm_deleteVnfPackage.json @@ -0,0 +1,5 @@ +{ + "status": "200", + "statusDescription": "success", + "errorCode": "1" +} \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/json/uui-lcm_deleteNsdPackage.json b/usecaseui-portal/src/app/mock/json/uui-lcm_deleteNsdPackage.json deleted file mode 100644 index 41c06ec5..00000000 --- a/usecaseui-portal/src/app/mock/json/uui-lcm_deleteNsdPackage.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "status": "200", - "statusDescription": "success", - "errorCode": "1" -} \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/json/uui-lcm_deletePnfPackage.json b/usecaseui-portal/src/app/mock/json/uui-lcm_deletePnfPackage.json deleted file mode 100644 index 41c06ec5..00000000 --- a/usecaseui-portal/src/app/mock/json/uui-lcm_deletePnfPackage.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "status": "200", - "statusDescription": "success", - "errorCode": "1" -} \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/json/uui-lcm_deleteVnfPackage.json b/usecaseui-portal/src/app/mock/json/uui-lcm_deleteVnfPackage.json deleted file mode 100644 index 41c06ec5..00000000 --- a/usecaseui-portal/src/app/mock/json/uui-lcm_deleteVnfPackage.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "status": "200", - "statusDescription": "success", - "errorCode": "1" -} \ No newline at end of file diff --git a/usecaseui-portal/src/app/mock/routes.js b/usecaseui-portal/src/app/mock/routes.js index 07bbe3c8..29d7c008 100644 --- a/usecaseui-portal/src/app/mock/routes.js +++ b/usecaseui-portal/src/app/mock/routes.js @@ -68,6 +68,9 @@ module.exports = "/vnfpkgm/v1/vnf_packages/:vnfPkgId/package_content": "/nsd_content", "/nsd/v1/pnf_descriptors/:pnfdInfoId/pnfd_content": "/nsd_content", "/uui-lcm/jobs/:_jobId": "/uui-lcm_jobs_progress", + "/DELETE/uui-lcm/deleteNsdPackage?nsdInfoId:id": "/DELETE_uui-lcm_deleteNsdPackage", +        "/DELETE/uui-lcm/deleteVnfPackage?vnfPkgId:id": "/DELETE_uui-lcm_deleteVnfPackage", +        "/DELETE/uui-lcm/deletePnfPackage?pnfdInfoId:id": "/DELETE_uui-lcm_deletePnfPackage", ///////////////////////// diff --git a/usecaseui-portal/src/app/mock/server.js b/usecaseui-portal/src/app/mock/server.js index b603523f..eef7df16 100644 --- a/usecaseui-portal/src/app/mock/server.js +++ b/usecaseui-portal/src/app/mock/server.js @@ -101,7 +101,9 @@ server.put(`${baseUrl}/*`, (req, res, next) => { next(); }) server.delete(`${baseUrl}/*`, (req, res, next) => { - console.log("===delete😑") + const prefix = req.url.replace(baseUrl, ""); + req.url = `${baseUrl}/DELETE${prefix}`; + req.method = 'GET'; next(); }) -- cgit 1.2.3-korg