= (props) => {
const checkboxList =
filteredValues.length === 0 ? (inputValueRef.current.length === 0 ? uniqueValues : []) : filteredValues;
+
+ const onToggleWrap = () => {
+ setLogsStore((store) => toggleWrapDisabledColumns(store, columnName));
+ };
+ const wordWrapEnabled = _.includes(wrapDisabledColumns, columnName);
return (
-
-
-
- Filter by values:
+
+
+ Word Wrap
+
+
+
+
+
+ Filter by values:
+
+ }
+ onChange={onSearch}
+ mt={8}
+ />
+ {checkboxList.length ? (
+
+
+
+
+
+
+ ) : (
+
+ )}
- }
- onChange={onSearch}
- mt={8}
- />
- {checkboxList.length ? (
-
-
-
-
-
-
- ) : (
-
- )}
-
+
);
};
diff --git a/src/pages/Stream/providers/LogsProvider.tsx b/src/pages/Stream/providers/LogsProvider.tsx
index 0a81054e..6d7e7ff7 100644
--- a/src/pages/Stream/providers/LogsProvider.tsx
+++ b/src/pages/Stream/providers/LogsProvider.tsx
@@ -196,6 +196,7 @@ type LogsStore = {
tableOpts: {
disabledColumns: string[];
+ wrapDisabledColumns: string[];
pinnedColumns: string[];
pageData: Log[];
totalPages: number;
@@ -252,6 +253,7 @@ type LogsStoreReducers = {
// table opts reducers
toggleDisabledColumns: (store: LogsStore, columnName: string) => ReducerOutput;
+ toggleWrapDisabledColumns: (store: LogsStore, columnName: string) => ReducerOutput;
togglePinnedColumns: (store: LogsStore, columnName: string) => ReducerOutput;
setCurrentOffset: (store: LogsStore, offset: number) => ReducerOutput;
setPerPage: (store: LogsStore, perPage: number) => ReducerOutput;
@@ -309,6 +311,7 @@ const initialState: LogsStore = {
tableOpts: {
disabledColumns: [],
+ wrapDisabledColumns: [],
pinnedColumns: [],
pageData: [],
perPage: 50,
@@ -487,6 +490,16 @@ const toggleDisabledColumns = (store: LogsStore, columnName: string) => {
};
};
+const toggleWrapDisabledColumns = (store: LogsStore, columnName: string) => {
+ const { tableOpts } = store;
+ return {
+ tableOpts: {
+ ...tableOpts,
+ wrapDisabledColumns: addOrRemoveElement(tableOpts.wrapDisabledColumns, columnName),
+ },
+ };
+};
+
const setDisabledColumns = (store: LogsStore, columns: string[]) => {
return {
tableOpts: {
@@ -688,6 +701,7 @@ const setCleanStoreForStreamChange = (store: LogsStore) => {
totalPages: 0,
orderedHeaders: [],
disabledColumns: [],
+ wrapDisabledColumns: [],
pinnedColumns: [],
filters: {},
},
@@ -981,6 +995,7 @@ const logsStoreReducers: LogsStoreReducers = {
setDisabledColumns,
setOrderedHeaders,
toggleWordWrap,
+ toggleWrapDisabledColumns
};
export { LogsProvider, useLogsStore, logsStoreReducers };