Merge remote-tracking branches 'origin/sub_laptop_2', 'origin/sub_laptop_5' and 'origin/sub_laptop_8' into sub_laptop_1
This commit is contained in:
@@ -52,13 +52,18 @@ describe('표 놓기(PLACETABLE)', () => {
|
||||
it('place-table 메시지 = 연결을 단 표를 맡기고 PLACETABLE 을 켬', async () => {
|
||||
const notify = vi.fn();
|
||||
const handled = await handleTableMessage(
|
||||
{ type: AISLO_PLACE_TABLE_MESSAGE, entity: await table().toJson(), link: 'T7' },
|
||||
{
|
||||
type: AISLO_PLACE_TABLE_MESSAGE,
|
||||
entity: { ...(await table().toJson()), lineColor: '#123456' },
|
||||
link: 'T7',
|
||||
},
|
||||
notify
|
||||
);
|
||||
expect(handled).toBe(true);
|
||||
expect(run).toHaveBeenCalledWith('PLACETABLE');
|
||||
expect(getPendingTable()?.getStyle().연결).toBe('T7');
|
||||
expect(getPendingTable()?.getCell(0, 0)?.colSpan).toBe(2);
|
||||
expect(getPendingTable()?.lineColor).toBe('#123456');
|
||||
expect(notify).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
@@ -40,17 +40,17 @@ export function updateLinkedTables(link: string, cells: TableCells): number {
|
||||
/** 표 JSON 을 놓기 도구에 맡기고 도구를 켬 */
|
||||
export async function startPlaceTable(entity: JsonEntity, link: string): Promise<void> {
|
||||
const table = await TableEntity.fromJson(entity as Parameters<typeof TableEntity.fromJson>[0]);
|
||||
const style = table.getStyle();
|
||||
setPendingTable(
|
||||
new TableEntity(
|
||||
table.layerId,
|
||||
table.getOrigin(),
|
||||
table.getColumnWidths(),
|
||||
table.getRowHeights(),
|
||||
table.getCells(),
|
||||
{ ...style, 연결: link }
|
||||
)
|
||||
const linked = new TableEntity(
|
||||
table.layerId,
|
||||
table.getOrigin(),
|
||||
table.getColumnWidths(),
|
||||
table.getRowHeights(),
|
||||
table.getCells(),
|
||||
{ ...table.getStyle(), 연결: link }
|
||||
);
|
||||
linked.lineColor = table.lineColor; // 보낸 선 색 · 굵기 그대로
|
||||
linked.lineWidth = table.lineWidth;
|
||||
setPendingTable(linked);
|
||||
runCommandInput('PLACETABLE');
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ const TEXT = {
|
||||
saveFirst: "저장 안 한 고침이 있음 — 저장하고 보낼까요?",
|
||||
saveLabel: "저장하고 보내기",
|
||||
failed: "표를 못 만듦 — {value}",
|
||||
noRange: "보낼 범위를 시트에서 먼저 고름",
|
||||
place: "도면에서 표를 놓을 자리를 누름(Esc = 그만)",
|
||||
noPlace: "이 도면 화면은 표 놓기를 아직 못 함",
|
||||
stale: "면적산출 값이 바뀐 표 {n}개",
|
||||
@@ -175,7 +176,7 @@ export function createAreaToDrawing(opt: AreaToDrawingOptions): AreaToDrawing {
|
||||
});
|
||||
|
||||
async function send(at: Selection): Promise<void> {
|
||||
if (!range) return;
|
||||
if (!range) return showToast(TEXT.noRange, "error");
|
||||
if (opt.isDirty()) {
|
||||
if (!(await showConfirmDialog(TEXT.saveFirst, TEXT.saveLabel))) return;
|
||||
await opt.save();
|
||||
@@ -247,7 +248,7 @@ export function createAreaToDrawing(opt: AreaToDrawingOptions): AreaToDrawing {
|
||||
return {
|
||||
select: (s) => (range = { 시트: s.시트, 범위: s.범위 }),
|
||||
onArea: (at, readOnly, slot) => {
|
||||
range = null;
|
||||
// 범위는 그대로 — 시트가 처음 고름(A1)을 이 갈고리보다 먼저 알림
|
||||
if (readOnly || at.layer === "project") return;
|
||||
const button = createButton({ label: TEXT.send, variant: "ghost", size: "sm" });
|
||||
button.title = TEXT.sendTip;
|
||||
@@ -258,6 +259,7 @@ export function createAreaToDrawing(opt: AreaToDrawingOptions): AreaToDrawing {
|
||||
onDrawing: (raw, at, doc) => {
|
||||
const handle = raw as TableHandle;
|
||||
shown = `${at.layer}:${at.name}`;
|
||||
range = null; // 면적 상세를 떠남
|
||||
fresh = new Map();
|
||||
latest = new Map();
|
||||
const give =
|
||||
|
||||
@@ -92,7 +92,11 @@ def test_집계표만_컨테이너를_붙임():
|
||||
body,
|
||||
)
|
||||
# 구조물 도면 저장은 `도면` 칸만 갈아 끼움 — 도번 · 산출근거는 읽은 그대로
|
||||
assert '{ ...(loaded as StructureDoc), 도면: edited as StructureDoc["도면"] }' in body
|
||||
# 도면 칸만 갈아 끼움 · 맨 위 연결표는 도면 표에 맞춤(41-3 `toDrawing.withLinks`)
|
||||
assert re.search(
|
||||
r'toDrawing\.withLinks\(\{\s*\.\.\.\(loaded as StructureDoc\),\s*도면: edited as StructureDoc\["도면"\],\s*\}\)',
|
||||
body,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없음")
|
||||
|
||||
Reference in New Issue
Block a user