Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a026781
Draft for Date Dynamic values
gabrieldutra Jun 16, 2019
1e98d07
Use value with prefix instead of specific attr
gabrieldutra Jun 17, 2019
f7cca04
Fix not possible to select static value
gabrieldutra Jun 17, 2019
e595dc3
Update antd version
gabrieldutra Jun 23, 2019
7efcd39
Cleanup and DateRangeParameter
gabrieldutra Jun 27, 2019
050eb61
Dynamic DateTimeRange
gabrieldutra Jun 27, 2019
6af6091
Add Dynamic options to Date Parameters
gabrieldutra Jun 27, 2019
7df5aad
UI refinements
gabrieldutra Jun 30, 2019
ad8d03f
Add getDynamicValue function
gabrieldutra Jul 1, 2019
8044d18
Add 'This' options and prevent text clipping
gabrieldutra Jul 1, 2019
2b945a0
Merge branch 'master' into parameter-dynamic-date-values
gabrieldutra Jul 1, 2019
f3c013e
Make allowClear available
gabrieldutra Jul 1, 2019
e5981c4
Update ScheduleDialog snapshot
gabrieldutra Jul 1, 2019
fbe7e37
Add some protections and separate Date/DateRange
gabrieldutra Jul 2, 2019
b755989
Accept null values on date or daterange parameters
gabrieldutra Jul 2, 2019
ca7f481
Handle undefined values on Moment propType
gabrieldutra Jul 8, 2019
09a50d2
Merge branch 'master' into parameter-dynamic-date-values
gabrieldutra Jul 11, 2019
5933a4e
Move export to end of files
gabrieldutra Jul 11, 2019
89a3e7f
Remove Today/Now option
gabrieldutra Jul 16, 2019
c64eb83
Merge branch 'master' into parameter-dynamic-date-values
gabrieldutra Jul 16, 2019
ed1f53b
Merge branch 'master' into parameter-dynamic-date-values
gabrieldutra Jul 17, 2019
63d2e66
Update with Apply Changes
gabrieldutra Jul 17, 2019
e4f5896
Show name instead of value for dynamic values
gabrieldutra Jul 17, 2019
80d61d7
Add comment about supporting useCurrentDateTime
gabrieldutra Jul 17, 2019
1ef0d0d
Cypress Tests: Date Parameters
gabrieldutra Jul 17, 2019
8d7255f
Cypress Tests: Date Range Parameters
gabrieldutra Jul 17, 2019
cf42e97
Don't put null params in the url
gabrieldutra Jul 17, 2019
02e740f
Add workaround comments to Cypress tests
gabrieldutra Jul 18, 2019
e77b9c4
Fix Dynamic Value as default for global parameters
gabrieldutra Jul 18, 2019
f23540b
Update Back to Static Value
gabrieldutra Jul 18, 2019
f9dda5a
Add isValid to value on Date and DateRange inputs
gabrieldutra Jul 18, 2019
1f45ad0
CR suggestions
gabrieldutra Jul 18, 2019
b81b74f
Fix Back to Static Value for Dates
gabrieldutra Jul 18, 2019
7b8bc5a
Update Dynamic Value Styling
gabrieldutra Jul 18, 2019
ccb1e78
Fix failing Date tests
gabrieldutra Jul 18, 2019
b7dea34
Fix selectedDynamicValue
gabrieldutra Jul 21, 2019
323fd24
Merge branch 'master' into parameter-dynamic-date-values
gabrieldutra Jul 21, 2019
2b05dac
Merge branch 'master' into parameter-dynamic-date-values
gabrieldutra Jul 22, 2019
34ee589
Parameter spec: Remove date range clickThrough
gabrieldutra Jul 22, 2019
794fde7
Add transition
gabrieldutra Jul 23, 2019
4c2b034
Fix failing Cypress tests
gabrieldutra Jul 23, 2019
44a0ca9
Back with 'width: auto'
gabrieldutra Jul 23, 2019
43e3248
Merge branch 'master' into parameter-dynamic-date-values
gabrieldutra Jul 23, 2019
16bed9c
Check value is valid on Back to Static value
gabrieldutra Jul 23, 2019
9a7881a
CR
gabrieldutra Jul 24, 2019
184bd5e
Update Date Range width
gabrieldutra Jul 25, 2019
a9b25f1
Merge branch 'master' into parameter-dynamic-date-values
gabrieldutra Jul 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make allowClear available
  • Loading branch information
