-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 1.8.0-RC1 back into develop #94
Conversation
* Replace concept nodes by concept lists (#88) * Make concept lists the default node type, remove special handling * Add code list resolution to demo data * initial money range filter * update moneyRange * remove accounting update yarn.lock * update demo data * update formatted value for money range * fix decimal scale expect number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a few notes.
Because these are a lot of changes, it's a little weird to review the money filter feature after it was already committed onto a release branch -- I'd prefer if we'd review it isolated from other changes, then merge into develop, then merge develop into release, or, if that is not desired, attempt a cherry-pick of the merged feature and apply it onto the release branch.
frontend/app/api/concepts.json
Outdated
"unit": "1K USD", | ||
"description": "The movie's total budget", | ||
"min": 1 | ||
"min": 1, | ||
"value": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the backend returns concept trees they don't have a value property.
frontend/app/api/concepts.json
Outdated
"exact": 9999 | ||
}, | ||
"defaultValue": { | ||
"min": 4455, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values seem to be quite arbitrary. I'd suggest we set them as value
in the stored-queries/25.json -- otherwise people might wonder what they mean when they try out the demo.
Also, let's be strict about data types here. The backend always sets these values as numbers of cents in the JSON object so we should follow this in the demo data, too.
Additionally, it should never occur that min
/max
and exact
are set at the same time.
className="clearable-input__input" | ||
placeholder={props.placeholder} | ||
type={props.inputType} | ||
onValueChange={(values) => { // values: {floatValue, formattedValue, value} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of providing this comment, we can type-annotate value
directly, i.e.
onValueChange={(values: {floatValue: number, formattedValue: string, value: string}) => {
// Make sure undefined / null is never set as a value, but an empty string instead | ||
const minValue = (value && value.min) || ''; | ||
const maxValue = (value && value.max) || ''; | ||
const exactValue = (value && value.exact) || ''; | ||
const minFormattedValue = ((formattedValue && formattedValue.min) || minValue) || ''; | ||
const maxFormattedValue = ((formattedValue && formattedValue.max) || maxValue) || ''; | ||
const exactFormattedValue = ((formattedValue && formattedValue.exact) || exactValue) || ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you have to divide minValue / maxValue / exactValue by 100 at this point -- those are provided as cent values.
|
||
import { isEmpty } from '../common/helpers'; | ||
import { MONEY_RANGE } from '.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a question of taste -- import {} from '.'
is not very descriptive, we could also import this directly from './filterTypes'
{ | ||
min: props.input.formattedValue ? props.input.formattedValue.min : null, | ||
max: props.input.formattedValue ? props.input.formattedValue.max : null, | ||
[type]: formattedValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why -- but when I was testing, the x-Buttons inside the input elements didn't have the expected effect.
When resetting in exact mode, nothing happens, when in range-mode, only the formattedValue is reset but not the underlying raw value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting the values in exact or the ranges was generally a problem. Should be correct now
frontend/app/api/concepts.json
Outdated
@@ -59,10 +59,20 @@ | |||
{ | |||
"id": "budget", | |||
"label": "Budget", | |||
"type": "INTEGER_RANGE", | |||
"type": "MONEY_RANGE", | |||
"unit": "1K USD", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make sense when we're now entering Euro values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will render the correct filter type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the "unit": "1K USD"
line
@@ -14,6 +15,7 @@ export const SUPPORTED_FILTERS = { | |||
REAL_RANGE: REAL_RANGE, | |||
STRING: STRING, | |||
BIG_MULTI_SELECT: BIG_MULTI_SELECT, | |||
MONEY_RANGE: MONEY_RANGE, | |||
// Maybe later: | |||
// 'MONEY_RANGE' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Could you remove this comment line, now that we have a MONEY_RANGE
? Could you also add MONEY_RANGE
below REAL_RANGE
above, so that all range filter types are grouped together?
@@ -120,7 +121,6 @@ const ParameterTableFilters = (props: PropsType) => ( | |||
inputType="number" | |||
input={{ | |||
value: filter.value, | |||
defaultValue: filter.defaultValue, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this (same goes for INTEGER_RANGE
above)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ask myself the same thing. I did not consciously remove that.
I had a branch on money range open, but by making a new delivery tomorrow, I've already merged the feature branch into the release branch. |
frontend/.eslintrc.json
Outdated
@@ -24,7 +24,7 @@ | |||
"comma-dangle": 0, // May be there, helps better diffs and easier maintainability | |||
"indent": 0, // We indent how we like. (sometimes a custom indentation is great) | |||
"jsx-quotes": [2, "prefer-double"], | |||
"max-len": [2, 100], | |||
"max-len": [2, 120], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a reason to change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The width of the monitors or the current font sizes allow this. The value 150 would also go ;) if you do not mind I would leave it like that.
frontend/app/api/concepts.json
Outdated
"unit": "1K USD", | ||
"description": "The movie's total budget", | ||
"min": 1 | ||
"min": 1, | ||
"defaultValue": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we should rather demo this in the example stored query, instead of always settings this default value.
What movie has a budget smaller than 44,55 Euros? 😉
Also, the value for exact
has to be removed.
No description provided.