-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NEW-GUI pipelines and projects pages - project and pipeline cards (#3780
, #3781)
- Loading branch information
1 parent
9294e4b
commit 0fcbce9
Showing
8 changed files
with
204 additions
and
85 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
portals-ui/packages/components/lib/components/status-icon/index.tsx
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,41 @@ | ||
import { RunStatuses } from '@cloud-pipeline/core'; | ||
import type { CommonProps } from '../common.types'; | ||
import classNames from 'classnames'; | ||
|
||
type StatusIconProps = CommonProps & { | ||
status: RunStatuses; | ||
radius?: number; | ||
strokeWidth?: number; | ||
}; | ||
|
||
const statusClassNames: Record<RunStatuses, string> = { | ||
[RunStatuses.success]: 'fill-green-600 stroke-green-600', | ||
[RunStatuses.running]: 'fill-transparent stroke-green-600', | ||
[RunStatuses.failure]: 'fill-red-600 stroke-red-600', | ||
[RunStatuses.stopped]: 'fill-transparent stroke-red-600', | ||
[RunStatuses.resuming]: 'fill-sky-600 stroke-sky-600', | ||
[RunStatuses.paused]: 'fill-slate-400 stroke-slate-400', | ||
[RunStatuses.pausing]: 'fill-sky-600 stroke-sky-600', | ||
}; | ||
|
||
export function StatusIcon({ | ||
radius = 5, | ||
strokeWidth = 3, | ||
className, | ||
style, | ||
status, | ||
}: StatusIconProps) { | ||
return ( | ||
<svg | ||
className={classNames( | ||
className, | ||
statusClassNames[status], | ||
'rounded-full', | ||
)} | ||
style={style} | ||
height={radius * 2} | ||
width={radius * 2}> | ||
<circle cx={radius} cy={radius} r={radius} strokeWidth={strokeWidth} /> | ||
</svg> | ||
); | ||
} |
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,11 +1,12 @@ | ||
import List, { ListHeader } from './components/list'; | ||
import type { UserCardProps } from './components/user-card'; | ||
import { UserCard } from './components/user-card'; | ||
import { StatusIcon } from './components/status-icon'; | ||
import '@epam/uui-components/styles.css'; | ||
import '@epam/uui/styles.css'; | ||
import './style.css'; | ||
|
||
export { List, UserCard, ListHeader }; | ||
export { List, UserCard, ListHeader, StatusIcon }; | ||
export type { UserCardProps }; | ||
export type * from './components/common.types'; | ||
export type * from './components/list/types'; |
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,15 @@ | ||
import dayjs from 'dayjs'; | ||
import utc from 'dayjs/plugin/utc'; | ||
|
||
dayjs.extend(utc); | ||
|
||
const displayFormat = 'YYYY-MM-DD, HH:mm:ss'; | ||
|
||
const displayDate = (date: string, format: string = displayFormat): string => { | ||
if (!date) { | ||
return ''; | ||
} | ||
return dayjs.utc(date).local().format(format); | ||
}; | ||
|
||
export { displayDate }; |
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,4 @@ | ||
export * from './acl'; | ||
export * from './misc'; | ||
export * from './users'; | ||
export * from './dates'; |
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
6 changes: 5 additions & 1 deletion
6
portals-ui/sites/ngs-portal/src/pages/home/components/style.css
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,7 @@ | ||
.ngs-container { | ||
@apply px-3 py-2 bg-white space-y-1; | ||
@apply px-3 py-2 bg-white space-y-1; | ||
} | ||
|
||
.ngs-container-extended { | ||
@apply px-3 py-2 bg-white flex gap-2 flex-nowrap; | ||
} |
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