From: Mathieu Suen Date: Thu, 3 Nov 2022 13:20:09 +0000 (+0100) Subject: SONAR-17554 Move the before creation date picker issue filter X-Git-Tag: 9.8.0.63668~144 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b7d4912784b1cb6a4a03740368b9dc8232c979aa;p=sonarqube.git SONAR-17554 Move the before creation date picker issue filter --- diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx index 8c2ccb89ac0..a8e6034c89a 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/CreationDateFacet.tsx @@ -208,6 +208,7 @@ export class CreationDateFacet extends React.PureComponent diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/CreationDateFacet-test.tsx.snap b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/CreationDateFacet-test.tsx.snap index 163a477a60f..1faa1389ddf 100644 --- a/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/CreationDateFacet-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/issues/sidebar/__tests__/__snapshots__/CreationDateFacet-test.tsx.snap @@ -21,6 +21,7 @@ exports[`should render correctly for createdInLast month 1`] = ` className="search-navigator-date-facet-selection" > { render() { const { + alignRight, highlightFrom, highlightTo, minDate, @@ -163,75 +166,81 @@ export default class DateInput extends React.PureComponent { const yearOptions = years.map((year) => ({ label: String(year), value: year })); return ( - - - - (this.input = node)} - name={name} - onFocus={this.openCalendar} - placeholder={placeholder} - readOnly={true} - type="text" - value={value} - /> - - {value !== undefined && ( - + + + + (this.input = node)} + name={name} + onFocus={this.openCalendar} + placeholder={placeholder} + readOnly={true} + type="text" + value={value} /> - )} - {open && ( -
- - } - disabledDays={{ after, before: minDate }} - firstDayOfWeek={1} - modifiers={modifiers} - month={currentMonth} - navbarElement={} - onDayClick={this.handleDayClick} - onDayMouseEnter={this.handleDayMouseEnter} - selectedDays={selectedDays} - weekdaysLong={weekdaysLong} - weekdaysShort={weekdaysShort} + + {value !== undefined && ( + -
- )} -
-
-
+ )} + {open && ( +
+ + } + disabledDays={{ after, before: minDate }} + firstDayOfWeek={1} + modifiers={modifiers} + month={currentMonth} + navbarElement={} + onDayClick={this.handleDayClick} + onDayMouseEnter={this.handleDayMouseEnter} + selectedDays={selectedDays} + weekdaysLong={weekdaysLong} + weekdaysShort={weekdaysShort} + /> +
+ )} +
+
+
+ ); } } diff --git a/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx b/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx index 505439ed196..8d847690577 100644 --- a/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx +++ b/server/sonar-web/src/main/js/components/controls/DateRangeInput.tsx @@ -31,6 +31,7 @@ interface Props { minDate?: Date; onChange: (date: DateRange) => void; value?: DateRange; + alignEndDateCalandarRight?: boolean; } export default class DateRangeInput extends React.PureComponent { @@ -60,7 +61,7 @@ export default class DateRangeInput extends React.PureComponent { }; render() { - const { minDate, maxDate } = this.props; + const { alignEndDateCalandarRight, minDate, maxDate } = this.props; return (
@@ -88,6 +89,7 @@ export default class DateRangeInput extends React.PureComponent { {translate('end_date')} - - - - - - - + + + + + + + `; exports[`should render 2`] = ` - - - - - - + + + - - - + onClick={[Function]} + /> + + + + `; exports[`should render 3`] = ` - - - - - - -
- + } + classNames={ + Object { + "body": "DayPicker-Body", + "caption": "DayPicker-Caption", + "container": "DayPicker", + "day": "DayPicker-Day", + "disabled": "disabled", + "footer": "DayPicker-Footer", + "interactionDisabled": "DayPicker--interactionDisabled", + "month": "DayPicker-Month", + "months": "DayPicker-Months", + "navBar": "DayPicker-NavBar", + "navButtonInteractionDisabled": "DayPicker-NavButton--interactionDisabled", + "navButtonNext": "DayPicker-NavButton DayPicker-NavButton--next", + "navButtonPrev": "DayPicker-NavButton DayPicker-NavButton--prev", + "outside": "outside", + "selected": "selected", + "today": "today", + "todayButton": "DayPicker-TodayButton", + "week": "DayPicker-Week", + "weekNumber": "DayPicker-WeekNumber", + "weekday": "DayPicker-Weekday", + "weekdays": "DayPicker-Weekdays", + "weekdaysRow": "DayPicker-WeekdaysRow", + "wrapper": "DayPicker-wrapper", } - /> -
- - - - - } - classNames={ - Object { - "body": "DayPicker-Body", - "caption": "DayPicker-Caption", - "container": "DayPicker", - "day": "DayPicker-Day", - "disabled": "disabled", - "footer": "DayPicker-Footer", - "interactionDisabled": "DayPicker--interactionDisabled", - "month": "DayPicker-Month", - "months": "DayPicker-Months", - "navBar": "DayPicker-NavBar", - "navButtonInteractionDisabled": "DayPicker-NavButton--interactionDisabled", - "navButtonNext": "DayPicker-NavButton DayPicker-NavButton--next", - "navButtonPrev": "DayPicker-NavButton DayPicker-NavButton--prev", - "outside": "outside", - "selected": "selected", - "today": "today", - "todayButton": "DayPicker-TodayButton", - "week": "DayPicker-Week", - "weekNumber": "DayPicker-WeekNumber", - "weekday": "DayPicker-Weekday", - "weekdays": "DayPicker-Weekdays", - "weekdaysRow": "DayPicker-WeekdaysRow", - "wrapper": "DayPicker-wrapper", } - } - disabledDays={ - Object { - "after": 2018-02-05T00:00:00.000Z, - "before": 2018-01-17T00:00:00.000Z, + disabledDays={ + Object { + "after": 2018-02-05T00:00:00.000Z, + "before": 2018-01-17T00:00:00.000Z, + } } - } - enableOutsideDaysClick={true} - firstDayOfWeek={1} - fixedWeeks={false} - labels={ - Object { - "nextMonth": "Next Month", - "previousMonth": "Previous Month", + enableOutsideDaysClick={true} + firstDayOfWeek={1} + fixedWeeks={false} + labels={ + Object { + "nextMonth": "Next Month", + "previousMonth": "Previous Month", + } } - } - locale="en" - localeUtils={ - Object { - "default": Object { + locale="en" + localeUtils={ + Object { + "default": Object { + "formatDay": [Function], + "formatMonthTitle": [Function], + "formatWeekdayLong": [Function], + "formatWeekdayShort": [Function], + "getFirstDayOfWeek": [Function], + "getMonths": [Function], + }, "formatDay": [Function], "formatMonthTitle": [Function], "formatWeekdayLong": [Function], "formatWeekdayShort": [Function], "getFirstDayOfWeek": [Function], "getMonths": [Function], - }, - "formatDay": [Function], - "formatMonthTitle": [Function], - "formatWeekdayLong": [Function], - "formatWeekdayShort": [Function], - "getFirstDayOfWeek": [Function], - "getMonths": [Function], + } } - } - month={2018-01-17T00:00:00.000Z} - navbarElement={} - numberOfMonths={1} - onDayClick={[Function]} - onDayMouseEnter={[Function]} - pagedNavigation={false} - renderDay={[Function]} - renderWeek={[Function]} - reverseMonths={false} - selectedDays={ - Array [ - 2018-01-17T00:00:00.000Z, - ] - } - showOutsideDays={false} - showWeekDays={true} - showWeekNumbers={false} - tabIndex={0} - weekdayElement={} - weekdaysLong={ - Array [ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - ] - } - weekdaysShort={ - Array [ - "Sun", - "Mon", - "Tue", - "Wed", - "Thu", - "Fri", - "Sat", - ] - } - /> -
- - - + month={2018-01-17T00:00:00.000Z} + navbarElement={} + numberOfMonths={1} + onDayClick={[Function]} + onDayMouseEnter={[Function]} + pagedNavigation={false} + renderDay={[Function]} + renderWeek={[Function]} + reverseMonths={false} + selectedDays={ + Array [ + 2018-01-17T00:00:00.000Z, + ] + } + showOutsideDays={false} + showWeekDays={true} + showWeekNumbers={false} + tabIndex={0} + weekdayElement={} + weekdaysLong={ + Array [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + ] + } + weekdaysShort={ + Array [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat", + ] + } + /> + + + + + `; exports[`should select a day 1`] = ` - - - - - - - - + + + + + + + `; diff --git a/server/sonar-web/src/main/js/components/controls/styles.css b/server/sonar-web/src/main/js/components/controls/styles.css index 5e1f933b40e..fccb909849f 100644 --- a/server/sonar-web/src/main/js/components/controls/styles.css +++ b/server/sonar-web/src/main/js/components/controls/styles.css @@ -65,6 +65,11 @@ box-shadow: var(--defaultShadow); } +.date-input-calendar.align-right { + left: initial; + right: 0; +} + .date-input-calendar-nav { display: flex; justify-content: space-between; diff --git a/server/sonar-web/src/main/js/components/search-navigator.css b/server/sonar-web/src/main/js/components/search-navigator.css index b0a6a287545..60a486ddcab 100644 --- a/server/sonar-web/src/main/js/components/search-navigator.css +++ b/server/sonar-web/src/main/js/components/search-navigator.css @@ -348,13 +348,6 @@ button.search-navigator-facet:focus, visibility: hidden; } -.search-navigator-date-facet-selection - .date-input-control:not(:nth-of-type(1)) - .date-input-calendar { - left: auto; - right: 0; -} - .search-navigator-filters { position: relative; padding: 5px 10px;