Commit 9b9085cc authored by David Yang's avatar David Yang

update: ui

parent 2d3757b2
...@@ -12,13 +12,15 @@ const ROUTE_PATHS = { ...@@ -12,13 +12,15 @@ const ROUTE_PATHS = {
problemRectification: '/problem_rectification', problemRectification: '/problem_rectification',
issueRectificationArchive: '/issue_rectification_archive', issueRectificationArchive: '/issue_rectification_archive',
problemRectificationForm: '/problem_rectification_form', problemRectificationForm: '/problem_rectification_form',
problemRectificationFlowTable: '/problem_rectification_flow_table',
} as const; } as const;
const APP_BASE_PATH = '/problem_rectification_new/';
export default defineConfig({ export default defineConfig({
layout: false, layout: false,
fastRefresh: true, fastRefresh: true,
base: '/problem_rectification_new/', base: APP_BASE_PATH,
publicPath: '/problem_rectification_new/', publicPath: APP_BASE_PATH,
alias: { alias: {
react: resolvePackageRoot('react'), react: resolvePackageRoot('react'),
'react-dom': resolvePackageRoot('react-dom'), 'react-dom': resolvePackageRoot('react-dom'),
...@@ -58,6 +60,10 @@ export default defineConfig({ ...@@ -58,6 +60,10 @@ export default defineConfig({
path: ROUTE_PATHS.problemRectificationForm, path: ROUTE_PATHS.problemRectificationForm,
component: './problem_rectification/form/index', component: './problem_rectification/form/index',
}, },
{
path: ROUTE_PATHS.problemRectificationFlowTable,
component: './problem_rectification/flow-table/index',
},
], ],
}, },
], ],
...@@ -88,5 +94,6 @@ export default defineConfig({ ...@@ -88,5 +94,6 @@ export default defineConfig({
define: { define: {
STREAMS_API_URL: '/api', STREAMS_API_URL: '/api',
STREAMS_PARSER_URL: '/parser', STREAMS_PARSER_URL: '/parser',
PROBLEM_RECTIFICATION_APP_BASE_PATH: APP_BASE_PATH,
}, },
}); });
...@@ -16,6 +16,7 @@ export function Table({ ...@@ -16,6 +16,7 @@ export function Table({
dense = false, dense = false,
grid = false, grid = false,
striped = false, striped = false,
scrollable = true,
className, className,
children, children,
...props ...props
...@@ -27,7 +28,9 @@ export function Table({ ...@@ -27,7 +28,9 @@ export function Table({
{...props} {...props}
className={clsx( className={clsx(
className, className,
'-mx-(--gutter) overflow-x-auto whitespace-nowrap', '-mx-(--gutter)',
scrollable && 'overflow-x-auto',
'whitespace-nowrap',
)} )}
> >
<div <div
......
This diff is collapsed.
...@@ -15,6 +15,8 @@ import { ...@@ -15,6 +15,8 @@ import {
isViewAccessible, isViewAccessible,
} from '@/utils/subjectView'; } from '@/utils/subjectView';
const EMPTY_ARRAY = [];
function CloseIcon() { function CloseIcon() {
return ( return (
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true" className="size-5"> <svg viewBox="0 0 20 20" fill="none" aria-hidden="true" className="size-5">
...@@ -46,6 +48,7 @@ const RecordDetailDrawer = (props, ref) => { ...@@ -46,6 +48,7 @@ const RecordDetailDrawer = (props, ref) => {
readonly = false, readonly = false,
filterView = [], filterView = [],
preferredViewName, preferredViewName,
disabledFields = EMPTY_ARRAY,
} = props; } = props;
const [refreshKey, setRefreshKey] = useState(() => Date.now()); const [refreshKey, setRefreshKey] = useState(() => Date.now());
...@@ -122,6 +125,15 @@ const RecordDetailDrawer = (props, ref) => { ...@@ -122,6 +125,15 @@ const RecordDetailDrawer = (props, ref) => {
const activeView = detailViews.find((view) => view.name === activeTabKey) || detailViews[0]; const activeView = detailViews.find((view) => view.name === activeTabKey) || detailViews[0];
const drawerWidth = isFullscreen ? '100vw' : typeof width === 'number' ? `${width}px` : width; const drawerWidth = isFullscreen ? '100vw' : typeof width === 'number' ? `${width}px` : width;
const disabledFieldSet = useMemo(
() =>
new Set(
disabledFields.flatMap((fieldName) => [fieldName, `metadata.${fieldName}`]),
),
[disabledFields],
);
const isDrawerFieldDisabled = (fieldPath, currentView) =>
disabledFieldSet.has(fieldPath) || isFieldDisabled(fieldPath, currentView);
const closeDrawer = () => { const closeDrawer = () => {
onClose?.(); onClose?.();
...@@ -209,7 +221,7 @@ const RecordDetailDrawer = (props, ref) => { ...@@ -209,7 +221,7 @@ const RecordDetailDrawer = (props, ref) => {
onFieldUpdate={handleFieldUpdate} onFieldUpdate={handleFieldUpdate}
onDataChange={onDataChange} onDataChange={onDataChange}
readonly={readonly} readonly={readonly}
isFieldDisabled={isFieldDisabled} isFieldDisabled={isDrawerFieldDisabled}
/> />
)} )}
</main> </main>
......
This diff is collapsed.
...@@ -10,7 +10,10 @@ import { ...@@ -10,7 +10,10 @@ import {
sendNotice, sendNotice,
updateRecord, updateRecord,
} from '@/services/DataService'; } from '@/services/DataService';
import { normalizeProblemRectificationRecord } from './problemRectificationListService'; import {
getProblemRectificationFormUrl,
normalizeProblemRectificationRecord,
} from './problemRectificationListService';
import { normalizeText, toArray } from '@/utils/subjectView'; import { normalizeText, toArray } from '@/utils/subjectView';
const MESSAGE_REFERENCE_SUBJECT = 'message_reference_id'; const MESSAGE_REFERENCE_SUBJECT = 'message_reference_id';
...@@ -147,11 +150,7 @@ async function sendFlowNotice({ title, content, fromUserId, toUserIds = [] }) { ...@@ -147,11 +150,7 @@ async function sendFlowNotice({ title, content, fromUserId, toUserIds = [] }) {
} }
function buildReturnUrl(messageName) { function buildReturnUrl(messageName) {
if (typeof window === 'undefined') { return getProblemRectificationFormUrl(messageName);
return `/problem_rectification_form?id=${messageName}`;
}
return `${window.location.origin}/problem_rectification_form?id=${messageName}`;
} }
function resolveCurrentStep(messageRecord) { function resolveCurrentStep(messageRecord) {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment