Skip to content

feat(admin): add ability to edit overview section - #1334

Merged
jimmypalelil merged 1 commit into
mainfrom
jimmy/admin/feat/options-api
Oct 30, 2025
Merged

feat(admin): add ability to edit overview section#1334
jimmypalelil merged 1 commit into
mainfrom
jimmy/admin/feat/options-api

Conversation

@jimmypalelil

@jimmypalelil jimmypalelil commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

Description

  • Overview section elements can now be edited. Note that this feature is behind a feature flag (?enable_full_features=true).

Steps to enable feature flag

For Chrome Users

Step 1: Show Your Bookmarks Bar

  1. Open Chrome
  2. Press Ctrl+Shift+B (Windows/Linux) or Cmd+Shift+B (Mac)
  3. Your bookmarks bar should now be visible below the address bar

Step 2: Add the Bookmark

  1. Right-click on the bookmarks bar
  2. Select "Add page..." or "Add bookmark..."
  3. Fill in the form:
    • Name: Toggle Full Features (or any name you prefer)
    • URL: Paste the code below
  4. Click "Save"

Code to paste:

javascript:(function(){var url=new URL(window.location.href);if(url.searchParams.has('enable_full_features')){url.searchParams.delete('enable_full_features');}else{url.searchParams.set('enable_full_features','true');}window.location.href=url.toString();})();

Step 3: click on the bookmark to toggle bookmark

@marcellmueller marcellmueller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, this is great 🥇

Out of scope for this but I was thinking about the feature flag and think in the future we could improve it via a cookie set by query param or sso role.

I feel like the query param worked well on the public search page - when we search and go to a rec resource page and then hit back it's still there. Though if we set this on an overview page then go back to search and go to another resource we have to manually toggle it. It's a bit cumbersome long term imo as we will all be testing it a lot.

type: [RecreationAccessCodeDto],
})
recreation_access: RecreationAccessDto[];
accessCodes: RecreationAccessCodeDto[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: same as other one, the rest of the dto is snake case

description: 'List of sub-access codes associated with this access code',
type: [RecreationSubAccessCodeDto],
})
subAccessCodes: RecreationSubAccessCodeDto[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the rest of the dto is snake case

@ValidateNested({ each: true })
@Type(() => UpdateRecreationAccessCodeDto)
@IsOptional()
accessCodes?: UpdateRecreationAccessCodeDto[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the rest of the dto is snake case

@IsArray()
@IsString({ each: true })
@IsOptional()
subAccessCodes?: string[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: well the rest of the dto is NOT snake case but should probably follow the same style 😆

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i noticed searchTerm in susggestions api has camel case as well.. ill do a follow up pr

export class OptionsController {
constructor(private readonly optionsService: OptionsService) {}

@Get(':type')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is cool

Comment on lines +12 to +31
export const useResourceOptions = () => {
const regionOptions = useGetRecreationResourceOptions(
GetOptionsByTypeTypeEnum.Regions,
);
const maintenanceOptions = useGetRecreationResourceOptions(
GetOptionsByTypeTypeEnum.Maintenance,
);
const controlAccessCodeTypeOptions = useGetRecreationResourceOptions(
GetOptionsByTypeTypeEnum.ControlAccessCode,
{
// Add "None" option to unset control access code
select: (data) => [{ id: null, label: 'None' }, ...data],
},
);
const accessOptions = useGetRecreationResourceOptions(
GetOptionsByTypeTypeEnum.Access,
);
const recreationStatusOptions = useGetRecreationResourceOptions(
GetOptionsByTypeTypeEnum.RecreationStatus,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot of api calls. Do you think we should modify the service to fetch multiple types in the future?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea good idea - something that takes a list of type enums and returns

@jimmypalelil
jimmypalelil merged commit 8cfec24 into main Oct 30, 2025
53 of 57 checks passed
@jimmypalelil
jimmypalelil deleted the jimmy/admin/feat/options-api branch October 30, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants