Skip to content

Add admin mode#200

Merged
lukynmatuska merged 10 commits intomasterfrom
193-admin-mode
Mar 9, 2026
Merged

Add admin mode#200
lukynmatuska merged 10 commits intomasterfrom
193-admin-mode

Conversation

@lukynmatuska
Copy link
Member

No description provided.

@lukynmatuska lukynmatuska requested a review from sy-filis March 1, 2026 17:43
@lukynmatuska lukynmatuska linked an issue Mar 1, 2026 that may be closed by this pull request
@netlify
Copy link

netlify bot commented Mar 1, 2026

Deploy Preview for cutetix-admin ready!

Name Link
🔨 Latest commit 6a74107
🔍 Latest deploy log https://app.netlify.com/projects/cutetix-admin/deploys/69ac58e314484000081dd1e4
😎 Deploy Preview https://deploy-preview-200--cutetix-admin.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@lukynmatuska lukynmatuska added the enhancement New feature or request label Mar 1, 2026

#defaultMenu: MenuItem[] = [
this.#getMenuItem('My events', 'my-events', faCalendarDay, () => this.getSubItemsByPath('my-events')),
].filter(o => o);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Proč ten filter?

Copy link
Member Author

Choose a reason for hiding this comment

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

To jsem si říkal taky, má to odjebat nevalidní objekty jako null, atd.

Comment on lines +26 to +40
build(currentUrl: string = ''): MenuItem[] {
if (this.#adminMode.status()) {
// user is admin and should have access to all things
return this.#adminMenu.filter(o => o);
}

// user has restricted access
let menu: MenuItem[] = [];

for (let i = 0; i < this.#adminMenu.length; i++) {
const menuItem = this.#adminMenu[i];
if (currentUrl.startsWith(`/${menuItem.link}`)) {
menu.push(menuItem);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Okomentovat, ale možná to nechápu, protože nevím, jaká je architektura toho menu buildingu.

Copy link
Member Author

Choose a reason for hiding this comment

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

Přidal jsem komentáře, snad je to teď lepší.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hele, toto Ti celé přepíšu doma na komplu... :)

@lukynmatuska lukynmatuska merged commit 63e3c79 into master Mar 9, 2026
6 checks passed
@lukynmatuska lukynmatuska deleted the 193-admin-mode branch March 9, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admin mode

2 participants