Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve log display #3768

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ module.exports = {
'import/no-extraneous-dependencies': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'import/no-unresolved': ['error', { ignore: ['\\.svg\\?react$'] }],
'import/no-unresolved': [
'error',
{ ignore: ['\\.svg\\?react$', '\\.txt\\?raw$'] }
],
'import/prefer-default-export': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'no-case-declarations': 'off',
Expand Down
127 changes: 100 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test": "vitest"
},
"dependencies": {
"@carbon/react": "^1.70.0",
"@carbon/react": "^1.71.0",
"@codemirror/legacy-modes": "^6.4.2",
"@tanstack/react-query": "^4.36.1",
"@tanstack/react-query-devtools": "^4.36.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import {

export default function ActionableNotification(props) {
return (
<FeatureFlags
flags={{ 'enable-experimental-focus-wrap-without-sentinels': true }}
>
<FeatureFlags enableExperimentalFocusWrapWithoutSentinels>
<CarbonActionableNotification {...props} />
</FeatureFlags>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { FormattedDate, FormattedRelativeTime, useIntl } from 'react-intl';
const FormattedDateWrapper = ({
date,
formatTooltip = formattedDate => formattedDate,
includeSeconds = false,
relative
}) => {
const intl = useIntl();
Expand Down Expand Up @@ -47,6 +48,7 @@ const FormattedDateWrapper = ({
year={yearFormat}
hour="numeric"
minute="numeric"
{...(includeSeconds ? { second: 'numeric' } : null)}
/>
);
}
Expand All @@ -56,7 +58,8 @@ const FormattedDateWrapper = ({
month: 'long',
year: 'numeric',
hour: 'numeric',
minute: 'numeric'
minute: 'numeric',
...(includeSeconds ? { second: 'numeric' } : null)
});
formattedDate = formatTooltip(formattedDate);
return <span title={formattedDate}>{content}</span>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ export const Relative = {
};

export const Absolute = {};

export const Seconds = {
args: {
includeSeconds: true
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,18 @@ describe('FormattedDate', () => {
});

it('handles absolute date formatting', () => {
const { queryByText } = render(<FormattedDate date="2019/12/01" />);
expect(queryByText(/Dec 1, 2019/i)).toBeTruthy();
const { queryByText } = render(
<FormattedDate date="2019/12/01 12:13:14" />
);
expect(queryByText(/Dec 1, 2019, 12:13/i)).toBeTruthy();
expect(queryByText(/:14/i)).toBeFalsy();
});

it('handles absolute date formatting with seconds', () => {
const { queryByText } = render(
<FormattedDate date="2019/12/01 12:13:14" includeSeconds />
);
expect(queryByText(/Dec 1, 2019, 12:13:14/i)).toBeTruthy();
});

it('handles absolute date formatting for current year', () => {
Expand Down
Loading