Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit e5ee884

Browse files
committed
Use ApplicationType in SharedAppService#getApps() rather than any type
1 parent e1b2e96 commit e5ee884

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

ui/src/app/shared/services/shared-apps.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ export class SharedAppsService {
2323
/**
2424
* Returns a paged list of {@link AppRegistrations}s.
2525
*/
26-
getApps(pageRequest: PageRequest, type?: any, search?: string,
26+
getApps(pageRequest: PageRequest, type?: ApplicationType, search?: string,
2727
sort?: Array<{ sort: string, order: string }>): Observable<Page<AppRegistration>> {
2828
const params = HttpUtils.getPaginationParams(pageRequest.page, pageRequest.size);
2929
const requestOptionsArgs: RequestOptionsArgs = HttpUtils.getDefaultRequestOptions();
3030

3131
if (type) {
32-
params.append('type', type);
32+
params.append('type', ApplicationType[type]);
3333
}
3434
if (search) {
3535
params.append('search', search);

ui/src/app/tasks/flo/render.service.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,16 @@ export class RenderService implements Flo.Renderer {
192192

193193
document.body.appendChild(svgDocument);
194194

195-
width = textSpan.getComputedTextLength();
196-
for (let i = 1; i < width && width > threshold; i++) {
197-
textNode.data = label.substr(0, label.length - i) + '\u2026';
195+
try {
198196
width = textSpan.getComputedTextLength();
197+
for (let i = 1; i < width && width > threshold; i++) {
198+
textNode.data = label.substr(0, label.length - i) + '\u2026';
199+
width = textSpan.getComputedTextLength();
200+
}
201+
(<any>node).attr(labelPath, textNode.data);
202+
} finally {
203+
document.body.removeChild(svgDocument);
199204
}
200-
201-
(<any>node).attr(labelPath, textNode.data);
202205
}
203206
}
204207
}

ui/src/app/tasks/tasks.service.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,8 @@ export class TasksService {
111111
}
112112

113113
getTaskAppRegistrations(): Observable<Page<AppRegistration>> {
114-
const type = ApplicationType[ApplicationType.task.toString()];
115114
return this.sharedAppsService.getApps(
116-
new PageRequest(this.appRegistrations.pageNumber, this.appRegistrations.pageSize), type).map(
115+
new PageRequest(this.appRegistrations.pageNumber, this.appRegistrations.pageSize), ApplicationType.task).map(
117116
appRegistrations => {
118117
this.appRegistrations = appRegistrations;
119118
return appRegistrations;

ui/src/app/tests/mocks/shared-app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class MockSharedAppService extends SharedAppsService {
110110
super(null, null);
111111
}
112112

113-
getApps(pageRequest: PageRequest, type?: any, search?: string,
113+
getApps(pageRequest: PageRequest, type?: ApplicationType, search?: string,
114114
sort?: Array<{ sort: string, order: string }>): Observable<Page<AppRegistration>> {
115115

116116
const page = new Page<AppRegistration>();

0 commit comments

Comments
 (0)