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

Feat: disable projectstate change for internal projects #505

Merged
merged 2 commits into from
Jul 24, 2024
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
12 changes: 6 additions & 6 deletions frontend/src/components/Buttons/FilterButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ export default function FilterButton({
readOnly
{...inputProps}
className={`appearance-none border flex items-center border-opacity-50 m-[1px] mr-2 h-4 w-4 border-primary hover:border-primary checked:bg-primary

${
inputProps.disabled &&
"border-black/20 hover:border-black/20 checked:bg-primary/50 bg-black/5"
}
${
inputProps.checked
inputProps.checked && !inputProps.disabled
? "hover:bg-primary hover:brightness-[1.5]"
: "hover:bg-primary hover:bg-opacity-10"
}
${rounded ? "rounded-full" : "rounded-sm"}
${rounded ? "rounded-full" : "rounded-sm"} ${
inputProps.disabled &&
"border-black border-opacity-20 bg-black/5 hover:bg-black hover:bg-opacity-5 hover:border-black hover:border-opacity-20 checked:bg-primary checked:bg-opacity-50 checked:hover:bg-primary checked:hover:bg-opacity-50"
}
`}
/>
<svg
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/components/ChangeEngagementState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export default function ChangeEngagementState({
project.bookingType,
);

const isInternalProject = project.customerName === "Variant";

async function handleChange(newState: EngagementState) {
setEngagementState(newState);

Expand Down Expand Up @@ -67,13 +69,15 @@ export default function ChangeEngagementState({
value={EngagementState.Offer}
checked={engagementState === EngagementState.Offer}
onChange={(e) => handleChange(e.target.value as EngagementState)}
disabled={isInternalProject}
/>
<FilterButton
label="Ordre"
rounded={true}
value={EngagementState.Order}
checked={engagementState === EngagementState.Order}
onChange={(e) => handleChange(e.target.value as EngagementState)}
disabled={isInternalProject}
/>

<FilterButton
Expand All @@ -82,13 +86,15 @@ export default function ChangeEngagementState({
value={EngagementState.Closed}
checked={engagementState === EngagementState.Closed}
onChange={(e) => handleChange(e.target.value as EngagementState)}
disabled={isInternalProject}
/>
<FilterButton
label="Tapt"
rounded={true}
value={EngagementState.Lost}
checked={engagementState === EngagementState.Lost}
onChange={(e) => handleChange(e.target.value as EngagementState)}
disabled={isInternalProject}
/>
</form>
);
Expand Down
Loading