Add UI for Currency Conversion transformation#9
Conversation
|
|
||
| try { | ||
| const overview = await validate('currency_conversion', data); | ||
| if (overview.error) { |
There was a problem hiding this comment.
Will the overview always have this structure in case of error? {error: ‘something’}
There was a problem hiding this comment.
If we have an error we return {'error': 'error msg'}, but if it is correct we send {'overview': 'overview content'}. If you check the status code, the error ones will be 400 and the correct one 200.
| } No newline at end of file | ||
| } | ||
|
|
||
| .convert-currency { |
There was a problem hiding this comment.
Did you decide not to move it to separate CSS file?
There was a problem hiding this comment.
I didn't finally, but if you think it's a better idea, I will
| <div class="button-container"> | ||
| <button id="add" class="button">ADD COLUMN</button> | ||
| </div> | ||
| </main-card> |
| columns.forEach(column => { | ||
| const isSelected = settings && column.name === settings.from.column; | ||
|
|
||
| const option = isSelected ? `<option value="${column.id}" selected>${column.name}</option>` : `<option value="${column.id}">${column.name}</option>`; |
There was a problem hiding this comment.
What do you think about <option value="${column.id}" ${isSelected ? 'selected' : ''>${column.name}</option> ?
There was a problem hiding this comment.
Looks better, thanks, I'll fix it.
| const currencyFullName = currencies[currency]; | ||
| const isSelected = selectedOption && currency === selectedOption; | ||
|
|
||
| const option = isSelected ? `<option value="${currency}" selected>${currency} • ${currencyFullName}</option>` : `<option value="${currency}">${currency} • ${currencyFullName}</option>`; |
There was a problem hiding this comment.
What do you think about <option value="${currency}" ${isSelected ? 'selected' : ''}>${currency} • ${currencyFullName}?
No description provided.