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

Handover: Highlight non-counting scope #687

Merged
merged 4 commits into from
Dec 6, 2023
Merged
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
2 changes: 2 additions & 0 deletions libs/handovershared/src/lib/types/handoverPackage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ export type HandoverPackage = {
mcDisciplines: string | null;
remainingPunchOutCount: number | null;
status: BaseStatus; //Comm. pkg status in procosys
worstChecklistStatus: string;
hasNonCountingScope: boolean | null;
};
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ const HandoverSidesheetComponent = (props: Required<HandoverProps>) => {
? statusColorMap[props.item.mechanicalCompletionStatus]
: 'transparent'
}
infoMessage={
props.item.hasNonCountingScope
? `Commissioning Package has non-counting scope. Worst checklist status is "${props.item.worstChecklistStatus}"`
: undefined
}
/>
}
/>
Expand Down
11 changes: 9 additions & 2 deletions libs/shared/src/packages/common/src/lib/StatusCircle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Icon, Tooltip } from '@equinor/eds-core-react';
import { info_circle } from '@equinor/eds-icons'; // import "save" icon
import styled from 'styled-components';

const Wrapper = styled.div`
display: flex;
align-items: center;
Expand All @@ -20,13 +21,19 @@ const StyledStatusCircle = styled.div<StatusCircleProps>`
type StatusProps = {
content: string;
statusColor: string;
infoMessage?: string;
};

/** Standard component for displaying a colored circle based on prop and content to the right of it. */
export const StatusCircle = ({ content, statusColor }: StatusProps) => {
export const StatusCircle = ({ content, statusColor, infoMessage }: StatusProps) => {
return (
<Wrapper>
<StyledStatusCircle statusColor={statusColor} />
{infoMessage ? (
<Tooltip title={infoMessage}>
<Icon data={info_circle} size={18} color="rgb(0, 112, 121)" rotation={180} />
</Tooltip>
) : null}
<span>{content}</span>
</Wrapper>
);
Expand Down