Skip to content

Commit

Permalink
Merge branch '6236/date-time-picker-default' of https://github.com/ke…
Browse files Browse the repository at this point in the history
…ystonejs/keystone into 6236/date-time-picker-default
  • Loading branch information
gwyneplaine committed Aug 2, 2021
2 parents 48ea817 + cca1315 commit 0bdf8ac
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-impalas-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-ui/segmented-control': patch
---

Fixed segmented-control focus style.
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ export const SegmentedControl = ({
<Root
css={css`
border: 1px solid #e1e5e9;
&:focus-within {
box-shadow: 0 0 0 2px #bfdbfe;
border: 1px solid #166bff;
}
`}
fill={fill}
size={size}
Expand Down
6 changes: 6 additions & 0 deletions docs/pages/docs/guides/custom-admin-ui-navigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ Keystone exposes a variety of helper components to make building out your custom

This component renders containing markup around your navigation links, as well as as the different states of the `authenticatedItem` prop.

```typescript
type NavigationContainerProps = {
authenticatedItem?: AuthenticatedItem;
}
```
!> For the shape of the `authenticatedItem` prop, please see the [Navigation Props](#navigation-props) section above.
```tsx
Expand Down
12 changes: 8 additions & 4 deletions packages/fields/src/types/timestamp/views/__tests__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ describe('controller', () => {
[STUBCONFIG.path]: null,
});
});
it('should return null if no timeValue is specified', () => {
it('should return a valid ISO8601 string if no timeValue is specified but a valid date value is specified', () => {
const { serialize } = controller(STUBCONFIG);
expect(serialize({ dateValue: '2020-10-20', timeValue: '' })).toStrictEqual({
[STUBCONFIG.path]: null,
});
expect(
Boolean(
parseISO(
serialize({ dateValue: '2020-10-20', timeValue: '' })[STUBCONFIG.path]
).toISOString()
)
).toBe(true);
});
it('should return a valid ISO8601 string if a valid time and date value are specified', () => {
const { serialize } = controller(STUBCONFIG);
Expand Down
4 changes: 2 additions & 2 deletions packages/keystone/src/admin-ui/components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const PopoverLink = ({ children, ...props }: AllHTMLAttributes<HTMLAnchorElement
);
};

export type NavigationContainerProps = Pick<NavigationProps, 'authenticatedItem'> & {
export type NavigationContainerProps = Partial<Pick<NavigationProps, 'authenticatedItem'>> & {
children: ReactNode;
};

Expand All @@ -139,7 +139,7 @@ export const NavigationContainer = ({ authenticatedItem, children }: NavigationC
justifyContent: 'center',
}}
>
{authenticatedItem.state === 'authenticated' && (
{authenticatedItem?.state === 'authenticated' && (
<AuthenticatedItem item={authenticatedItem} />
)}
<nav role="navigation" aria-label="Side Navigation" css={{ marginTop: spacing.xlarge }}>
Expand Down

0 comments on commit 0bdf8ac

Please sign in to comment.