hidden jadwal shift and master-shift

This commit is contained in:
2025-11-15 14:57:25 +07:00
parent 8cf5878d46
commit da9cf0d554
2 changed files with 75 additions and 56 deletions

View File

@@ -76,7 +76,7 @@ const allItems = [
icon: <NodeExpandOutlined style={{ fontSize: '19px' }} />,
label: <Link to="/dashboard-svg/compressor-c">Compressor C</Link>,
},
]
],
},
{
key: 'dashboard-svg-airdryer',
@@ -103,7 +103,7 @@ const allItems = [
icon: <NodeExpandOutlined style={{ fontSize: '19px' }} />,
label: <Link to="/dashboard-svg/airdryer-c">Air Dryer C</Link>,
},
]
],
},
],
},
@@ -142,11 +142,11 @@ const allItems = [
icon: <SafetyOutlined style={{ fontSize: '19px' }} />,
label: <Link to="/master/status">Status</Link>,
},
{
key: 'master-shift',
icon: <ClockCircleOutlined style={{ fontSize: '19px' }} />,
label: <Link to="/master/shift">Shift</Link>,
},
// {
// key: 'master-shift',
// icon: <ClockCircleOutlined style={{ fontSize: '19px' }} />,
// label: <Link to="/master/shift">Shift</Link>,
// },
],
},
{
@@ -219,15 +219,15 @@ const allItems = [
</Link>
),
},
{
key: 'jadwal-shift',
icon: <CalendarOutlined style={{ fontSize: '19px' }} />,
label: (
<Link to="/jadwal-shift" className="fontMenus">
Jadwal Shift
</Link>
),
},
// {
// key: 'jadwal-shift',
// icon: <CalendarOutlined style={{ fontSize: '19px' }} />,
// label: (
// <Link to="/jadwal-shift" className="fontMenus">
// Jadwal Shift
// </Link>
// ),
// },
];
const LayoutMenu = () => {
@@ -255,11 +255,11 @@ const LayoutMenu = () => {
const masterKeyMap = {
'plant-sub-section': 'master-plant-sub-section',
'brand-device': 'master-brand-device',
'device': 'master-device',
'unit': 'master-unit',
'tag': 'master-tag',
'status': 'master-status',
'shift': 'master-shift'
device: 'master-device',
unit: 'master-unit',
tag: 'master-tag',
status: 'master-status',
shift: 'master-shift',
};
return masterKeyMap[subPath] || `master-${subPath}`;
}
@@ -284,8 +284,8 @@ const LayoutMenu = () => {
if (pathname.startsWith('/report/')) {
const subPath = pathParts[1];
const reportKeyMap = {
'trending': 'report-trending',
'report': 'report-report'
trending: 'report-trending',
report: 'report-report',
};
return reportKeyMap[subPath] || `report-${subPath}`;
}
@@ -294,8 +294,8 @@ const LayoutMenu = () => {
if (pathname.startsWith('/history/')) {
const subPath = pathParts[1];
const historyKeyMap = {
'alarm': 'history-alarm',
'event': 'history-event'
alarm: 'history-alarm',
event: 'history-event',
};
return historyKeyMap[subPath] || `history-${subPath}`;
}
@@ -378,9 +378,7 @@ const LayoutMenu = () => {
const necessaryParentKeys = getParentKeys(currentKey);
// Filter out only the menus that are necessary to keep open
const filteredOpenKeys = openKeys.filter(key =>
necessaryParentKeys.includes(key)
);
const filteredOpenKeys = openKeys.filter((key) => necessaryParentKeys.includes(key));
setStateOpenKeys(filteredOpenKeys);
}
@@ -391,9 +389,7 @@ const LayoutMenu = () => {
const karyawan = () => {
return allItems
.filter(
(item) => item.key !== 'setting'
)
.filter((item) => item.key !== 'setting')
.map((item) => {
if (item.key === 'master') {
return {

View File

@@ -12,8 +12,6 @@ import { useNavigate } from 'react-router-dom';
import { NotifAlert, NotifConfirmDialog } from '../../../components/Global/ToastNotif';
import { getAllContact, deleteContact } from '../../../api/contact';
const { TabPane } = Tabs;
const ContactCard = memo(function ContactCard({ contact, showEditModal, showDeleteModal }) {
return (
<Col xs={24} sm={12} md={8} lg={6}>
@@ -118,7 +116,14 @@ const ContactCard = memo(function ContactCard({ contact, showEditModal, showDele
</div>
{/* Edit and Delete Buttons - Bottom Right */}
<div style={{ display: 'flex', justifyContent: 'flex-end', gap: '8px', marginTop: '8px' }}>
<div
style={{
display: 'flex',
justifyContent: 'flex-end',
gap: '8px',
marginTop: '8px',
}}
>
<Space>
<Button
type="text"
@@ -127,9 +132,11 @@ const ContactCard = memo(function ContactCard({ contact, showEditModal, showDele
borderColor: '#faad14',
padding: '2px 6px',
fontSize: '11px',
height: '24px'
height: '24px',
}}
icon={<EditOutlined style={{ color: '#faad14', fontSize: '11px' }} />}
icon={
<EditOutlined style={{ color: '#faad14', fontSize: '11px' }} />
}
onClick={(e) => {
e.stopPropagation();
showEditModal(contact);
@@ -145,7 +152,7 @@ const ContactCard = memo(function ContactCard({ contact, showEditModal, showDele
borderColor: 'red',
padding: '2px 6px',
fontSize: '11px',
height: '24px'
height: '24px',
}}
icon={<DeleteOutlined style={{ fontSize: '11px' }} />}
onClick={(e) => {
@@ -282,7 +289,6 @@ const ListContact = memo(function ListContact(props) {
}
};
return (
<React.Fragment>
<Card>
@@ -302,7 +308,11 @@ const ListContact = memo(function ListContact(props) {
}}
onSearch={(value) => setFormDataFilter({ criteria: value })}
allowClear={{
clearIcon: <span onClick={() => setFormDataFilter(defaultFilter)}></span>,
clearIcon: (
<span onClick={() => setFormDataFilter(defaultFilter)}>
</span>
),
}}
enterButton={
<Button
@@ -353,12 +363,25 @@ const ListContact = memo(function ListContact(props) {
marginBottom: '16px',
}}
>
<Tabs activeKey={activeTab} onChange={setActiveTab} size="large">
<TabPane tab="All" key="all" />
<TabPane tab="Operator" key="operator" />
<TabPane tab="Gudang" key="gudang" />
</Tabs>
<Tabs
activeKey={activeTab}
onChange={setActiveTab}
size="large"
items={[
{
key: 'all',
label: 'All',
},
{
key: 'operator',
label: 'Operator',
},
{
key: 'gudang',
label: 'Gudang',
},
]}
/>
</div>
{getFilteredContacts().length === 0 ? (
@@ -377,7 +400,7 @@ const ListContact = memo(function ListContact(props) {
id: contact.contact_id || contact.id,
name: contact.contact_name || contact.name,
phone: contact.contact_phone || contact.phone,
status: contact.is_active ? 'active' : 'inactive'
status: contact.is_active ? 'active' : 'inactive',
}}
showEditModal={showEditModal}
showDeleteModal={showDeleteModal}