Skip to content

Commit

Permalink
fix: Use native UrlSearchParams instead of deprecated UriParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
flovogt committed Jun 12, 2024
1 parent 4547de9 commit 02c4cc0
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 42 deletions.
5 changes: 2 additions & 3 deletions steps/26/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ Finally, we call the `start` method on the `MockServer`. From this point, each r

```ts
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -151,12 +150,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/26/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/27/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/28/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/29/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/30/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/31/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/32/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/33/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/34/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/35/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/36/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/37/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down
5 changes: 2 additions & 3 deletions steps/38/webapp/localService/mockserver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import MockServer from "sap/ui/core/util/MockServer";
import UriParameters from "sap/base/util/UriParameters";

export default {
init: function () {
Expand All @@ -8,12 +7,12 @@ export default {
rootUri: sap.ui.require.toUrl("ui5/walkthrough/V2/Northwind/Northwind.svc/")
});

const uriParameters = new UriParameters(window.location.href);
const urlParams = new URLSearchParams(window.location.search);

// configure mock server with a delay
MockServer.config({
autoRespond: true,
autoRespondAfter: parseInt(uriParameters.get("serverDelay") || "500")
autoRespondAfter: parseInt(urlParams.get("serverDelay") || "500")
});

// simulate
Expand Down

0 comments on commit 02c4cc0

Please sign in to comment.