Skip to content

Commit bc1846a

Browse files
author
Katia Aresti
committed
[#644] Truncate result values checkbox
1 parent 9f9b576 commit bc1846a

File tree

7 files changed

+30
-9
lines changed

7 files changed

+30
-9
lines changed

scripts/e2eTestsConfigLON.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
</authentication>
5959
</hotrod-connector>
6060
<rest-connector name="rest">
61-
<authentication mechanisms="BASIC DIGEST"/>
61+
<authentication mechanisms="BASIC DIGEST-SHA-256"/>
6262
</rest-connector>
6363
</endpoint>
6464
</endpoints>

scripts/e2eTestsConfigNYC.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</authentication>
1616
</hotrod-connector>
1717
<rest-connector name="rest">
18-
<authentication mechanisms="BASIC DIGEST"/>
18+
<authentication mechanisms="BASIC DIGEST-SHA-256"/>
1919
</rest-connector>
2020
</endpoint>
2121
</endpoints>

scripts/infinispan-local.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</authentication>
4545
</hotrod-connector>
4646
<rest-connector name="rest">
47-
<authentication mechanisms="BASIC DIGEST"/>
47+
<authentication mechanisms="BASIC DIGEST-SHA-256"/>
4848
</rest-connector>
4949
</endpoint>
5050
</endpoints>

src/app/Caches/Entries/CacheEntries.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ import {
2424
ToolbarGroup,
2525
ToolbarItem,
2626
ToolbarToggleGroup,
27-
Tooltip,
28-
Truncate
27+
Tooltip
2928
} from '@patternfly/react-core';
3029
import { ActionsColumn, Table, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table';
3130
import { FilterIcon, HelpIcon, PlusCircleIcon, SearchIcon } from '@patternfly/react-icons';

src/app/Caches/Query/QueryEntries.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
ButtonVariant,
55
Card,
66
CardBody,
7+
Checkbox,
78
Divider,
89
EmptyState,
910
EmptyStateBody,
@@ -32,6 +33,8 @@ const QueryEntries = (props: { cacheName: string; changeTab: () => void }) => {
3233
const { search, setSearch } = useSearch(props.cacheName);
3334
const { syntaxHighLighterTheme } = useContext(ThemeContext);
3435
const [deleteByQueryOpen, setDeleteByQueryOpen] = useState(false);
36+
const [trim, setTrim] = useState<boolean>(false);
37+
3538
const columnNames = {
3639
value: 'Value'
3740
};
@@ -44,7 +47,7 @@ const QueryEntries = (props: { cacheName: string; changeTab: () => void }) => {
4447
useInlineStyles={true}
4548
wrapLongLines={true}
4649
>
47-
{displayUtils.formatContentToDisplay(value)}
50+
{trim ? displayUtils.formatContentToDisplayWithTruncate(value) : displayUtils.formatContentToDisplay(value)}
4851
</SyntaxHighlighter>
4952
);
5053
};
@@ -177,6 +180,16 @@ const QueryEntries = (props: { cacheName: string; changeTab: () => void }) => {
177180
{buildButtons()}
178181
<ToolbarItem variant="pagination">{toolbarPagination('down')}</ToolbarItem>
179182
</ToolbarContent>
183+
<ToolbarContent>
184+
<ToolbarItem>
185+
<Checkbox
186+
labelPosition="start"
187+
label={t('caches.query.truncate-results')}
188+
id="checkbox-trim"
189+
onClick={() => setTrim(!trim)}
190+
/>
191+
</ToolbarItem>
192+
</ToolbarContent>
180193
</Toolbar>
181194
);
182195

src/app/assets/languages/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@
693693
"stat-count": "Count",
694694
"stat-average": "Average",
695695
"stat-slowest": "Slowest",
696+
"truncate-results": "Truncate results",
696697
"modal-clear-stats": "Permanently clear query metrics?",
697698
"modal-clear-stats-label": "Clear query metrics modal",
698699
"modal-button-clear-stats": "Clear metrics",

src/services/authService.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,27 @@ export class AuthenticationService {
3737
throw response;
3838
})
3939
.then((json) => {
40-
const jsonLength = Object.keys(json).length;
40+
const jsonKeys = Object.keys(json);
41+
const jsonLength = jsonKeys.length;
4142
if (jsonLength <= 1 || (jsonLength == 2 && json.mode === 'HTTP' && json.ready === 'true')) {
4243
return right(<AuthInfo>{
4344
mode: 'auth_disabled',
4445
ready: true,
4546
digest: false
4647
}) as Either<ActionResponse, AuthInfo>;
4748
}
48-
49+
let digest = false;
50+
for (const key of jsonKeys) {
51+
if (key.startsWith('DIGEST')) {
52+
digest = true;
53+
break;
54+
}
55+
}
56+
console.log(digest);
4957
const authInfo = <AuthInfo>{
5058
mode: json.mode,
5159
ready: json.ready == 'true',
52-
digest: json.DIGEST == 'true'
60+
digest: digest
5361
};
5462

5563
if (authInfo.mode == 'OIDC') {

0 commit comments

Comments
 (0)