-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f26d165
commit 52dc521
Showing
11 changed files
with
207 additions
and
152 deletions.
There are no files selected for viewing
7 changes: 4 additions & 3 deletions
7
src/views/domain-page/config/domain-page-tabs-error.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/views/domain-workflows/domain-workflows-table/domain-workflows-table.constants.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
export const PAGE_SIZE = 10; | ||
|
||
export const NO_WORKFLOWS_ERROR_MESSAGE = 'Domain has no workflows'; |
15 changes: 14 additions & 1 deletion
15
src/views/domain-workflows/domain-workflows-table/domain-workflows-table.styles.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
import { styled as createStyled } from 'baseui'; | ||
import { styled as createStyled, withStyle } from 'baseui'; | ||
|
||
import PageSection from '@/components/page-section/page-section'; | ||
|
||
export const styled = { | ||
TableContainer: createStyled('div', { | ||
overflowX: 'auto', | ||
}), | ||
PageSection: withStyle(PageSection, () => ({ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
flex: 1, | ||
})), | ||
ErrorPanelContainer: createStyled('div', ({ $theme }) => ({ | ||
padding: `${$theme.sizing.scale1200} 0px`, | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
})), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...orkflows/domain-workflows-table/helpers/__tests__/get-workflows-error-panel-props.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import getWorkflowsErrorPanelProps from '../get-workflows-error-panel-props'; | ||
|
||
describe(getWorkflowsErrorPanelProps.name, () => { | ||
it('returns default error panel props for regular error', () => { | ||
expect( | ||
getWorkflowsErrorPanelProps({ | ||
error: new Error('Test error'), | ||
areSearchParamsAbsent: false, | ||
}) | ||
).toEqual({ | ||
message: 'Failed to fetch workflows', | ||
actions: [{ kind: 'retry', label: 'Retry' }], | ||
}); | ||
}); | ||
|
||
it('returns "not found" error panel props when search params are absent', () => { | ||
expect( | ||
getWorkflowsErrorPanelProps({ | ||
error: null, | ||
areSearchParamsAbsent: true, | ||
}) | ||
).toEqual({ | ||
message: 'No workflows found for this domain', | ||
omitLogging: true, | ||
actions: [ | ||
{ | ||
kind: 'link-external', | ||
label: 'Get started on workflows', | ||
link: 'https://cadenceworkflow.io/docs/concepts/workflows', | ||
}, | ||
], | ||
}); | ||
}); | ||
|
||
it('returns undefined in all other cases', () => { | ||
expect( | ||
getWorkflowsErrorPanelProps({ | ||
error: null, | ||
areSearchParamsAbsent: false, | ||
}) | ||
).toBeUndefined(); | ||
}); | ||
}); |
Oops, something went wrong.