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

* Update modal class and remove old/obsolete styles (#9438)

Henriette Dargedaebe0e9e478
diff --git a/frontend/src/app/features/boards/board/board-video-teaser-modal/board-video-teaser-modal.component.ts b/frontend/src/app/features/boards/board/board-video-teaser-modal/board-video-teaser-modal.component.ts
deleted file mode 100644
index b8cb03f39b5..00000000000
--- a/frontend/src/app/features/boards/board/board-video-teaser-modal/board-video-teaser-modal.component.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-import {
- ChangeDetectorRef, Component, ElementRef, Inject, OnDestroy, OnInit,
-} from '@angular/core';
-import { OpModalLocalsMap } from 'core-app/shared/components/modal/modal.types';
-import { OpModalComponent } from 'core-app/shared/components/modal/modal.component';
-import { OpModalLocalsToken } from 'core-app/shared/components/modal/modal.service';
-import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { boardTeaserVideoURL } from 'core-app/features/boards/board-constants.const';
-import { DomSanitizer } from '@angular/platform-browser';
-
-@Component({
- template: `
- <div class="op-modal--portal">
- <div class="op-modal--modal-container"
- data-indicator-name="modal"
- tabindex="0">
- <div class="op-modal--modal-header">
- <h3 [textContent]="text.title"></h3>
-
- <a class="op-modal--modal-close-button">
- <i
- class="icon-close"
- (click)="closeMe($event)"
- [attr.title]="text.closePopup">
- </i>
- </a>
- </div>
-
- <iframe [src]="teaserVideoUrl"
- width="800"
- height="500"
- class="boards--teaser-video"
- frameborder="0"
- allow="autoplay; fullscreen"
- allowfullscreen>
- </iframe>
- </div>
- </div>
-
- `,
-})
-export class BoardVideoTeaserModalComponent extends OpModalComponent implements OnInit, OnDestroy {
- /* Close on escape? */
- public closeOnEscape = false;
-
- /* Close on outside click? */
- public closeOnOutsideClick = false;
-
- public text:any = {
- title: this.I18n.t('js.label_board_plural'),
- };
-
- public teaserVideoUrl = this.domSanitizer.bypassSecurityTrustResourceUrl(boardTeaserVideoURL);
-
- constructor(readonly elementRef:ElementRef,
- @Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
- readonly cdRef:ChangeDetectorRef,
- readonly I18n:I18nService,
- readonly domSanitizer:DomSanitizer) {
- super(locals, cdRef, elementRef);
- }
-}
diff --git a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.html b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.html
index c4f6813ab24..b394083ba7c 100644
--- a/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.html
+++ b/frontend/src/app/features/enterprise/enterprise-modal/enterprise-trial.modal.html
@@ -1,7 +1,7 @@
<div class="op-modal">
<op-modal-header (close)="closeMe($event)">{{headerText()}}</op-modal-header>
- <div [ngSwitch]="openWindow()" class="op-modal--modal-body">
+ <div [ngSwitch]="openWindow()" class="op-modal--body">
<!-- first modal window -->
<div *ngSwitchCase="1">
<enterprise-trial-form></enterprise-trial-form>
diff --git a/frontend/src/app/features/invite-user-modal/success/success.component.html b/frontend/src/app/features/invite-user-modal/success/success.component.html
index 1cf5c838b4b..e3009e28dee 100644
--- a/frontend/src/app/features/invite-user-modal/success/success.component.html
+++ b/frontend/src/app/features/invite-user-modal/success/success.component.html
@@ -1,5 +1,5 @@
<div class="op-ium-success">
- <div class="op-modal--body">
+ <div class="op-modal--body op-modal--body_center">
<img [src]="type === PrincipalType.Placeholder ? placeholder_image : user_image" />
<h1 [textContent]="text.title()"></h1>
diff --git a/frontend/src/app/features/invite-user-modal/success/success.component.sass b/frontend/src/app/features/invite-user-modal/success/success.component.sass
index 80036ed5202..33cb1b3b8cd 100644
--- a/frontend/src/app/features/invite-user-modal/success/success.component.sass
+++ b/frontend/src/app/features/invite-user-modal/success/success.component.sass
@@ -2,8 +2,3 @@
flex-grow: 1
display: flex
flex-direction: column
-
- .op-modal--body
- justify-content: center
- align-items: center
- text-align: center
diff --git a/frontend/src/app/shared/components/attribute-help-texts/help-text.modal.html b/frontend/src/app/shared/components/attribute-help-texts/help-text.modal.html
index a85d54d3754..0fb8f48c36c 100644
--- a/frontend/src/app/shared/components/attribute-help-texts/help-text.modal.html
+++ b/frontend/src/app/shared/components/attribute-help-texts/help-text.modal.html
@@ -7,7 +7,7 @@
<span [textContent]="helpText.attributeCaption"></span>
</op-modal-header>
- <div class="op-modal--body">
+ <div class="op-modal--body op-modal--body_limited-height">
<div
class="op-uc-container op-uc-container__no-permalinks"
[innerHtml]="helpText.helpText.html"
diff --git a/frontend/src/app/shared/components/datepicker/datepicker.modal.html b/frontend/src/app/shared/components/datepicker/datepicker.modal.html
index 2a1f01e7260..0e516f689d7 100644
--- a/frontend/src/app/shared/components/datepicker/datepicker.modal.html
+++ b/frontend/src/app/shared/components/datepicker/datepicker.modal.html
@@ -111,24 +111,24 @@
</div>
</div>
</div>
- </div>
- <ng-container *ngIf="!isSchedulable">
- <div class="notification-box -info">
- <div class="notification-box--content">
- <ng-container *ngIf="isParent">
- <p [textContent]="text.isParent"></p>
- </ng-container>
- <ng-container *ngIf="isSwitchedFromManualToAutomatic && !isParent">
- <p [textContent]="text.isSwitchedFromManualToAutomatic"></p>
- </ng-container>
+ <ng-container *ngIf="!isSchedulable">
+ <div class="notification-box -info">
+ <div class="notification-box--content">
+ <ng-container *ngIf="isParent">
+ <p [textContent]="text.isParent"></p>
+ </ng-container>
+ <ng-container *ngIf="isSwitchedFromManualToAutomatic && !isParent">
+ <p [textContent]="text.isSwitchedFromManualToAutomatic"></p>
+ </ng-container>
+ </div>
</div>
- </div>
- </ng-container>
- <ng-container *ngIf="isSchedulable">
- <input id="flatpickr-input"
- hidden>
- </ng-container>
+ </ng-container>
+ <ng-container *ngIf="isSchedulable">
+ <input id="flatpickr-input"
+ hidden>
+ </ng-container>
+ </div>
<div class="op-modal--footer">
<button
diff --git a/frontend/src/app/shared/components/datepicker/datepicker.modal.sass b/frontend/src/app/shared/components/datepicker/datepicker.modal.sass
index 9e87e7eae70..186def1b29f 100644
--- a/frontend/src/app/shared/components/datepicker/datepicker.modal.sass
+++ b/frontend/src/app/shared/components/datepicker/datepicker.modal.sass
@@ -8,10 +8,6 @@
box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.25)
padding: 5px 0 0 0
- .op-modal--modal-body
- overflow: hidden
- margin-bottom: 0
-
.grid-block
align-items: center
diff --git a/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.html b/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.html
index 5456603712e..d7919401739 100644
--- a/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.html
+++ b/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.html
@@ -1,18 +1,10 @@
-<div class="op-modal--portal ">
- <div class="op-modal--modal-container"
- data-indicator-name="modal"
- tabindex="0">
- <div class="op-modal--modal-header">
- <a class="op-modal--modal-close-button">
- <i
- class="icon-close"
- (click)="closeMe($event)"
- [attr.title]="text.closePopup">
- </i>
- </a>
- <h3 [textContent]="text.displayedDays"></h3>
- </div>
+<div class="op-modal"
+ data-indicator-name="modal"
+ tabindex="0">
+
+ <op-modal-header (close)="closeMe($event)">{{text.displayedDays}}</op-modal-header>
+ <div class="op-modal--body">
<div class="form--field -trailing-label" *ngFor="let day of days; let index = index">
<label class="form--label" [textContent]="day.weekDay" [htmlFor]="'day_' + index"></label>
<span class="form--field-container">
@@ -21,19 +13,18 @@
</span>
</span>
</div>
+ </div>
- <div class="tab-content"></div>
- <div class="modal--form-actions">
- <button
- class="button"
- [textContent]="text.cancelButton"
- (click)="closeMe($event)"
- ></button>
- <button
- class="button -highlight"
- [textContent]="text.applyButton"
- (click)="saveChanges()"
- ></button>
- </div>
+ <div class="op-modal--footer">
+ <button
+ class="button"
+ [textContent]="text.cancelButton"
+ (click)="closeMe($event)"
+ ></button>
+ <button
+ class="button -highlight"
+ [textContent]="text.applyButton"
+ (click)="saveChanges()"
+ ></button>
</div>
</div>
diff --git a/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts b/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts
index 61d0f3132d9..d19d53a7fd7 100644
--- a/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts
+++ b/frontend/src/app/shared/components/grids/widgets/time-entries/current-user/configuration-modal/configuration.modal.ts
@@ -53,7 +53,8 @@ export class TimeEntriesCurrentUserConfigurationModalComponent extends OpModalCo
}
ngOnInit() {
- this.daysOriginalCheckedValues = this.locals.options.days || Array.from({ length: 7 }, () => true);
+ let localDayOptions = this.locals.options.days
+ this.daysOriginalCheckedValues = localDayOptions.length > 0 ? localDayOptions : Array.from({ length: 7 }, () => true);
this.days = this.timeEntriesCurrentUserConfigurationModalService.getOrderedDaysData(this.daysOriginalCheckedValues);
}
diff --git a/frontend/src/app/shared/components/modal/modal.sass b/frontend/src/app/shared/components/modal/modal.sass
index d922aaf2375..fe6e11efb31 100644
--- a/frontend/src/app/shared/components/modal/modal.sass
+++ b/frontend/src/app/shared/components/modal/modal.sass
@@ -58,6 +58,17 @@
flex-shrink: 1
overflow-y: auto
+ &:focus
+ outline-style: none
+
+ &_limited-height
+ max-height: 50vh
+
+ &_center
+ justify-content: center
+ align-items: center
+ text-align: center
+
&--title
font-size: 1.3rem
padding: 0
diff --git a/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.html b/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.html
index 2e36faeca35..5012231c231 100644
--- a/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.html
+++ b/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.html
@@ -1,11 +1,11 @@
<div
- class="op-modal confirm-form-submit--modal loading-indicator--location"
+ class="op-modal op-modal_autoheight confirm-form-submit--modal loading-indicator--location"
[ngClass]="{'-highlight -danger-zone' : dangerHighlighting }"
data-indicator-name="modal"
>
<op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>
- <div class="op-modal--modal-body">
+ <div class="op-modal--body">
<p>
<span [textContent]="text.text"></span>
<br/>
diff --git a/frontend/src/app/shared/components/time_entries/create/create.modal.ts b/frontend/src/app/shared/components/time_entries/create/create.modal.ts
index ce2790a7d6c..92edfcdc04a 100644
--- a/frontend/src/app/shared/components/time_entries/create/create.modal.ts
+++ b/frontend/src/app/shared/components/time_entries/create/create.modal.ts
@@ -6,7 +6,6 @@ import { TimeEntryBaseModal } from '../shared/modal/base.modal';
@Component({
templateUrl: '../shared/modal/base.modal.html',
- styleUrls: ['../shared/modal/base.modal.sass'],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
HalResourceEditingService,
diff --git a/frontend/src/app/shared/components/time_entries/edit/edit.modal.ts b/frontend/src/app/shared/components/time_entries/edit/edit.modal.ts
index b2937dd6eed..4dd88f070ec 100644
--- a/frontend/src/app/shared/components/time_entries/edit/edit.modal.ts
+++ b/frontend/src/app/shared/components/time_entries/edit/edit.modal.ts
@@ -6,7 +6,6 @@ import { TimeEntryBaseModal } from 'core-app/shared/components/time_entries/shar
@Component({
templateUrl: '../shared/modal/base.modal.html',
- styleUrls: ['../shared/modal/base.modal.sass'],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
HalResourceEditingService,
diff --git a/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.sass b/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.sass
deleted file mode 100644
index fb1c36bc3dc..00000000000
--- a/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.sass
+++ /dev/null
@@ -1,7 +0,0 @@
-.op-modal--modal-container
- max-width: 90vw
- width: 800px
-
-.icon-log_time
- &:before
- padding-right: 6px
\ No newline at end of file
diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts
index 09bbc615522..2b1d3f09adc 100644
--- a/frontend/src/app/shared/shared.module.ts
+++ b/frontend/src/app/shared/shared.module.ts
@@ -44,7 +44,6 @@ import { CurrentProjectService } from 'core-app/core/current-project/current-pro
import { SortHeaderDirective } from 'core-app/features/work-packages/components/wp-table/sort-header/sort-header.directive';
import { ZenModeButtonComponent } from 'core-app/features/work-packages/components/wp-buttons/zen-mode-toggle-button/zen-mode-toggle-button.component';
import { OPContextMenuComponent } from 'core-app/shared/components/op-context-menu/op-context-menu.component';
-import { BoardVideoTeaserModalComponent } from 'core-app/features/boards/board/board-video-teaser-modal/board-video-teaser-modal.component';
import { OpenprojectPrincipalRenderingModule } from 'core-app/shared/components/principal/principal-rendering.module';
import { DatePickerModule } from 'core-app/shared/components/op-date-picker/date-picker.module';
import { FocusModule } from 'core-app/shared/directives/focus/focus.module';
@@ -223,7 +222,6 @@ export function bootstrapModule(injector:Injector) {
EnterpriseBannerBootstrapComponent,
HomescreenNewFeaturesBlockComponent,
- BoardVideoTeaserModalComponent,
// filter
SlideToggleComponent,
diff --git a/frontend/src/global_styles/content/_forms_mobile.sass b/frontend/src/global_styles/content/_forms_mobile.sass
index 193748d241d..17dbcaf2c6b 100644
--- a/frontend/src/global_styles/content/_forms_mobile.sass
+++ b/frontend/src/global_styles/content/_forms_mobile.sass
@@ -50,8 +50,8 @@
max-width: 100%
#tab-content-info form,
- .op-modal--modal-body form:not(.-vertical),
- form.-wide-labels .op-modal--modal-body
+ .op-modal--body form:not(.-vertical),
+ form.-wide-labels .op-modal--body
.form--label,
.form--field-container
flex-basis: 100% !important
diff --git a/frontend/src/global_styles/content/_help_texts.sass b/frontend/src/global_styles/content/_help_texts.sass
index f83a9031333..6f6b3622f74 100644
--- a/frontend/src/global_styles/content/_help_texts.sass
+++ b/frontend/src/global_styles/content/_help_texts.sass
@@ -27,18 +27,6 @@
//++
.attribute-help-text--modal
- // Set max width of the attribute heading
- .op-modal--modal-header > h2
- width: calc(100% - 80px)
-
- // Set max height of the modal body
- .op-modal--modal-body
- max-height: 50vh
- overflow-y: auto
-
- &:focus
- outline-style: none
-
// Avoid large right margin for conditional button
.help-text--edit-button
margin-right: 0
diff --git a/frontend/src/global_styles/content/_modal.lsg b/frontend/src/global_styles/content/_modal.lsg
index 1df7ba26047..e93d71276f4 100644
--- a/frontend/src/global_styles/content/_modal.lsg
+++ b/frontend/src/global_styles/content/_modal.lsg
@@ -3,14 +3,14 @@
## Modals: Standard style
```
-<div class="op-modal--modal-container">
- <div class="op-modal--modal-header">
+<div class="op-modal">
+ <div class="op-modal--header">
<h3>Export</h3>
- <a class="op-modal--modal-close-button">
+ <a class="op-modal--close-button">
<i class="icon-close" title="Close popup"></i>
</a>
</div>
- <div class="op-modal--modal-body">
+ <div class="op-modal--body">
<ul class="export-options">
<li>
<a>
@@ -57,14 +57,14 @@
## Modals: Highlighted and with footer
```
-<div class="op-modal--modal-container -highlight">
- <div class="op-modal--modal-header">
+<div class="op-modal -highlight">
+ <div class="op-modal--header">
<h2>Welcome to OpenProject</h2>
- <a class="op-modal--modal-close-button" title="Close popup">
+ <a class="op-modal--close-button" title="Close popup">
<i class="icon-close"></i>
</a>
</div>
- <div class="op-modal--modal-body">
+ <div class="op-modal--body">
<b>Please select your language</b>
<fieldset class="form--fieldset">
<div class="form--field">
@@ -81,7 +81,7 @@
</div>
</fieldset>
</div>
- <div class="op-modal--modal-footer">
+ <div class="op-modal--footer">
<button name="button" type="submit" class="button -highlight">Save</button>
</div>
</div>
@@ -90,18 +90,18 @@
## Modals: Danger zone highlighting
```
-<div class="op-modal--modal-container -highlight -danger-zone">
- <div class="op-modal--modal-header">
+<div class="op-modal -highlight -danger-zone">
+ <div class="op-modal--header">
<h3 class="icon-context icon-warning">Confirm deletion of Work Package</h3>
- <a class="op-modal--modal-close-button" title="Close popup">
+ <a class="op-modal--close-button" title="Close popup">
<i class="icon-close"></i>
</a>
</div>
- <div class="op-modal--modal-body">
+ <div class="op-modal--body">
<p>Are you sure you want to delete the following work package?<p>
<p> ... </p>
</div>
- <div class="op-modal--modal-footer">
+ <div class="op-modal--footer">
<button name="button" type="submit" class="button -danger">Continue</button>
<button name="button" type="submit" class="button">Cancel</button>
</div>
diff --git a/frontend/src/global_styles/content/_request_for_confirmation.sass b/frontend/src/global_styles/content/_request_for_confirmation.sass
index 1fa5e21e1d4..150cbac99bd 100644
--- a/frontend/src/global_styles/content/_request_for_confirmation.sass
+++ b/frontend/src/global_styles/content/_request_for_confirmation.sass
@@ -26,16 +26,6 @@
// See docs/COPYRIGHT.rdoc for more details.
//++
-.request-for-confirmation--modal
- .icon-context
- color: var(--font-color-on-primary)
-
- .op-modal--modal-footer
- text-align: right
-
-.request-for-confirmation--submit-button
- margin: 0
-
.request-for-confirmation--form
padding: 10px 0 20px 0
diff --git a/frontend/src/global_styles/content/work_packages/_table_configuration_modal.sass b/frontend/src/global_styles/content/work_packages/_table_configuration_modal.sass
index e751b7657b2..40193e9fce7 100644
--- a/frontend/src/global_styles/content/work_packages/_table_configuration_modal.sass
+++ b/frontend/src/global_styles/content/work_packages/_table_configuration_modal.sass
@@ -13,9 +13,6 @@
input
margin-top: 0px
- .modal--form-actions
- @extend .op-modal--modal-footer
-
.advanced-filters--filter,
.advanced-filters--add-filter
max-width: 100%
diff --git a/spec/features/admin/enterprise/enterprise_trial_spec.rb b/spec/features/admin/enterprise/enterprise_trial_spec.rb
index 7c0e02a5184..6315853755c 100644
--- a/spec/features/admin/enterprise/enterprise_trial_spec.rb
+++ b/spec/features/admin/enterprise/enterprise_trial_spec.rb
@@ -257,7 +257,7 @@ describe 'Enterprise trial management',
end
it 'can confirm that trial regularly' do
- find('.op-modal--modal-body #resend-link', text: 'Resend').click
+ find('.op-modal--body #resend-link', text: 'Resend').click
expect(page).to have_selector('.notification-box.-success', text: 'Email has been resent.', wait: 20)
expect(page).to have_text '[email protected]'
diff --git a/spec/features/work_packages/details/date_editor_spec.rb b/spec/features/work_packages/details/date_editor_spec.rb
index 5744e0288e8..4a6e4c0bada 100644
--- a/spec/features/work_packages/details/date_editor_spec.rb
+++ b/spec/features/work_packages/details/date_editor_spec.rb
@@ -125,7 +125,7 @@ describe 'date inplace editor',
work_packages_page.accept_alert_dialog! if work_packages_page.has_alert_dialog?
# Ensure no modal survives
- expect(page).to have_no_selector('.op-modal--modal-container')
+ expect(page).to have_no_selector('.op-modal')
end
context 'with a date custom field' do