Skip to content

Commit

Permalink
fixed copy/paste bug in the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
xXBJXx committed Jan 4, 2023
1 parent 21b6900 commit ba1bff7
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 21 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
NodeJS v14 or higher is required.

## Migration Guides
[Migration guide to 3.3.4](docs/guide/migration_3.3.4.md)\
[Migration guide to 3.3.5](docs/guide/migration_3.3.5.md)\
[Migration guide to 3.3.3](docs/guide/migration_3.3.x.md)\
[Migration guide to 3.1.x](docs/guide/migration_3.1.x.md)

Expand All @@ -27,6 +27,9 @@ NodeJS v14 or higher is required.
Placeholder for the next version (at the beginning of the line):
### __WORK IN PROGRESS__ (- falls nicht benötigt löschen sonst klammern entfernen und nach dem - dein text schreiben)
-->
### __WORK IN PROGRESS__
* (xXBJXx) fixed copy/paste bug in the UI

### 3.3.4 (2023-01-03)
* (xXBJXx) Fixed an issue where a postal code starting with 0 was not displayed correctly [Issue #113](https://github.com/iobroker-community-adapters/ioBroker.tankerkoenig/issues/113)

Expand Down
2 changes: 1 addition & 1 deletion admin/build/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions admin/build/index.js.map

Large diffs are not rendered by default.

17 changes: 8 additions & 9 deletions admin/src/component/AddStationDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,32 +121,31 @@ export const AddStationDialog: React.FC<RowProps> = ({ addRow }): JSX.Element =>
setError(false);
const result = await handleDetailRequest(id, 'detailRequest');
if (result) {
setNewRow({
...newRow,
station: id,
...result,
});
setCity(result.city);
setHouseNumber(result.houseNumber);

if (result.postCode) {
result.postCode = result.postCode.toString();
if (result.postCode !== '') {
// check if the zip code has 5 digits
if (result.postCode.length === 5) {
setPostCode(result.postCode);
} else {
// setze der postleitzahl eine 0 voran
setPostCode('0' + result.postCode);
// prefix the zip code with 0 until it has 5 digits
setPostCode(`0${result.postCode}`);
result.postCode = `0${result.postCode}`;
}
} else {
setPostCode('');
}
} else {
setPostCode('');
}

setStreet(result.street);
setNewRow({
...newRow,
station: id,
...result,
});
}
} else {
setError(true);
Expand Down
13 changes: 7 additions & 6 deletions admin/src/component/EditTableDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ export const EditTableDialog: React.FC<RowProps> = ({ editRow, oldRow, checkAler
if (id.match(pattern)) {
const result = await handleDetailRequest(id, 'detailRequest');
if (result) {
setEditRow({
...newEditRow,
station: id,
...result,
});
setCity(result.city);
setHouseNumber(result.houseNumber);

Expand All @@ -155,14 +150,20 @@ export const EditTableDialog: React.FC<RowProps> = ({ editRow, oldRow, checkAler
setPostCode(result.postCode);
} else {
// setze der postleitzahl eine 0 voran
setPostCode('0' + result.postCode);
setPostCode(`0${result.postCode}`);
result.postCode = `0${result.postCode}`;
}
} else {
setPostCode('');
}
} else {
setPostCode('');
}
setEditRow({
...newEditRow,
station: id,
...result,
});
setStreet(result.street);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Adapter Migration

## Update von 3.3.3 auf 3.3.4 deutsch :de:
## Update von 3.3.3 auf 3.3.5 deutsch :de:
Bei dem Update wurde die Postleitzahl von Nummer auf Text umgestellt.\
Da in der Adapter config die Postleitzahl als Nummer gespeichert wurde, wird beim Adapter Start eine Warnung angezeigt.\
![img_4.png](img_4.png)\
Expand All @@ -15,7 +15,7 @@ Vorgehensweise:

Nach dem Speichern startet der Adapter neu und die Warnung sollte nicht mehr angezeigt werden.

## update from 3.3.3 to 3.3.4 english :gb:
## update from 3.3.3 to 3.3.5 english :gb:
During the update the postal code was changed from number to text.\
Because in the adapter config the zip code was saved as number, a warning is displayed at adapter startup.\
![img_4.png](img_4.png)\
Expand Down

0 comments on commit ba1bff7

Please sign in to comment.