릴리즈 v0.3.2: 일반 사용자(User) 권한 메뉴 가시성 및 권한 제어 패치
This commit is contained in:
parent
faf17d3fcc
commit
c6ab665685
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "smartims",
|
||||
"private": true,
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "server",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@ -7,6 +7,7 @@ import { assetApi } from '../../../shared/api/assetApi';
|
||||
import type { Asset } from '../../../shared/api/assetApi';
|
||||
import { SERVER_URL } from '../../../shared/api/client';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { useAuth } from '../../../shared/auth/AuthContext';
|
||||
|
||||
interface AssetBasicInfoProps {
|
||||
asset: Asset & { image?: string, consumables?: any[] };
|
||||
@ -14,6 +15,8 @@ interface AssetBasicInfoProps {
|
||||
}
|
||||
|
||||
export function AssetBasicInfo({ asset, onRefresh }: AssetBasicInfoProps) {
|
||||
const { user } = useAuth();
|
||||
const isAdmin = user?.role === 'admin' || user?.role === 'supervisor';
|
||||
const [isEditing, setIsEditing] = useState(false);
|
||||
const [editData, setEditData] = useState(asset);
|
||||
const [isZoomed, setIsZoomed] = useState(false);
|
||||
@ -69,7 +72,7 @@ export function AssetBasicInfo({ asset, onRefresh }: AssetBasicInfoProps) {
|
||||
<Button size="sm" onClick={handleSave} icon={<Save size={16} />}>저장</Button>
|
||||
</>
|
||||
) : (
|
||||
<Button size="sm" variant="secondary" onClick={() => setIsEditing(true)}>수정</Button>
|
||||
isAdmin && <Button size="sm" variant="secondary" onClick={() => setIsEditing(true)}>수정</Button>
|
||||
)}
|
||||
<Button variant="secondary" size="sm" icon={<Printer size={16} />}>출력</Button>
|
||||
</div>
|
||||
@ -341,7 +344,7 @@ export function AssetBasicInfo({ asset, onRefresh }: AssetBasicInfoProps) {
|
||||
<div className="consumables-section">
|
||||
<div className="flex justify-between items-center mb-2">
|
||||
<h3 className="section-title text-lg font-bold">관련 소모품 관리</h3>
|
||||
<Button size="sm" variant="secondary" icon={<Plus size={14} />}>소모품 추가</Button>
|
||||
{isAdmin && <Button size="sm" variant="secondary" icon={<Plus size={14} />}>소모품 추가</Button>}
|
||||
</div>
|
||||
<table className="doc-table w-full text-center border-collapse border border-slate-300">
|
||||
<thead>
|
||||
|
||||
@ -22,5 +22,5 @@ export const assetModule: IModuleDefinition = {
|
||||
{ path: '/instruments', element: <AssetListPage />, label: '계측기 관리', position: 'top' },
|
||||
{ path: '/vehicles', element: <AssetListPage />, label: '차량 관리', position: 'top' },
|
||||
],
|
||||
requiredRoles: ['admin', 'manager']
|
||||
requiredRoles: ['admin', 'manager', 'user']
|
||||
};
|
||||
|
||||
@ -4,6 +4,7 @@ import { Card } from '../../../shared/ui/Card';
|
||||
import { Button } from '../../../shared/ui/Button';
|
||||
import { Input } from '../../../shared/ui/Input';
|
||||
import { Search, Plus, Filter, Download, ChevronsLeft, ChevronsRight, ChevronLeft, ChevronRight } from 'lucide-react';
|
||||
import { useAuth } from '../../../shared/auth/AuthContext';
|
||||
import './AssetListPage.css';
|
||||
|
||||
import { getCategories } from './AssetSettingsPage';
|
||||
@ -19,6 +20,8 @@ import { saveAs } from 'file-saver';
|
||||
export function AssetListPage() {
|
||||
const location = useLocation();
|
||||
const navigate = useNavigate();
|
||||
const { user } = useAuth();
|
||||
const isAdmin = user?.role === 'admin' || user?.role === 'supervisor';
|
||||
const [searchTerm, setSearchTerm] = useState('');
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const [assets, setAssets] = useState<Asset[]>([]);
|
||||
@ -277,7 +280,9 @@ export function AssetListPage() {
|
||||
필터
|
||||
</Button>
|
||||
<Button variant="secondary" icon={<Download size={16} />} onClick={handleExcelDownload}>엑셀 다운로드</Button>
|
||||
<Button onClick={() => navigate('/asset/register')} icon={<Plus size={16} />}>자산 등록</Button>
|
||||
{isAdmin && (
|
||||
<Button onClick={() => navigate('/asset/register')} icon={<Plus size={16} />}>자산 등록</Button>
|
||||
)}
|
||||
|
||||
{/* Filter Popup */}
|
||||
{isFilterOpen && (
|
||||
|
||||
@ -7,5 +7,5 @@ export const cctvModule: IModuleDefinition = {
|
||||
routes: [
|
||||
{ path: '/live', element: <MonitoringPage />, label: '실시간 관제' },
|
||||
],
|
||||
requiredRoles: ['admin', 'operator']
|
||||
requiredRoles: ['admin', 'operator', 'user']
|
||||
};
|
||||
|
||||
@ -7,5 +7,5 @@ export const productionModule: IModuleDefinition = {
|
||||
routes: [
|
||||
{ path: '/dashboard', element: <ProductionPage />, label: '생산 현황' },
|
||||
],
|
||||
requiredRoles: ['admin', 'manager']
|
||||
requiredRoles: ['admin', 'manager', 'user']
|
||||
};
|
||||
|
||||
@ -97,7 +97,7 @@ export function VersionPage() {
|
||||
};
|
||||
|
||||
// Client/Frontend version fixed at build time
|
||||
const frontendVersion = '0.3.1';
|
||||
const frontendVersion = '0.3.2';
|
||||
const buildDate = '2026-01-24';
|
||||
|
||||
// Check if update is needed based on frontend version vs remote tag
|
||||
@ -249,6 +249,17 @@ export function VersionPage() {
|
||||
|
||||
<div className="space-y-4">
|
||||
{[
|
||||
{
|
||||
version: '0.3.2',
|
||||
date: '2026-01-24',
|
||||
title: '일반 사용자(User) 권한 가시성 패치',
|
||||
changes: [
|
||||
'일반 사용자 계정 접속 시 사이드바 메뉴가 보이지 않던 권한 필터 오류 수정',
|
||||
'자산 관리 상세 정보에서 일반 사용자의 수정/삭제 버튼 노출 제한 (View-only)',
|
||||
'CCTV 모듈 내 일반 사용자의 제어 권한 제한 재검토'
|
||||
],
|
||||
type: 'fix'
|
||||
},
|
||||
{
|
||||
version: '0.3.1',
|
||||
date: '2026-01-24',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user