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

Removed home page special permissions #293

Merged
merged 1 commit into from
Jan 28, 2025
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: 0 additions & 2 deletions src/application/i18n/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
},
"header": {
"buttons": {
"home": "Home",
"noteSettings": "Settings"
}
},
Expand Down Expand Up @@ -176,7 +175,6 @@
}
},
"pages": {
"home": "Home",
"note": "Note",
"newNote": "New note",
"landing": "landing",
Expand Down
13 changes: 9 additions & 4 deletions src/application/services/useNavbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface useNavbarComposableState {
patchOpenedPageByUrl: (url: OpenedPage['url'], page: OpenedPage) => void;

/**
* Delete all opened pages excluding Home page
* Delete all opened pages
*/
deleteOpenedPages: () => void;

Expand Down Expand Up @@ -77,7 +77,7 @@ export default function useNavbar(): useNavbarComposableState {
};

/**
* Delete all opened pages excluding Home page
* Delete all opened pages
*/
function deleteOpenedPages(): void {
workspaceService.deleteOpenedPages();
Expand All @@ -94,8 +94,13 @@ export default function useNavbar(): useNavbarComposableState {
deleteOpenedPageByUrl(route.path);
}

addOpenedPage({ title: t(currentRoute.meta.pageTitleI18n),
url: currentRoute.path });
/**
* If the route is '/' do not add the page
*/
if (currentRoute.path !== '/') {
addOpenedPage({ title: t(currentRoute.meta.pageTitleI18n),
url: currentRoute.path });
}
});

/**
Expand Down
2 changes: 1 addition & 1 deletion src/domain/workspace.repository.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default interface WorkspaceRepositoryInterface {
patchOpenedPageByUrl: (url: OpenedPage['url'], page: OpenedPage) => void;

/**
* Delete all opened pages excluding Home page
* Delete all opened pages
*/
deleteOpenedPages: () => void;

Expand Down
6 changes: 2 additions & 4 deletions src/infrastructure/storage/openedPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,11 @@ export class OpenedPagesStore extends PersistantStore<OpenedPagesStoreData> {
}

/**
* Delete all opened pages excluding Home page
* Delete all opened pages
*/
public deleteOpenedPages(): void {
this.data.openedPages?.forEach((currentPage) => {
if (currentPage.url !== '/') {
this.deleteOpenedPageByUrl(currentPage.url);
}
this.deleteOpenedPageByUrl(currentPage.url);
});
}
}
2 changes: 1 addition & 1 deletion src/infrastructure/workspace.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class WorkspaceRepository extends Repository<OpenedPagesStore, Op
}

/**
* Delete all opened pages excluding Home page
* Delete all opened pages
*/
public deleteOpenedPages(): void {
this.store.deleteOpenedPages();
Expand Down
2 changes: 1 addition & 1 deletion src/presentation/components/app-navbar/AppNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const tabs = computed(() => currentOpenedPages.value.map((page): TabParams => {
return {
id: page.url,
title: page.title,
closable: page.title !== 'Home',
closable: true,
isActive: page.url === route.path,
};
}));
Expand Down
Loading