feat: Improved Page and History names (#4908)
Improved page and history names. Closes #4684 --------- Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
export enum SettingsPath {
|
||||
ProfilePage = 'profile',
|
||||
Appearance = 'profile/appearance',
|
||||
Appearance = 'appearance',
|
||||
Accounts = 'accounts',
|
||||
NewAccount = 'accounts/new',
|
||||
AccountsCalendars = 'accounts/calendars',
|
||||
|
||||
@ -5,14 +5,17 @@ import { ObjectFilterDropdownButton } from '@/object-record/object-filter-dropdo
|
||||
import { FiltersHotkeyScope } from '@/object-record/object-filter-dropdown/types/FiltersHotkeyScope';
|
||||
import { ObjectSortDropdownButton } from '@/object-record/object-sort-dropdown/components/ObjectSortDropdownButton';
|
||||
import { TopBar } from '@/ui/layout/top-bar/TopBar';
|
||||
import { PageTitle } from '@/ui/utilities/page-title/PageTitle';
|
||||
import { QueryParamsFiltersEffect } from '@/views/components/QueryParamsFiltersEffect';
|
||||
import { QueryParamsViewIdEffect } from '@/views/components/QueryParamsViewIdEffect';
|
||||
import { ViewBarEffect } from '@/views/components/ViewBarEffect';
|
||||
import { ViewBarFilterEffect } from '@/views/components/ViewBarFilterEffect';
|
||||
import { ViewBarSortEffect } from '@/views/components/ViewBarSortEffect';
|
||||
import { useGetCurrentView } from '@/views/hooks/useGetCurrentView';
|
||||
import { ViewScope } from '@/views/scopes/ViewScope';
|
||||
import { GraphQLView } from '@/views/types/GraphQLView';
|
||||
import { ViewPickerDropdown } from '@/views/view-picker/components/ViewPickerDropdown';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
import { ViewsHotkeyScope } from '../types/ViewsHotkeyScope';
|
||||
|
||||
@ -34,6 +37,9 @@ export const ViewBar = ({
|
||||
}: ViewBarProps) => {
|
||||
const { objectNamePlural } = useParams();
|
||||
|
||||
const { currentViewWithCombinedFiltersAndSorts: currentView } =
|
||||
useGetCurrentView(viewBarId);
|
||||
|
||||
const filterDropdownId = 'view-filter';
|
||||
const sortDropdownId = 'view-sort';
|
||||
|
||||
@ -41,6 +47,10 @@ export const ViewBar = ({
|
||||
return;
|
||||
}
|
||||
|
||||
const pageTitle = currentView?.name
|
||||
? `${currentView?.name} - ${capitalize(objectNamePlural)}`
|
||||
: capitalize(objectNamePlural);
|
||||
|
||||
return (
|
||||
<ViewScope
|
||||
viewScopeId={viewBarId}
|
||||
@ -52,6 +62,7 @@ export const ViewBar = ({
|
||||
<QueryParamsFiltersEffect />
|
||||
<QueryParamsViewIdEffect />
|
||||
|
||||
<PageTitle title={pageTitle} />
|
||||
<TopBar
|
||||
className={className}
|
||||
leftComponent={
|
||||
|
||||
Reference in New Issue
Block a user