Skip to content

Commit 7b125f8

Browse files
authored
Merge pull request #2027 from HSLdevcom/63718-missing-codes
debugging missing code labels
2 parents 8f04e09 + acb1cac commit 7b125f8

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

src/components/sidebar/linkView/LinkView.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,15 @@ class LinkView extends React.Component<ILinkViewProps, ILinkViewState> {
6464

6565
private _setState = (newState: object) => {
6666
if (this._isMounted) {
67-
console.log(newState)
6867
this.setState(newState);
6968
}
7069
};
7170

7271
async componentDidMount() {
7372
this._isMounted = true;
7473
if (this.props.isNewLink) {
75-
console.log('new link')
7674
await this.initNewLink()
7775
} else {
78-
console.log('existing link')
7976
await this.initExistingLink()
8077
}
8178
this.props.linkStore!.setIsEditingDisabled(!this.props.isNewLink);
@@ -106,40 +103,31 @@ class LinkView extends React.Component<ILinkViewProps, ILinkViewState> {
106103

107104
const [startNodeId, endNodeId, transitTypeCode] = this.props.match!.params.id.split(',');
108105

109-
console.log('initExistingLink')
110-
console.log(this.props)
111-
console.log(startNodeId, endNodeId, transitTypeCode)
112106
if (startNodeId && endNodeId && transitTypeCode) {
113107
const link = await LinkService.fetchLink(startNodeId, endNodeId, transitTypeCode);
114-
console.log(link)
115108
if (!link) {
116109
this.props.errorStore!.addError(
117110
`Haku löytää linkki (alkusolmu ${startNodeId}, loppusolmu ${endNodeId}, verkko ${transitTypeCode}) ei onnistunut.`
118111
);
119112
const homeViewLink = routeBuilder.to(SubSites.home).toLink();
120-
console.log(homeViewLink)
121113
navigator.goTo({ link: homeViewLink });
122114
return;
123115
}
124116
this.centerMapToLink(link);
125-
console.log('linkstore init')
126117
this.props.linkStore!.init({
127118
link,
128119
nodes: [link.startNode, link.endNode],
129120
isNewLink: false,
130121
});
131-
console.log('setIsLinkGeometryEditable')
132122
this.props.linkStore!.setIsLinkGeometryEditable(true);
133123
const bounds = L.latLngBounds(link.geometry);
134124
this.props.mapStore!.setMapBounds(bounds);
135125

136-
console.log(link.geometry)
137126
const routePaths: IRoutePathWithDisabledInfo[] = await RoutePathService.fetchRoutePathsUsingLink(
138127
link.startNode.id,
139128
link.endNode.id,
140129
link.transitType!
141130
);
142-
console.log(routePaths)
143131
this._setState({ routePathsUsingLink: routePaths });
144132
}
145133
this._setState({ isLoading: false });

src/components/sidebar/nodeView/NodeForm.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,13 @@ class NodeForm extends Component<INodeFormProps> {
7070

7171
private getShortIdLetterDropdownItems = (nodeId: string) => {
7272
const dropdownItems: IDropdownItem[] = [];
73+
console.log(nodeId)
7374
for (const nodeIdBeginning in SHORT_ID_OPTIONS_MAP) {
75+
console.log(nodeIdBeginning)
7476
if (Object.prototype.hasOwnProperty.call(SHORT_ID_OPTIONS_MAP, nodeIdBeginning)) {
7577
if (nodeId.startsWith(nodeIdBeginning)) {
7678
const nodeIdOptions = SHORT_ID_OPTIONS_MAP[nodeIdBeginning];
79+
console.log(nodeIdOptions)
7780
nodeIdOptions.forEach((nodeIdOption: string) => {
7881
const codeListLabel = this.props.codeListStore!.getCodeListLabel(
7982
'Lyhyttunnus',
@@ -83,6 +86,7 @@ class NodeForm extends Component<INodeFormProps> {
8386
value: nodeIdOption,
8487
label: `${nodeIdOption} - ${codeListLabel}`,
8588
};
89+
console.log(dropdownItem)
8690
dropdownItems.push(dropdownItem);
8791
});
8892
}

src/stores/codeListStore.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class CodeListStore {
4848

4949
public getDropdownItemList = (codeListName: codeListName): IDropdownItem[] => {
5050
const codeListItems = this._codeListMap.get(codeListName);
51-
51+
console.log(codeListItems)
5252
if (codeListItems) {
5353
return codeListItems.map((codeListItem: ICodeListItem) => {
5454
return {
@@ -63,6 +63,7 @@ class CodeListStore {
6363
// TODO: rename as getCodeListValueLabel?
6464
public getCodeListLabel = (codeListName: codeListName, value: string) => {
6565
const codeListItems = this._codeListMap.get(codeListName);
66+
console.log(codeListItems)
6667
if (codeListItems) {
6768
const item = codeListItems.find(
6869
(item) => item.listId === codeListName && item.value === value

0 commit comments

Comments
 (0)