-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(zimbra): migrate to ods version 18.2.0
ref:MANAGER-15662 Signed-off-by: stif59100 <[email protected]> Signed-off-by: Tristan WAGNER <[email protected]>
- Loading branch information
1 parent
b6d19af
commit fa0b0a0
Showing
87 changed files
with
2,160 additions
and
2,908 deletions.
There are no files selected for viewing
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
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
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
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
41 changes: 23 additions & 18 deletions
41
packages/manager/apps/zimbra/src/components/BadgeStatus.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 |
---|---|---|
@@ -1,29 +1,34 @@ | ||
import React from 'react'; | ||
import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming'; | ||
import { OsdsChip } from '@ovhcloud/ods-components/react'; | ||
import React, { useMemo } from 'react'; | ||
import { OdsBadge } from '@ovhcloud/ods-components/react'; | ||
import { ODS_BADGE_COLOR } from '@ovhcloud/ods-components'; | ||
import { ResourceStatus } from '@/api/api.type'; | ||
|
||
export type BadgeStatusProps = { | ||
itemStatus: string; | ||
'data-testid'?: string; | ||
}; | ||
|
||
export const BadgeStatus: React.FC<BadgeStatusProps> = ({ itemStatus }) => { | ||
const getStatusColor = (status: string) => { | ||
switch (status) { | ||
case ResourceStatus.READY: | ||
return ODS_THEME_COLOR_INTENT.success; | ||
case ResourceStatus.ERROR: | ||
return ODS_THEME_COLOR_INTENT.error; | ||
default: | ||
return ODS_THEME_COLOR_INTENT.primary; | ||
} | ||
}; | ||
const getStatusColor = (status: string) => { | ||
switch (status) { | ||
case ResourceStatus.READY: | ||
return ODS_BADGE_COLOR.success; | ||
case ResourceStatus.ERROR: | ||
return ODS_BADGE_COLOR.critical; | ||
default: | ||
return ODS_BADGE_COLOR.information; | ||
} | ||
}; | ||
|
||
const statusColor = getStatusColor(itemStatus); | ||
export const BadgeStatus: React.FC<BadgeStatusProps> = (props) => { | ||
const statusColor = useMemo(() => getStatusColor(props.itemStatus), [ | ||
props.itemStatus, | ||
]); | ||
|
||
return ( | ||
<OsdsChip inline color={statusColor}> | ||
{itemStatus} | ||
</OsdsChip> | ||
<OdsBadge | ||
data-testid={props['data-testid']} | ||
color={statusColor} | ||
label={props.itemStatus} | ||
/> | ||
); | ||
}; |
Oops, something went wrong.