Skip to content

Commit d8c27c5

Browse files
committed
- fixes: #63 use status_id to check color
- added missing impliment from app.js - overwride redmine's replaceIssueFormWith to redraw map in editing mode Signed-off-by: Taro Matsuzawa <[email protected]>
1 parent 952a096 commit d8c27c5

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/@types/window.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,6 @@ interface Window {
77
showModal(id: string, width: string, title?: string): void
88
buildFilterRowWithoutDistanceFilter(field: any, operator: any, values: any): void
99
buildFilterRow(field: any, operator: any, values: any): void
10+
replaceIssueFormWith(html: any): void
11+
replaceIssueFormWithInitMap(html: any): void
1012
}

src/components/gtt-client.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ export class GttClient {
224224
}
225225
}
226226

227+
// Fix empty map issue
228+
this.map.once('postrender', e => {
229+
this.zoomToExtent(true);
230+
})
231+
227232
// Add Toolbar
228233
this.toolbar = new Bar()
229234
this.toolbar.setPosition('bottom-left' as any) // is type.d old?
@@ -604,7 +609,7 @@ export class GttClient {
604609
const plugin_settings = JSON.parse(this.defaults.pluginSettings)
605610
const status = document.querySelector('#issue_status_id') as HTMLInputElement
606611

607-
let status_id = feature.get('status')
612+
let status_id = feature.get('status_id')
608613
if (!status_id && status) {
609614
status_id = status.value
610615
}
@@ -762,7 +767,6 @@ export class GttClient {
762767
})
763768
}
764769
}
765-
766770
}
767771

768772
/**
@@ -1348,3 +1352,12 @@ const buildDistanceFilterRow = (operator: any, values: any):void => {
13481352
(document.querySelector(`#values_${fieldId}_3`) as HTMLInputElement).value = x;
13491353
(document.querySelector(`#values_${fieldId}_4`) as HTMLInputElement).value = y;
13501354
}
1355+
1356+
window.replaceIssueFormWithInitMap = window.replaceIssueFormWith
1357+
window.replaceIssueFormWith = (html) => {
1358+
window.replaceIssueFormWithInitMap(html)
1359+
const ol_maps = document.querySelector('div#update div.ol-map') as HTMLDivElement
1360+
if (ol_maps) {
1361+
new GttClient({target: ol_maps})
1362+
}
1363+
}

0 commit comments

Comments
 (0)