Skip to content

Commit

Permalink
Disable opex breakeven from dropdown options
Browse files Browse the repository at this point in the history
  • Loading branch information
atrincas committed Dec 16, 2024
1 parent 24b5d9b commit 9a799a6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/src/app/(overview)/url-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const filtersSchema = z.object({
export const INITIAL_FILTERS_STATE: z.infer<typeof filtersSchema> = {
keyword: "",
projectSizeFilter: PROJECT_SIZE_FILTER.MEDIUM,
priceType: PROJECT_PRICE_TYPE.OPEN_BREAK_EVEN_PRICE,
priceType: PROJECT_PRICE_TYPE.MARKET_PRICE,
costRangeSelector: COST_TYPE_SELECTOR.NPV,
countryCode: "",
ecosystem: [],
Expand Down
8 changes: 7 additions & 1 deletion client/src/containers/overview/header/parameters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ export default function ParametersProjects() {
</SelectTrigger>
<SelectContent>
{parameter.options.map((option) => (
<SelectItem key={option.value} value={option.value}>
<SelectItem
key={option.value}
value={option.value}
disabled={
option.value === PROJECT_PRICE_TYPE.OPEN_BREAK_EVEN_PRICE
}
>
{option.label}
</SelectItem>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {

const INITIAL_FILTERS_STATE: Partial<z.infer<typeof filtersSchema>> = {
projectSizeFilter: PROJECT_SIZE_FILTER.MEDIUM,
priceType: PROJECT_PRICE_TYPE.OPEN_BREAK_EVEN_PRICE,
priceType: PROJECT_PRICE_TYPE.MARKET_PRICE,
costRangeSelector: COST_TYPE_SELECTOR.NPV,
};

Expand Down Expand Up @@ -109,7 +109,13 @@ export default function ParametersProjects() {
</SelectTrigger>
<SelectContent>
{parameter.options.map((option) => (
<SelectItem key={option.value} value={option.value}>
<SelectItem
key={option.value}
value={option.value}
disabled={
option.value === PROJECT_PRICE_TYPE.OPEN_BREAK_EVEN_PRICE
}
>
{option.label}
</SelectItem>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const PROJECT_PARAMETERS = [
key: FILTER_KEYS[3],
label: "Project size",
className: "w-[125px]",
disabled: false,
options: [
{
label: COST_TYPE_SELECTOR.NPV,
Expand All @@ -42,7 +41,6 @@ export const PROJECT_PARAMETERS = [
key: FILTER_KEYS[2],
label: "Carbon pricing type",
className: "w-[195px]",
disabled: true,
options: [
{
label: PROJECT_PRICE_TYPE.MARKET_PRICE,
Expand Down Expand Up @@ -83,14 +81,19 @@ export default function CustomProjectParameters() {
onValueChange={(v) => {
handleParameters(v, parameter.key);
}}
disabled={parameter.disabled}
>
<SelectTrigger className={parameter.className}>
<SelectValue />
</SelectTrigger>
<SelectContent>
{parameter.options.map((option) => (
<SelectItem key={option.value} value={option.value}>
<SelectItem
key={option.value}
value={option.value}
disabled={
option.value === PROJECT_PRICE_TYPE.OPEN_BREAK_EVEN_PRICE
}
>
{option.label}
</SelectItem>
))}
Expand Down
2 changes: 1 addition & 1 deletion client/src/containers/projects/url-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const filtersSchema = z.object({
});

export const INITIAL_FILTERS_STATE: z.infer<typeof filtersSchema> = {
priceType: PROJECT_PRICE_TYPE.OPEN_BREAK_EVEN_PRICE,
priceType: PROJECT_PRICE_TYPE.MARKET_PRICE,
costRangeSelector: COST_TYPE_SELECTOR.NPV,
};

Expand Down

0 comments on commit 9a799a6

Please sign in to comment.