feat(holiday-calendar): implement holiday calendar component with CRUD functionality
- Added a new `HolidayCalendar` component for managing custom and official holidays. - Integrated holiday type fetching and population logic to streamline holiday management. - Enhanced UI with modals for creating, editing, and deleting holidays, including validation and user feedback. - Updated styles for improved visual presentation and user interaction. - Refactored sidebar and routes to accommodate new component structure and localization updates.
This commit is contained in:
@@ -1,69 +0,0 @@
|
||||
import {
|
||||
AppstoreOutlined,
|
||||
CreditCardOutlined,
|
||||
ProfileOutlined,
|
||||
TeamOutlined,
|
||||
UserOutlined,
|
||||
SettingOutlined,
|
||||
} from '@/shared/antd-imports';
|
||||
import React, { ReactNode, lazy } from 'react';
|
||||
const Overview = lazy(() => import('./overview/overview'));
|
||||
const Users = lazy(() => import('./users/users'));
|
||||
const Teams = lazy(() => import('./teams/teams'));
|
||||
const Billing = lazy(() => import('./billing/billing'));
|
||||
const Projects = lazy(() => import('./projects/projects'));
|
||||
const Settings = lazy(() => import('./settings/settings'));
|
||||
|
||||
// type of a menu item in admin center sidebar
|
||||
type AdminCenterMenuItems = {
|
||||
key: string;
|
||||
name: string;
|
||||
endpoint: string;
|
||||
icon: ReactNode;
|
||||
element: ReactNode;
|
||||
};
|
||||
// settings all element items use for sidebar and routes
|
||||
export const adminCenterItems: AdminCenterMenuItems[] = [
|
||||
{
|
||||
key: 'overview',
|
||||
name: 'overview',
|
||||
endpoint: 'overview',
|
||||
icon: React.createElement(AppstoreOutlined),
|
||||
element: React.createElement(Overview),
|
||||
},
|
||||
{
|
||||
key: 'users',
|
||||
name: 'users',
|
||||
endpoint: 'users',
|
||||
icon: React.createElement(UserOutlined),
|
||||
element: React.createElement(Users),
|
||||
},
|
||||
{
|
||||
key: 'teams',
|
||||
name: 'teams',
|
||||
endpoint: 'teams',
|
||||
icon: React.createElement(TeamOutlined),
|
||||
element: React.createElement(Teams),
|
||||
},
|
||||
{
|
||||
key: 'projects',
|
||||
name: 'projects',
|
||||
endpoint: 'projects',
|
||||
icon: React.createElement(ProfileOutlined),
|
||||
element: React.createElement(Projects),
|
||||
},
|
||||
{
|
||||
key: 'billing',
|
||||
name: 'billing',
|
||||
endpoint: 'billing',
|
||||
icon: React.createElement(CreditCardOutlined),
|
||||
element: React.createElement(Billing),
|
||||
},
|
||||
{
|
||||
key: 'settings',
|
||||
name: 'settings',
|
||||
endpoint: 'settings',
|
||||
icon: React.createElement(SettingOutlined),
|
||||
element: React.createElement(Settings),
|
||||
},
|
||||
];
|
||||
@@ -1 +0,0 @@
|
||||
export { default } from './settings';
|
||||
@@ -20,7 +20,7 @@ import { scheduleAPIService } from '@/api/schedule/schedule.api.service';
|
||||
import { adminCenterApiService } from '@/api/admin-center/admin-center.api.service';
|
||||
import { Settings } from '@/types/schedule/schedule-v2.types';
|
||||
import OrganizationCalculationMethod from '@/components/admin-center/overview/organization-calculation-method/organization-calculation-method';
|
||||
import HolidayCalendar from '@/components/admin-center/overview/holiday-calendar/holiday-calendar';
|
||||
import HolidayCalendar from '@/components/admin-center/overview/holiday-calendar/HolidayCalendar';
|
||||
import { useAppDispatch } from '@/hooks/useAppDispatch';
|
||||
import { useAppSelector } from '@/hooks/useAppSelector';
|
||||
import { RootState } from '@/app/store';
|
||||
|
||||
@@ -4,7 +4,7 @@ import React from 'react';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import { colors } from '../../../styles/colors';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { adminCenterItems } from '../admin-center-constants';
|
||||
import { adminCenterItems } from '../../../lib/admin-center-constants';
|
||||
import './sidebar.css';
|
||||
|
||||
const AdminCenterSidebar: React.FC = () => {
|
||||
|
||||
Reference in New Issue
Block a user