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

Use existing fields for now to get the modal working again

Henriette Dargef66c12bd30e7
diff --git a/app/components/work_packages/date_picker/dialog_content_component.html.erb b/app/components/work_packages/date_picker/dialog_content_component.html.erb
index a60a86b4470..dea60f4c1f4 100644
--- a/app/components/work_packages/date_picker/dialog_content_component.html.erb
+++ b/app/components/work_packages/date_picker/dialog_content_component.html.erb
@@ -37,26 +37,6 @@
end
end
end
-
- body.with_row(mb: 3) do
- flex_layout(justify_content: :space_between, gap: 3) do |second_row|
- second_row.with_column do
- render(Primer::Alpha::TextField.new(name: :start_date,
- label: I18n.t("attributes.start_date"),
- value: work_package.start_date))
- end
- second_row.with_column do
- render(Primer::Alpha::TextField.new(name: :due_date,
- label: I18n.t("attributes.due_date"),
- value: work_package.due_date))
- end
- second_row.with_column do
- render(Primer::Alpha::TextField.new(name: :duration,
- label: I18n.t("activerecord.attributes.work_package.duration"),
- value: work_package.duration))
- end
- end
- end
end
end
end
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 904eb15044c..4c8ad4a3536 100644
--- a/frontend/src/app/shared/components/datepicker/styles/datepicker.modal.sass
+++ b/frontend/src/app/shared/components/datepicker/styles/datepicker.modal.sass
@@ -16,25 +16,11 @@
&_wide
max-width: 600px
- &--banner
- margin-bottom: $spot-spacing-1
-
- &:empty
- visibility: hidden
-
- &--toggle-actions-container
- display: grid
- grid-template-columns: auto auto 1fr
- grid-column-gap: $spot-spacing-2
- margin: 0 $spot-spacing-1 0
- .spot-form-field--input:has(spot-switch)
- margin-bottom: 0px !important
-
&--dates-container
display: grid
grid-template-columns: 1fr 1fr 150px
grid-gap: $spot-spacing-1
- margin: $spot-spacing-1 $spot-spacing-1 0
+ margin: 0 $spot-spacing-1
&--date-field
&_current,
@@ -56,17 +42,6 @@
margin: 0.5rem auto 0 auto !important
overflow: hidden
- &--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: 0
-
@media screen and (max-width: $breakpoint-sm)
.op-datepicker-modal
// Use same width as spot-modal mobile
@@ -79,11 +54,6 @@
&--dates-container
grid-template-columns: 1fr 1fr
- &--toggle-actions-container
- display: grid
- grid-template-columns: 1fr
- grid-row-gap: $spot-spacing-1
-
&--date-form
&:only-child
grid-column: 1 / 3
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 96e219433d6..e0e44644f18 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
@@ -11,18 +11,17 @@
[src]="turboFrameSrc"
id="wp-datepicker-dialog--content">
<op-content-loader viewBox="0 0 100 100">
- <svg:rect x="0" y="0" width="70" height="5" rx="1"/>
+ <svg:rect x="5" y="5" width="70" height="5" rx="1"/>
- <svg:rect x="75" y="0" width="25" height="5" rx="1"/>
+ <svg:rect x="80" y="5" width="15" height="5" rx="1"/>
- <svg:rect x="0" y="10" width="100" height="8" rx="1"/>
+ <svg:rect x="5" y="15" width="90" height="8" rx="1"/>
- <svg:rect x="0" y="25" width="100" height="12" rx="1"/>
+ <svg:rect x="5" y="30" width="90" height="12" rx="1"/>
</op-content-loader>
</turbo-frame>
- <!--<div class="spot-container op-datepicker-modal&#45;&#45;stretch-content">
- <div class="op-datepicker-modal&#45;&#45;toggle-actions-container">
+<!-- TODO <div class="op-datepicker-modal&#45;&#45;toggle-actions-container">
<op-datepicker-scheduling-toggle
name="scheduleManually"
[(ngModel)]="scheduleManually"
@@ -34,91 +33,90 @@
[(ngModel)]="ignoreNonWorkingDays"
(ngModelChange)="changeNonWorkingDays()"
></op-datepicker-working-days-toggle>
- </div>
+ </div>-->
- <div class="op-datepicker-modal&#45;&#45;dates-container">
- <spot-form-field
- [label]="text.startDate"
- data-test-selector="datepicker-start-date"
- >
- <spot-text-field
- slot="input"
- name="startDate"
- data-test-selector="op-datepicker-modal&#45;&#45;start-date-field"
- class="op-datepicker-modal&#45;&#45;date-field"
- [attr.data-qa-highlighted]="showFieldAsActive('start') || undefined"
- [ngClass]="{'op-datepicker-modal&#45;&#45;date-field_current' : showFieldAsActive('start')}"
- [ngModel]="dates.start"
- (ngModelChange)="startDateChanged$.next($event)"
- [disabled]="!isSchedulable"
- [showClearButton]="currentlyActivatedDateField === 'start'"
- (focusin)="setCurrentActivatedField('start')"
- ></spot-text-field>
- <button
- slot="action"
- type="button"
- class="spot-link"
- [ngClass]="{ 'op-datepicker-modal&#45;&#45;hidden-link': !showTodayLink() }"
- (click)="setToday('start')"
- [textContent]="text.today">
- </button>
- </spot-form-field>
- <spot-form-field
- [label]="text.endDate"
- data-test-selector="datepicker-end-date"
- >
- <spot-text-field
- slot="input"
- name="endDate"
- data-test-selector="op-datepicker-modal&#45;&#45;end-date-field"
- class="op-datepicker-modal&#45;&#45;date-field"
- [attr.data-qa-highlighted]="showFieldAsActive('end') || undefined"
- [ngClass]="{'op-datepicker-modal&#45;&#45;date-field_current' : showFieldAsActive('end')}"
- [ngModel]="dates.end"
- (ngModelChange)="endDateChanged$.next($event)"
- [disabled]="!isSchedulable"
- [showClearButton]="currentlyActivatedDateField === 'end'"
- (focusin)="setCurrentActivatedField('end')"
- ></spot-text-field>
- <button
- slot="action"
- type="button"
- class="spot-link"
- [ngClass]="{ 'op-datepicker-modal&#45;&#45;hidden-link': !showTodayLink() }"
- (click)="setToday('end')"
- [textContent]="text.today">
- </button>
- </spot-form-field>
- <spot-form-field
- [label]="text.duration"
- data-test-selector="datepicker-duration"
- >
- <spot-text-field
- #durationField
- slot="input"
- name="duration"
- data-test-selector="op-datepicker-modal&#45;&#45;duration-field"
- class="op-datepicker-modal&#45;&#45;date-field"
- [attr.data-qa-highlighted]=" showFieldAsActive('duration') || undefined"
- [ngClass]="{'op-datepicker-modal&#45;&#45;date-field_current' : showFieldAsActive('duration')}"
- [ngModel]="durationFocused ? duration : displayedDuration"
- [showClearButton]="currentlyActivatedDateField === 'duration'"
- pattern="\d*"
- inputmode="numeric"
- (ngModelChange)="durationChanges$.next($event)"
- [disabled]="!isSchedulable"
- (focusin)="handleDurationFocusIn()"
- (focusout)="handleDurationFocusOut()"
- ></spot-text-field>
- </spot-form-field>
- </div>
+ <div class="op-datepicker-modal--dates-container">
+ <spot-form-field
+ [label]="text.startDate"
+ data-test-selector="datepicker-start-date"
+ >
+ <spot-text-field
+ slot="input"
+ name="startDate"
+ data-test-selector="op-datepicker-modal--start-date-field"
+ class="op-datepicker-modal--date-field"
+ [attr.data-qa-highlighted]="showFieldAsActive('start') || undefined"
+ [ngClass]="{'op-datepicker-modal--date-field_current' : showFieldAsActive('start')}"
+ [ngModel]="dates.start"
+ (ngModelChange)="startDateChanged$.next($event)"
+ [disabled]="!isSchedulable"
+ [showClearButton]="currentlyActivatedDateField === 'start'"
+ (focusin)="setCurrentActivatedField('start')"
+ ></spot-text-field>
+ <button
+ slot="action"
+ type="button"
+ class="spot-link"
+ [ngClass]="{ 'op-datepicker-modal--hidden-link': !showTodayLink() }"
+ (click)="setToday('start')"
+ [textContent]="text.today">
+ </button>
+ </spot-form-field>
+ <spot-form-field
+ [label]="text.endDate"
+ data-test-selector="datepicker-end-date"
+ >
+ <spot-text-field
+ slot="input"
+ name="endDate"
+ data-test-selector="op-datepicker-modal--end-date-field"
+ class="op-datepicker-modal--date-field"
+ [attr.data-qa-highlighted]="showFieldAsActive('end') || undefined"
+ [ngClass]="{'op-datepicker-modal--date-field_current' : showFieldAsActive('end')}"
+ [ngModel]="dates.end"
+ (ngModelChange)="endDateChanged$.next($event)"
+ [disabled]="!isSchedulable"
+ [showClearButton]="currentlyActivatedDateField === 'end'"
+ (focusin)="setCurrentActivatedField('end')"
+ ></spot-text-field>
+ <button
+ slot="action"
+ type="button"
+ class="spot-link"
+ [ngClass]="{ 'op-datepicker-modal--hidden-link': !showTodayLink() }"
+ (click)="setToday('end')"
+ [textContent]="text.today">
+ </button>
+ </spot-form-field>
+ <spot-form-field
+ [label]="text.duration"
+ data-test-selector="datepicker-duration"
+ >
+ <spot-text-field
+ #durationField
+ slot="input"
+ name="duration"
+ data-test-selector="op-datepicker-modal--duration-field"
+ class="op-datepicker-modal--date-field"
+ [attr.data-qa-highlighted]=" showFieldAsActive('duration') || undefined"
+ [ngClass]="{'op-datepicker-modal--date-field_current' : showFieldAsActive('duration')}"
+ [ngModel]="durationFocused ? duration : displayedDuration"
+ [showClearButton]="currentlyActivatedDateField === 'duration'"
+ pattern="\d*"
+ inputmode="numeric"
+ (ngModelChange)="durationChanges$.next($event)"
+ [disabled]="!isSchedulable"
+ (focusin)="handleDurationFocusIn()"
+ (focusout)="handleDurationFocusOut()"
+ ></spot-text-field>
+ </spot-form-field>
+ </div>
- <input
- #flatpickrTarget
- id="flatpickr-input"
- hidden
- />
- </div>-->
+ <input
+ #flatpickrTarget
+ id="flatpickr-input"
+ hidden
+ />
<div class="spot-action-bar">
<div class="spot-action-bar--right">