Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fixes to datepicker styles (#12091)

Yule750310c59dd6
diff --git a/frontend/src/app/shared/components/datepicker/multi-date-picker/multi-date-picker.component.html b/frontend/src/app/shared/components/datepicker/multi-date-picker/multi-date-picker.component.html
index 725aaf880a9..453ade81e38 100644
--- a/frontend/src/app/shared/components/datepicker/multi-date-picker/multi-date-picker.component.html
+++ b/frontend/src/app/shared/components/datepicker/multi-date-picker/multi-date-picker.component.html
@@ -16,7 +16,7 @@
<form
slot="body"
- class="spot-container op-datepicker-modal op-datepicker-modal_wide"
+ class="op-datepicker-modal op-datepicker-modal_wide"
data-qa-selector="op-datepicker-modal"
tabindex="0"
cdkFocusInitial
@@ -24,8 +24,7 @@
[cdkTrapFocusAutoCapture]="true"
(submit)="save($event)"
>
-
- <div class="spot-container">
+ <div class="spot-container op-datepicker-modal--stretch-content">
<div class="op-datepicker-modal--dates-container">
<spot-form-field
[label]="text.startDate"
@@ -85,7 +84,7 @@
<button
type="button"
(click)="close()"
- class="button spot-action-bar--action"
+ class="spot-modal--cancel-button button spot-action-bar--action"
data-qa-selector="op-datepicker-modal--action"
[textContent]="text.cancel"
></button>
diff --git a/frontend/src/app/shared/components/datepicker/single-date-picker/single-date-picker.component.html b/frontend/src/app/shared/components/datepicker/single-date-picker/single-date-picker.component.html
index 370c210857e..a170f40304c 100644
--- a/frontend/src/app/shared/components/datepicker/single-date-picker/single-date-picker.component.html
+++ b/frontend/src/app/shared/components/datepicker/single-date-picker/single-date-picker.component.html
@@ -30,8 +30,7 @@
[cdkTrapFocusAutoCapture]="true"
(submit)="save($event)"
>
-
- <div class="spot-container">
+ <div class="spot-container op-datepicker-modal--stretch-content">
<div class="op-datepicker-modal--toggle-actions-container">
<op-datepicker-working-days-toggle
*ngIf="showIgnoreNonWorkingDays"
@@ -40,20 +39,19 @@
(ngModelChange)="changeNonWorkingDays()"
></op-datepicker-working-days-toggle>
</div>
- </div>
- <ng-content select="[slot=extra-fields]"></ng-content>
+ <ng-content select="[slot=extra-fields]"></ng-content>
- <spot-form-field
- [label]="text.date"
- [required]="required"
- >
- <spot-text-field
- slot="input"
- name="date"
- class="op-datepicker-modal--date-field"
- [ngModel]="workingValue"
+ <spot-form-field
+ [label]="text.date"
[required]="required"
+ >
+ <spot-text-field
+ slot="input"
+ name="date"
+ class="op-datepicker-modal--date-field"
+ [ngModel]="workingValue"
+ [required]="required"
(ngModelChange)="writeWorkingValue($event)"
[showClearButton]="true"
></spot-text-field>
@@ -64,16 +62,16 @@
(click)="setToday()"
[textContent]="text.today">
</button>
- </spot-form-field>
-
- <div #flatpickrTarget></div>
+ </spot-form-field>
+ <div #flatpickrTarget></div>
+ </div>
<div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
type="button"
(click)="opened = false"
- class="button spot-action-bar--action"
+ class="button spot-modal--cancel-button spot-action-bar--action"
data-qa-selector="op-datepicker-modal--action"
[textContent]="text.cancel"
></button>
diff --git a/frontend/src/app/shared/components/datepicker/styles/datepicker.modal.sass b/frontend/src/app/shared/components/datepicker/styles/datepicker.modal.sass
index b2660cfad2e..3b615ff4ede 100644
--- a/frontend/src/app/shared/components/datepicker/styles/datepicker.modal.sass
+++ b/frontend/src/app/shared/components/datepicker/styles/datepicker.modal.sass
@@ -3,18 +3,25 @@
.op-datepicker-modal
display: flex
flex-direction: column
- min-height: 200px
- width: 100vw
- // Basically the width of the two calendars next to each other + spacings
- // will be overwritten on mobile
- max-width: 300px
+ height: 100%
- &_wide
- max-width: 600px
+ @media #{$spot-mq-drop-modal-in-context}
+ height: unset
+ min-height: 200px
+ width: 100vw
+ // Basically the width of the two calendars next to each other + spacings
+ // will be overwritten on mobile
+ max-width: 320px
+
+ &_wide
+ max-width: 600px
&--banner
margin-bottom: $spot-spacing-1
+ &:empty
+ display: none
+
&--toggle-actions-container
display: grid
grid-template-columns: auto auto 1fr
@@ -36,12 +43,19 @@
&--date-container
display: inline-grid
- &--action
- &:last-of-type
- margin-right: 0
-
&--hidden-link
visibility: hidden
&--flatpickr-instance
margin: 1rem auto
+
+ &--stretch-content
+ flex-grow: 1
+ flex-shrink: 1
+ overflow-y: auto
+
+ // Unfortunately, we need an extra class
+ // Of specificity here to overwrite the
+ // nested spot-container styles
+ &.spot-container
+ margin-top: $spot-spacing-0_5
diff --git a/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.html b/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.html
index 079ce668c23..40a3ddb25a4 100644
--- a/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.html
+++ b/frontend/src/app/shared/components/datepicker/wp-multi-date-form/wp-multi-date-form.component.html
@@ -12,7 +12,7 @@
class="op-datepicker-modal--banner"
></op-datepicker-banner>
- <div class="spot-container">
+ <div class="spot-container op-datepicker-modal--stretch-content">
<div class="op-datepicker-modal--toggle-actions-container">
<op-datepicker-scheduling-toggle
name="scheduleManually"
@@ -116,13 +116,13 @@
<button
type="button"
(click)="doCancel()"
- class="op-datepicker-modal--action spot-modal--cancel-button button button_no-margin spot-action-bar--action"
+ class="spot-modal--cancel-button button spot-action-bar--action"
data-qa-selector="op-datepicker-modal--action"
[textContent]="text.cancel"
></button>
<button
type="submit"
- class="op-datepicker-modal--action button button_no-margin -highlight spot-action-bar--action"
+ class="button -highlight spot-action-bar--action"
data-qa-selector="op-datepicker-modal--action"
[textContent]="text.save"
></button>
diff --git a/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.html b/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.html
index 7a9117750bb..d3472f12d1c 100644
--- a/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.html
+++ b/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.html
@@ -1,5 +1,5 @@
<form
- class="op-datepicker-modal"
+ class="spot-container op-datepicker-modal"
data-qa-selector="op-datepicker-modal"
[attr.id]="htmlId"
#modalContainer
@@ -12,7 +12,7 @@
class="op-datepicker-modal--banner"
></op-datepicker-banner>
- <div class="spot-container">
+ <div class="spot-container op-datepicker-modal--stretch-content">
<op-datepicker-scheduling-toggle
class="spot-form-field"
name="scheduleManually"
@@ -61,13 +61,13 @@
<button
type="button"
(click)="doCancel()"
- class="op-datepicker-modal--action spot-modal--cancel-button button button_no-margin spot-action-bar--action"
+ class="spot-modal--cancel-button button spot-action-bar--action"
data-qa-selector="op-datepicker-modal--action"
[textContent]="text.cancel"
></button>
<button
type="submit"
- class="op-datepicker-modal--action button button_no-margin -highlight spot-action-bar--action"
+ class="button -highlight spot-action-bar--action"
data-qa-selector="op-datepicker-modal--action"
[textContent]="text.save"
></button>
diff --git a/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.sass b/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.sass
new file mode 100644
index 00000000000..5f1b75586c9
--- /dev/null
+++ b/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.sass
@@ -0,0 +1,2 @@
+.op-wp-single-date-form
+ height: 100%
diff --git a/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.ts b/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.ts
index b0fba98612c..28a802fe1b1 100644
--- a/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.ts
+++ b/frontend/src/app/shared/components/datepicker/wp-single-date-form/wp-single-date-form.component.ts
@@ -73,6 +73,7 @@ import { DateModalSchedulingService } from '../services/date-modal-scheduling.se
selector: 'op-wp-single-date-form',
templateUrl: './wp-single-date-form.component.html',
styleUrls: [
+ './wp-single-date-form.component.sass',
'../styles/datepicker.modal.sass',
'../styles/datepicker_mobile.modal.sass',
],
@@ -84,7 +85,7 @@ import { DateModalSchedulingService } from '../services/date-modal-scheduling.se
],
})
export class OpWpSingleDateFormComponent extends UntilDestroyedMixin implements AfterViewInit, OnInit {
- @HostBinding('class.op-datepicker-modal') className = true;
+ @HostBinding('class.op-wp-single-date-form') className = true;
@Input('value') value = '';
diff --git a/frontend/src/app/shared/components/modal/modal-banner/modal-banner.component.sass b/frontend/src/app/shared/components/modal/modal-banner/modal-banner.component.sass
index a5978fafd37..6e0e7e906b7 100644
--- a/frontend/src/app/shared/components/modal/modal-banner/modal-banner.component.sass
+++ b/frontend/src/app/shared/components/modal/modal-banner/modal-banner.component.sass
@@ -10,6 +10,10 @@
@media only screen and (max-width: 679px)
grid-template-columns: auto max-content
+ &:first-child
+ border-top-left-radius: $spot-spacing-0-25
+ border-top-right-radius: $spot-spacing-0-25
+
&_warning
background: $spot-color-feedback-warning-light
diff --git a/frontend/src/app/spot/styles/sass/components/drop-modal.sass b/frontend/src/app/spot/styles/sass/components/drop-modal.sass
index 07e5442c2cd..cb4404fd005 100644
--- a/frontend/src/app/spot/styles/sass/components/drop-modal.sass
+++ b/frontend/src/app/spot/styles/sass/components/drop-modal.sass
@@ -73,7 +73,6 @@
top: auto
height: auto
bottom: $spot-spacing-0_75
- width: calc(100% - 2 * $spot-spacing-1)
left: 50%
transform: translateX(-50%)
background-color: $spot-color-basic-white
diff --git a/frontend/src/app/spot/styles/sass/components/modal.sass b/frontend/src/app/spot/styles/sass/components/modal.sass
index 67709bd1020..c8b449c129d 100644
--- a/frontend/src/app/spot/styles/sass/components/modal.sass
+++ b/frontend/src/app/spot/styles/sass/components/modal.sass
@@ -77,5 +77,5 @@
outline-style: none
&--cancel-button
- @media #{$spot-mq-mobile}
+ @media #{$spot-mq-drop-modal-full-screen}
display: none
diff --git a/frontend/src/app/spot/styles/sass/components/selector-field.sass b/frontend/src/app/spot/styles/sass/components/selector-field.sass
index 40e192ec5f2..46cdcf76905 100644
--- a/frontend/src/app/spot/styles/sass/components/selector-field.sass
+++ b/frontend/src/app/spot/styles/sass/components/selector-field.sass
@@ -18,7 +18,7 @@
padding-left: 0.5rem
padding-right: 0
- @media #{$spot-mq-mobile}
+ @media #{$spot-mq-drop-modal-full-screen}
// Push input to end of grid
justify-self: end