gabrieldutra committed Jul 1, 2019
commit f3c013e20548ba52e0111a0f8aea685293ff2273
10 changes: 2 additions & 8 deletions client/app/components/DateInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,16 @@ export function DateInput({
value,
onSelect,
className,
hideValue,
...props
}) {
const format = clientConfig.dateFormat || 'YYYY-MM-DD';
const additionalAttributes = {};
if (defaultValue && defaultValue.isValid()) {
additionalAttributes.defaultValue = defaultValue;
}
if (value && value.isValid()) {
if (value !== undefined) {
additionalAttributes.value = value;
}
if (hideValue) {
additionalAttributes.value = null;
}
return (
<DatePicker
className={className}
Expand All @@ -41,15 +37,13 @@ DateInput.propTypes = {
value: Moment,
onSelect: PropTypes.func,
className: PropTypes.string,
hideValue: PropTypes.bool,
};

DateInput.defaultProps = {
defaultValue: null,
value: null,
value: undefined,
onSelect: () => {},
className: '',
hideValue: false,
};

export default function init(ngModule) {
Expand Down
10 changes: 2 additions & 8 deletions client/app/components/DateRangeInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,16 @@ export function DateRangeInput({
value,
onSelect,
className,
hideValue,
...props
}) {
const format = clientConfig.dateFormat || 'YYYY-MM-DD';
const additionalAttributes = {};
if (isArray(defaultValue) && defaultValue[0].isValid() && defaultValue[1].isValid()) {
additionalAttributes.defaultValue = defaultValue;
}
if (isArray(value) && value[0].isValid() && value[1].isValid()) {
if (value !== undefined) {
additionalAttributes.value = value;
}
if (hideValue) {
additionalAttributes.value = null;
}
return (
<RangePicker
className={className}
Expand All @@ -43,15 +39,13 @@ DateRangeInput.propTypes = {
value: PropTypes.arrayOf(Moment),
onSelect: PropTypes.func,
className: PropTypes.string,
hideValue: PropTypes.bool,
};

DateRangeInput.defaultProps = {
defaultValue: null,
value: null,
value: undefined,
onSelect: () => {},
className: '',
hideValue: false,
};

export default function init(ngModule) {
Expand Down
10 changes: 2 additions & 8 deletions client/app/components/DateTimeInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export function DateTimeInput({
withSeconds,
onSelect,
className,
hideValue,
...props
}) {
const format = (clientConfig.dateFormat || 'YYYY-MM-DD') +
Expand All @@ -20,12 +19,9 @@ export function DateTimeInput({
if (defaultValue && defaultValue.isValid()) {
additionalAttributes.defaultValue = defaultValue;
}
if (value && value.isValid()) {
if (value !== undefined) {
additionalAttributes.value = value;
}
if (hideValue) {
additionalAttributes.value = null;
}
return (
<DatePicker
className={className}
Expand All @@ -45,16 +41,14 @@ DateTimeInput.propTypes = {
withSeconds: PropTypes.bool,
onSelect: PropTypes.func,
className: PropTypes.string,
hideValue: PropTypes.bool,
};

DateTimeInput.defaultProps = {
defaultValue: null,
value: null,
value: undefined,
withSeconds: false,
onSelect: () => {},
className: '',
hideValue: false,
};

export default function init(ngModule) {
Expand Down
10 changes: 2 additions & 8 deletions client/app/components/DateTimeRangeInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export function DateTimeRangeInput({
withSeconds,
onSelect,
className,
hideValue,
...props
}) {
const format = (clientConfig.dateFormat || 'YYYY-MM-DD') +
Expand All @@ -23,12 +22,9 @@ export function DateTimeRangeInput({
if (isArray(defaultValue) && defaultValue[0].isValid() && defaultValue[1].isValid()) {
additionalAttributes.defaultValue = defaultValue;
}
if (isArray(value) && value[0].isValid() && value[1].isValid()) {
if (value !== undefined) {
additionalAttributes.value = value;
}
if (hideValue) {
additionalAttributes.value = null;
}
return (
<RangePicker
className={className}
Expand All @@ -47,16 +43,14 @@ DateTimeRangeInput.propTypes = {
withSeconds: PropTypes.bool,
onSelect: PropTypes.func,
className: PropTypes.string,
hideValue: PropTypes.bool,
};

DateTimeRangeInput.defaultProps = {
defaultValue: null,
value: null,
value: undefined,
withSeconds: false,
onSelect: () => {},
className: '',
hideValue: false,
};

export default function init(ngModule) {
Expand Down
4 changes: 1 addition & 3 deletions client/app/components/dynamic-parameters/DateParameter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,12 @@ export default class DateParameter extends React.Component {

if (dynamicValue) {
additionalAttributes.placeholder = parameter.dynamicValue && parameter.dynamicValue.name;
additionalAttributes.hideValue = true;
}

return (
<DateComponent
className={classNames('redash-datepicker', { 'dynamic-value': dynamicValue }, className)}
value={value}
value={dynamicValue ? null : value}
onSelect={this.onSelect}
suffixIcon={(
<DynamicButton
Expand All @@ -89,7 +88,6 @@ export default class DateParameter extends React.Component {
onSelect={this.onDynamicValueSelect}
/>
)}
allowClear={false}
{...additionalAttributes}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,12 @@ export default class DateRangeParameter extends React.Component {

if (dynamicValue) {
additionalAttributes.placeholder = [parameter.dynamicValue && parameter.dynamicValue.name];
additionalAttributes.hideValue = true;
}

return (
<DateRangeComponent
className={classNames('redash-datepicker', { 'dynamic-value': dynamicValue }, className)}
value={value}
value={dynamicValue ? null : value}
onSelect={this.onSelect}
suffixIcon={(
<DynamicButton
Expand All @@ -109,7 +108,6 @@ export default class DateRangeParameter extends React.Component {
onSelect={this.onDynamicValueSelect}
/>
)}
allowClear={false}
{...additionalAttributes}
/>
);
Expand Down