Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dwertheimer committed Nov 20, 2024
1 parent 2e1628e commit 65d3520
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions helpers/react/ConsoleLogView.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,8 @@
.log-timestamp {
color: #cfcece;
padding-right: 10px;
}

button.active {
background-color: #007bff;
}
10 changes: 7 additions & 3 deletions helpers/react/ConsoleLogView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const ConsoleLogView = ({ logs = [], filter, initialFilter = '', initialSearch =
const regex = useRegexFilter ? new RegExp(filterText, 'i') : null
newFilteredLogs = newFilteredLogs.filter((log) => (regex ? regex.test(log.message) : log.message.toLowerCase().includes(filterText.toLowerCase())))
} catch (e) {
// Invalid regex, ignore filter
console.error('Invalid regex:', e)
}
}
return newFilteredLogs
Expand Down Expand Up @@ -321,12 +321,16 @@ const ConsoleLogView = ({ logs = [], filter, initialFilter = '', initialSearch =
<div className="control-group">
<label>Filter:</label>
<input ref={filterInputRef} type="text" value={filterText} onChange={handleFilterChange} placeholder="Filter logs" />
<button onClick={() => setUseRegexFilter(!useRegexFilter)}>.*</button>
<button onClick={() => setUseRegexFilter(!useRegexFilter)} className={useRegexFilter ? 'active' : ''}>
.*
</button>
</div>
<div className="control-group">
<label>Search:</label>
<input ref={searchInputRef} type="text" value={searchText} onChange={handleSearchChange} placeholder="Search logs" />
<button onClick={() => setUseRegexSearch(!useRegexSearch)}>.*</button>
<button onClick={() => setUseRegexSearch(!useRegexSearch)} className={useRegexSearch ? 'active' : ''}>
.*
</button>
<button onClick={() => navigateSearchMatches('prev')}>Prev</button>
<button onClick={() => navigateSearchMatches('next')}>Next</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ module.exports = {
'^.+\\.mjs$': 'babel-jest', // Use babel-jest for .mjs files as well
},
transformIgnorePatterns: [
'/node_modules/(?!node-notifier|uuid)/', // Ensure these modules are transformed
'/node_modules/(?!(node-notifier|uuid|lodash-es)/)', // Ensure these modules are transformed
],
}
2 changes: 1 addition & 1 deletion jgclark.Dashboard/src/react/components/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const Header = ({ lastFullRefresh }: Props): React$Node => {
...tempDashboardSettings,
...updatedSettings,
}
clo(newSettings, 'Header/handleChangesInSettings about to dispatch newSettings=')
console.log('Header/handleChangesInSettings about to dispatch newSettings=', { newSettings })
dispatchDashboardSettings({
type: DASHBOARD_ACTIONS.UPDATE_DASHBOARD_SETTINGS,
payload: newSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { TSettingItem } from '../../types'
* Mock implementation of renderItem used in DropdownMenu.
* Adjust this mock as per your actual implementation.
*/
jest.mock('../../support/uiElementRenderHelpersq', () => ({
jest.mock('../../support/uiElementRenderHelpers', () => ({
renderItem: jest.fn(({ item }) => <div>{item.label}</div>),
}))

Expand Down

0 comments on commit 65d3520

Please sign in to comment.