Skip to content

Commit 9949a09

Browse files
committed
Disable by default the text wrapping in the logfile view and fix typo for the 'scrollSubcription' data variable
1 parent 6924ffd commit 9949a09

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { screen, waitFor } from '@testing-library/vue';
2+
import { beforeEach, describe, expect, it } from 'vitest';
3+
4+
import { applications } from '@/mocks/applications/data';
5+
import Application from '@/services/application';
6+
import { render } from '@/test-utils';
7+
import LogFile from '@/views/instances/logfile/index.vue';
8+
9+
describe('LogFile', () => {
10+
beforeEach(async () => {
11+
const application = new Application(applications[0]);
12+
const instance = application.instances[0];
13+
14+
render(LogFile, {
15+
props: {
16+
instance,
17+
},
18+
});
19+
});
20+
21+
it('disables the wrap lines by default', async () => {
22+
const checkbox = await screen.findByRole('checkbox', {
23+
name: 'instances.logfile.wrap_lines',
24+
});
25+
await waitFor(() => {
26+
expect(checkbox).not.toBeChecked();
27+
});
28+
});
29+
});

spring-boot-admin-server-ui/src/main/frontend/views/instances/logfile/index.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ export default {
130130
atBottom: false,
131131
atTop: true,
132132
skippedBytes: null,
133-
wrapLines: true,
134-
scrollSubcription: null,
133+
wrapLines: false,
134+
scrollSubscription: null,
135135
}),
136136
computed: {
137137
skippedBytesString() {
@@ -143,7 +143,7 @@ export default {
143143
},
144144
created() {
145145
this.ansiUp = new AnsiUp();
146-
this.scrollSubcription = fromEvent(window, 'scroll')
146+
this.scrollSubscription = fromEvent(window, 'scroll')
147147
.pipe(
148148
debounceTime(25),
149149
map((event) => event.target.scrollingElement.scrollTop),
@@ -157,11 +157,11 @@ export default {
157157
});
158158
},
159159
beforeUnmount() {
160-
if (this.scrollSubcription && !this.scrollSubcription.closed) {
160+
if (this.scrollSubscription && !this.scrollSubscription.closed) {
161161
try {
162-
this.scrollSubcription.unsubscribe();
162+
this.scrollSubscription.unsubscribe();
163163
} finally {
164-
this.scrollSubcription = null;
164+
this.scrollSubscription = null;
165165
}
166166
}
167167
},

0 commit comments

Comments
 (0)