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

[#46172] fix top level forms in modals

Eric Schubert30ca4264fcde
diff --git a/app/views/account/_register.html.erb b/app/views/account/_register.html.erb
index 7bdc7bfac9c..3f3c37f3ceb 100644
--- a/app/views/account/_register.html.erb
+++ b/app/views/account/_register.html.erb
@@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<div class="modal-delivery-element">
- <%= labelled_tabular_form_for(@user, url: account_register_path, html: { class: 'form -wide-labels' }) do |f| %>
+ <%= labelled_tabular_form_for(@user, url: account_register_path, html: { class: 'form -wide-labels spot-modal' }) do |f| %>
<%= back_url_hidden_field_tag %>
<%= error_messages_for :user %>
diff --git a/frontend/src/app/features/invite-user-modal/invite-user.component.html b/frontend/src/app/features/invite-user-modal/invite-user.component.html
index ab7a1790cbe..a966f532ed7 100644
--- a/frontend/src/app/features/invite-user-modal/invite-user.component.html
+++ b/frontend/src/app/features/invite-user-modal/invite-user.component.html
@@ -4,7 +4,6 @@
></div>
<op-ium-project-selection
*ngIf="!loading && step === Steps.ProjectSelection"
- class="spot-modal"
[project]="project"
[type]="type"
(save)="onProjectSelectionSave($event)"
@@ -17,7 +16,6 @@
<op-ium-principal
*ngIf="!loading && step === Steps.Principal"
- class="spot-modal"
[project]="project"
[roleData]="role"
[messageData]="message"
@@ -34,7 +32,6 @@
<op-ium-summary
*ngIf="!loading && step === Steps.Summary"
- class="spot-modal"
[project]="project"
[principalData]="principalData"
[type]="type"
diff --git a/frontend/src/app/features/invite-user-modal/principal/principal.component.html b/frontend/src/app/features/invite-user-modal/principal/principal.component.html
index 78058771286..bb245195437 100644
--- a/frontend/src/app/features/invite-user-modal/principal/principal.component.html
+++ b/frontend/src/app/features/invite-user-modal/principal/principal.component.html
@@ -1,4 +1,5 @@
<form
+ class="spot-modal"
[formGroup]="principalForm"
(ngSubmit)="onSubmit($event)"
>
@@ -79,9 +80,9 @@
slot="errors"
class="spot-form-field--error"
*ngIf="roleControl?.invalid"
- >
- {{ text.role.required }}
- </div>
+ >
+ {{ text.role.required }}
+ </div>
</spot-form-field>
<spot-form-field
@@ -96,8 +97,8 @@
#input>
</textarea>
- <p
- class="spot-form-field--description"
+ <p
+ class="spot-form-field--description"
slot="action"
[innerHtml]="text.message.description()">
</p>
@@ -110,7 +111,7 @@
type="button"
class="button button_no-margin spot-action-bar--action"
(click)="back.emit()"
- >
+ >
<op-icon icon-classes="button--icon icon-arrow-left1"></op-icon>
{{ text.principal.backButton }}
</button>
@@ -121,10 +122,13 @@
type="button"
class="button button_no-margin spot-action-bar--action spot-modal--cancel-button"
(click)="close.emit()"
- >
- {{ text.principal.cancelButton }}
- </button>
- <button class="button button_no-margin -highlight spot-action-bar--action">{{ text.principal.nextButton }}</button>
+ [textContent]="text.principal.cancelButton"
+ ></button>
+ <button
+ type="submit"
+ class="button button_no-margin -highlight spot-action-bar--action"
+ [textContent]="text.principal.nextButton"
+ ></button>
</div>
</div>
</form>
diff --git a/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.html b/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.html
index 4d33ba5c80c..454c61daf24 100644
--- a/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.html
+++ b/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.html
@@ -1,4 +1,5 @@
<form
+ class="spot-modal"
[formGroup]="projectAndTypeForm"
(ngSubmit)="onSubmit($event)"
>
@@ -67,10 +68,14 @@
<button
type="button"
class="button spot-action-bar--action spot-modal--cancel-button"
- (click)="close.emit()"> {{ text.cancelButton }}
- </button>
- <button class="button -highlight spot-action-bar--action">{{ text.nextButton }}</button>
-
+ (click)="close.emit()"
+ [textContent]="text.cancelButton"
+ ></button>
+ <button
+ type="submit"
+ class="button -highlight spot-action-bar--action"
+ [textContent]="text.nextButton"
+ ></button>
</div>
</div>
</form>
diff --git a/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.sass b/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.sass
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.ts b/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.ts
index a2de2ad0b79..24dd375d7ed 100644
--- a/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.ts
+++ b/frontend/src/app/features/invite-user-modal/project-selection/project-selection.component.ts
@@ -32,7 +32,6 @@ import { ICapability } from 'core-app/core/state/capabilities/capability.model';
selector: 'op-ium-project-selection',
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './project-selection.component.html',
- styleUrls: ['./project-selection.component.sass'],
})
export class ProjectSelectionComponent implements OnInit {
@Input() type:PrincipalType;
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 b0b1b0576f2..f9ce47f736a 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,16 +1,24 @@
-<div class="op-ium-success">
- <div class="spot-modal--body spot-container op-ium-success--content">
- <img [src]="type === PrincipalType.Placeholder ? placeholder_image : user_image" />
+<div
+ class="spot-modal--header"
+ [textContent]="text.title()"
+></div>
- <h1 [textContent]="text.title()"></h1>
+<div class="spot-divider"></div>
- <p [textContent]="text.description[type]()"></p>
- <p>
- <button
- (click)="close.emit()"
- class="button -highlight"
- type="button"
- >{{ text.nextButton }}</button>
- </p>
+<div class="spot-modal--body spot-container">
+ <img class="op-ium-success-image"
+ [src]="type === PrincipalType.Placeholder ? placeholder_image : user_image"/>
+
+ <span [textContent]="text.description[type]()"></span>
+</div>
+
+<div class="spot-action-bar">
+ <div class="spot-action-bar--right">
+ <button
+ type="button"
+ class="button -highlight spot-action-bar--action"
+ (click)="close.emit()"
+ [textContent]="text.nextButton"
+ ></button>
</div>
</div>
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 59dd0724fa1..ad8ab97c088 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
@@ -1,9 +1,2 @@
-.op-ium-success
- flex-grow: 1
- display: flex
- flex-direction: column
-
- &--content
- justify-content: center
- align-items: center
- text-align: center
+.op-ium-success-image
+ height: 4rem
diff --git a/frontend/src/app/features/invite-user-modal/success/success.component.ts b/frontend/src/app/features/invite-user-modal/success/success.component.ts
index 63d29024316..25ac85e9648 100644
--- a/frontend/src/app/features/invite-user-modal/success/success.component.ts
+++ b/frontend/src/app/features/invite-user-modal/success/success.component.ts
@@ -4,7 +4,9 @@ import {
EventEmitter,
Output,
ElementRef,
+ ChangeDetectionStrategy,
} from '@angular/core';
+
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { ProjectResource } from 'core-app/features/hal/resources/project-resource';
@@ -15,6 +17,7 @@ import { PrincipalType } from '../invite-user.component';
selector: 'op-ium-success',
templateUrl: './success.component.html',
styleUrls: ['./success.component.sass'],
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SuccessComponent {
@Input() principal:HalResource;
diff --git a/frontend/src/app/features/invite-user-modal/summary/summary.component.html b/frontend/src/app/features/invite-user-modal/summary/summary.component.html
index 40e3294da24..bb45bb818a5 100644
--- a/frontend/src/app/features/invite-user-modal/summary/summary.component.html
+++ b/frontend/src/app/features/invite-user-modal/summary/summary.component.html
@@ -1,7 +1,7 @@
<form
name="sendUserInviteForm"
(submit)="onSubmit($event)"
- class="op-ium-summary"
+ class="op-ium-summary spot-modal"
>
<div class="spot-modal--header">{{text.title()}}</div>
@@ -48,6 +48,7 @@
(click)="close.emit()"
>{{ text.cancelButton }}</button>
<button
+ type="submit"
class="button button_no-margin -highlight spot-action-bar--action"
>{{ text.nextButton() }}</button>
</div>