Skip to content

Commit 11c6ea9

Browse files
Removed encoding of request to retrieve files and folders by path, to avoid double encoding via the typed client (#19457)
* Removed encoding of request to retrieve files and folders by path, to avoid double encoding via the typed client. * fix: adjusts log viewer to encode only once and remove empty properties --------- Co-authored-by: Jacob Overgaard <[email protected]>
1 parent ebe93fb commit 11c6ea9

File tree

11 files changed

+28
-20
lines changed

11 files changed

+28
-20
lines changed

src/Umbraco.Web.UI.Client/src/packages/log-viewer/repository/sources/log-viewer.server.data.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,15 @@ export class UmbLogMessagesServerDataSource implements LogMessagesDataSource {
146146
return await tryExecute(
147147
this.#host,
148148
LogViewerService.getLogViewerLog({
149-
query: { skip, take, orderDirection, filterExpression, logLevel, startDate, endDate },
149+
query: {
150+
skip,
151+
take,
152+
orderDirection,
153+
filterExpression,
154+
logLevel: logLevel?.length ? logLevel : undefined,
155+
startDate,
156+
endDate,
157+
},
150158
}),
151159
);
152160
}

src/Umbraco.Web.UI.Client/src/packages/log-viewer/workspace/views/search/components/log-viewer-message.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class UmbLogViewerMessageElement extends UmbLitElement {
110110

111111
query = {
112112
...query,
113-
lq: encodeURIComponent(`${name}=${sanitizedValue}`),
113+
lq: `${name}=${sanitizedValue}`,
114114
};
115115

116116
const queryString = toQueryString(query);

src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/rename/rename-partial-view.server.data-source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class UmbRenamePartialViewServerDataSource {
3939
const { data, error } = await tryExecute(
4040
this.#host,
4141
PartialViewService.putPartialViewByPathRename({
42-
path: { path: encodeURIComponent(path) },
42+
path: { path },
4343
body,
4444
}),
4545
);

src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.server.data-source.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class UmbPartialViewDetailServerDataSource implements UmbDetailDataSource
7070

7171
const { data, error } = await tryExecute(
7272
this.#host,
73-
PartialViewService.getPartialViewByPath({ path: { path: encodeURIComponent(path) } }),
73+
PartialViewService.getPartialViewByPath({ path: { path } }),
7474
);
7575

7676
if (error || !data) {
@@ -100,7 +100,7 @@ export class UmbPartialViewDetailServerDataSource implements UmbDetailDataSource
100100
const { error } = await tryExecute(
101101
this.#host,
102102
PartialViewService.putPartialViewByPath({
103-
path: { path: encodeURIComponent(path) },
103+
path: { path },
104104
body,
105105
}),
106106
);
@@ -121,7 +121,7 @@ export class UmbPartialViewDetailServerDataSource implements UmbDetailDataSource
121121
return tryExecute(
122122
this.#host,
123123
PartialViewService.deletePartialViewByPath({
124-
path: { path: encodeURIComponent(path) },
124+
path: { path },
125125
}),
126126
);
127127
}

src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/folder/repository/partial-view-folder.server.data-source.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class UmbPartialViewFolderServerDataSource implements UmbDetailDataSource
5858
const { data, error } = await tryExecute(
5959
this.#host,
6060
PartialViewService.getPartialViewFolderByPath({
61-
path: { path: encodeURIComponent(path) },
61+
path: { path },
6262
}),
6363
);
6464

@@ -125,7 +125,7 @@ export class UmbPartialViewFolderServerDataSource implements UmbDetailDataSource
125125
return tryExecute(
126126
this.#host,
127127
PartialViewService.deletePartialViewFolderByPath({
128-
path: { path: encodeURIComponent(path) },
128+
path: { path },
129129
}),
130130
);
131131
}

src/Umbraco.Web.UI.Client/src/packages/templating/scripts/entity-actions/rename/rename-script.server.data-source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class UmbRenameScriptServerDataSource {
3939
const { data, error } = await tryExecute(
4040
this.#host,
4141
ScriptService.putScriptByPathRename({
42-
path: { path: encodeURIComponent(path) },
42+
path: { path },
4343
body,
4444
}),
4545
);

src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.server.data-source.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class UmbScriptDetailServerDataSource implements UmbDetailDataSource<UmbS
6767

6868
const { data, error } = await tryExecute(
6969
this.#host,
70-
ScriptService.getScriptByPath({ path: { path: encodeURIComponent(path) } }),
70+
ScriptService.getScriptByPath({ path: { path } }),
7171
);
7272

7373
if (error || !data) {
@@ -97,7 +97,7 @@ export class UmbScriptDetailServerDataSource implements UmbDetailDataSource<UmbS
9797
const { error } = await tryExecute(
9898
this.#host,
9999
ScriptService.putScriptByPath({
100-
path: { path: encodeURIComponent(path) },
100+
path: { path },
101101
body,
102102
}),
103103
);
@@ -118,7 +118,7 @@ export class UmbScriptDetailServerDataSource implements UmbDetailDataSource<UmbS
118118
return tryExecute(
119119
this.#host,
120120
ScriptService.deleteScriptByPath({
121-
path: { path: encodeURIComponent(path) },
121+
path: { path },
122122
}),
123123
);
124124
}

src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/folder/repository/script-folder.server.data-source.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class UmbScriptFolderServerDataSource implements UmbDetailDataSource<UmbF
5858
const { data, error } = await tryExecute(
5959
this.#host,
6060
ScriptService.getScriptFolderByPath({
61-
path: { path: encodeURIComponent(path) },
61+
path: { path },
6262
}),
6363
);
6464

@@ -124,7 +124,7 @@ export class UmbScriptFolderServerDataSource implements UmbDetailDataSource<UmbF
124124
return tryExecute(
125125
this.#host,
126126
ScriptService.deleteScriptFolderByPath({
127-
path: { path: encodeURIComponent(path) },
127+
path: { path },
128128
}),
129129
);
130130
}

src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/rename/rename-stylesheet.server.data-source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class UmbRenameStylesheetServerDataSource {
3939
const { data, error } = await tryExecute(
4040
this.#host,
4141
StylesheetService.putStylesheetByPathRename({
42-
path: { path: encodeURIComponent(path) },
42+
path: { path },
4343
body,
4444
}),
4545
);

src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.server.data-source.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class UmbStylesheetDetailServerDataSource implements UmbDetailDataSource<
7070

7171
const { data, error } = await tryExecute(
7272
this.#host,
73-
StylesheetService.getStylesheetByPath({ path: { path: encodeURIComponent(path) } }),
73+
StylesheetService.getStylesheetByPath({ path: { path } }),
7474
);
7575

7676
if (error || !data) {
@@ -100,7 +100,7 @@ export class UmbStylesheetDetailServerDataSource implements UmbDetailDataSource<
100100
const { error } = await tryExecute(
101101
this.#host,
102102
StylesheetService.putStylesheetByPath({
103-
path: { path: encodeURIComponent(path) },
103+
path: { path },
104104
body,
105105
}),
106106
);
@@ -121,7 +121,7 @@ export class UmbStylesheetDetailServerDataSource implements UmbDetailDataSource<
121121
return tryExecute(
122122
this.#host,
123123
StylesheetService.deleteStylesheetByPath({
124-
path: { path: encodeURIComponent(path) },
124+
path: { path },
125125
}),
126126
);
127127
}

0 commit comments

Comments
 (0)