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

[43842] Re-design and small changes to modal dialogues (DS) for coherence (#11246)

Behrokh Satarnejad8dec25034bfe
diff --git a/app/helpers/confirmation_dialog_helper.rb b/app/helpers/confirmation_dialog_helper.rb
index b3733b89fc5..bbb33a82437 100644
--- a/app/helpers/confirmation_dialog_helper.rb
+++ b/app/helpers/confirmation_dialog_helper.rb
@@ -30,7 +30,15 @@ module ConfirmationDialogHelper
##
# Show an angular modal confirmation dialog using the augmented
# ConfirmationDialogService
- def augmented_confirmation_dialog(title: nil, text: nil, danger_zone: false, button_continue: nil, button_cancel: nil)
+ def augmented_confirmation_dialog(
+ title: nil,
+ text: nil,
+ danger_zone: false,
+ button_continue: nil,
+ button_cancel: nil,
+ icon_continue: nil,
+ divider: nil
+ )
{
'augmented-confirm-dialog': {
text: {
@@ -39,7 +47,11 @@ module ConfirmationDialogHelper
button_continue:,
button_cancel:
}.compact,
- dangerHighlighting: danger_zone
+ dangerHighlighting: danger_zone,
+ divideContent: divider,
+ icon: {
+ continue: icon_continue
+ }.compact
}.to_json
}
end
diff --git a/app/views/account/_footer.html.erb b/app/views/account/_footer.html.erb
index 43240e86e76..bd0de28b4d1 100644
--- a/app/views/account/_footer.html.erb
+++ b/app/views/account/_footer.html.erb
@@ -1,4 +1,4 @@
-<div class="spot-modal--footer spot-action-bar">
+<div class="spot-action-bar">
<div class="spot-action-bar--right">
<% if footer = registration_footer %>
<span><%= footer %></span>
diff --git a/app/views/account/_register.html.erb b/app/views/account/_register.html.erb
index e427430e2a5..a551ffa74ce 100644
--- a/app/views/account/_register.html.erb
+++ b/app/views/account/_register.html.erb
@@ -37,7 +37,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= I18n.t('onboarding.welcome', app_title: Setting.app_title) %>
</div>
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<h2><%= t(:label_register) %></h2>
<section class="form--section">
<% if @user.auth_source_id.nil? %>
diff --git a/app/views/admin/settings/working_days_settings/show.html.erb b/app/views/admin/settings/working_days_settings/show.html.erb
index 0ff07f02982..637c20adb27 100644
--- a/app/views/admin/settings/working_days_settings/show.html.erb
+++ b/app/views/admin/settings/working_days_settings/show.html.erb
@@ -46,7 +46,8 @@ See COPYRIGHT and LICENSE files for more details.
title: t('working_days.change_button'),
button_continue: t('working_days.change_button'),
text: "#{t('working_days.warning')}\n#{t(:text_are_you_sure_continue)}",
- danger_zone: true
+ danger_zone: true,
+ divider: true
)
) do %>
<section class="form--section">
diff --git a/app/views/enterprises/_current.html.erb b/app/views/enterprises/_current.html.erb
index dd8f34b4590..238c3a70762 100644
--- a/app/views/enterprises/_current.html.erb
+++ b/app/views/enterprises/_current.html.erb
@@ -13,7 +13,13 @@
<%= form_tag(enterprise_path,
method: :delete,
- data: augmented_confirmation_dialog
+ data: augmented_confirmation_dialog(
+ danger_zone: true,
+ text: t('admin.enterprise.delete_token_modal.text'),
+ title: t('admin.enterprise.delete_token_modal.title'),
+ button_continue: t(:button_delete),
+ icon_continue: 'delete'
+ )
) do %>
<%= styled_button_tag t(:button_delete),
method: :delete,
diff --git a/app/views/onboarding/_configuration_modal.html.erb b/app/views/onboarding/_configuration_modal.html.erb
index 1d416c185bf..3d68cb2fc00 100644
--- a/app/views/onboarding/_configuration_modal.html.erb
+++ b/app/views/onboarding/_configuration_modal.html.erb
@@ -35,7 +35,7 @@ See COPYRIGHT and LICENSE files for more details.
<div class="spot-divider"></div>
- <div class="onboarding--main spot-modal--body">
+ <div class="onboarding--main spot-modal--body spot-container">
<b><%= I18n.t('onboarding.select_language') %></b>
<fieldset class="form--fieldset">
<div class="form--field">
@@ -44,7 +44,7 @@ See COPYRIGHT and LICENSE files for more details.
</fieldset>
</div>
- <div class="onboarding--footer spot-modal--footer spot-action-bar">
+ <div class="onboarding--footer spot-action-bar">
<div class="spot-action-bar--right">
<%= styled_button_tag t(:button_save), class: 'button_no-margin -highlight -with-icon icon-checkmark spot-action-bar--action' %>
</div>
diff --git a/app/views/onboarding/_onboarding_video_modal.html.erb b/app/views/onboarding/_onboarding_video_modal.html.erb
index e920a8b257d..6f5569d40bc 100644
--- a/app/views/onboarding/_onboarding_video_modal.html.erb
+++ b/app/views/onboarding/_onboarding_video_modal.html.erb
@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.
<span><%= I18n.t('onboarding.welcome', app_title: Setting.app_title) %></span>
</div>
<div class="spot-divider"></div>
- <div class="onboarding--main spot-modal--body">
+ <div class="onboarding--main spot-modal--body spot-container">
<h2><%= I18n.t('onboarding.heading_getting_started') %></h2>
<div class="onboarding--video-block">
<div class="onboarding--video-text">
@@ -44,11 +44,10 @@ See COPYRIGHT and LICENSE files for more details.
</div>
</div>
- <div class="onboarding--footer spot-modal--footer spot-action-bar">
+ <div class="onboarding--footer spot-action-bar">
<div class="spot-action-bar--right">
- <span><em><%= I18n.t('onboarding.text_show_again') %></em></span>
<button
- class="button button_no-margin -highlight spot-action-bar--action"
+ class="button button_no-margin spot-action-bar--action"
dynamic-content-modal-close-button
title=<%= t(:button_close) %>
><%= t(:button_close) %></button>
diff --git a/app/views/projects/_project_export_modal.html.erb b/app/views/projects/_project_export_modal.html.erb
index 4a5978b085a..cd618a9fe01 100644
--- a/app/views/projects/_project_export_modal.html.erb
+++ b/app/views/projects/_project_export_modal.html.erb
@@ -32,7 +32,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= I18n.t('js.label_export') %>
</div>
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<ul class="spot-export-options">
<% supported_export_formats.each do |key| %>
<li class="op-export-options--option">
diff --git a/app/views/wiki/_wiki_export_modal.html.erb b/app/views/wiki/_wiki_export_modal.html.erb
index fec8be77b91..78f7bb036e2 100644
--- a/app/views/wiki/_wiki_export_modal.html.erb
+++ b/app/views/wiki/_wiki_export_modal.html.erb
@@ -32,7 +32,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= I18n.t('js.label_export') %>
</div>
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<ul class="op-export-options">
<li class="op-export-options--option">
<%= link_to url_for(
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 525a7ee5b1f..8895dadb1b3 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -75,6 +75,9 @@ en:
enterprise:
upgrade_to_ee: "Upgrade to the Enterprise Edition"
add_token: "Upload an Enterprise Edition support token"
+ delete_token_modal:
+ text: "Are you sure you want to remove the current Enterprise Edition token used?"
+ title: "Delete token"
replace_token: "Replace your current support token"
order: "Order Enterprise on-premises Edition"
paste: "Paste your Enterprise Edition support token"
@@ -2268,8 +2271,7 @@ en:
onboarding:
heading_getting_started: "Get an overview"
- text_getting_started_description: "Get a quick overview of project management and team collaboration with OpenProject."
- text_show_again: "You can restart this video from the help menu"
+ text_getting_started_description: "Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu."
welcome: "Welcome to %{app_title}"
select_language: "Please select your language"
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index 3ee9a99de5a..606c68d7532 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -1131,12 +1131,14 @@ en:
button_save: "Save"
button_submit: "Submit"
button_cancel: "Cancel"
+ button_delete: "Delete"
form_submit:
title: 'Confirm to continue'
text: 'Are you sure you want to perform this action?'
destroy_work_package:
title: "Confirm deletion of %{label}"
- text: "Are you sure you want to delete the following %{label} ?"
+ single_text: "Are you sure you want to delete the work package"
+ bulk_text: "Are you sure you want to delete the following %{label}?"
has_children: "The work package has %{childUnits}:"
confirm_deletion_children: "I acknowledge that ALL descendants of the listed work packages will be recursively removed."
deletes_children: "All child work packages and their descendants will also be recursively deleted."
@@ -1263,7 +1265,7 @@ en:
role:
label: 'Role in %{project}'
no_roles_found: 'No roles were found'
- description: 'This is the role that %{principal} will receive when they join your project. The role defines which actions they are allowed to take and which information they are allowed to see.
+ description: 'This is the role that the user will receive when they join your project. The role defines which actions they are allowed to take and which information they are allowed to see.
<a
href="https://www.openproject.org/docs/system-admin-guide/users-permissions/roles-permissions/#roles-and-permissions"
target="_blank">
@@ -1274,8 +1276,8 @@ en:
message:
label: 'Invitation message'
- description: 'We will send an email to %{principal}, to which you can add a personal message here. An explanation for the invitation could be useful, or perhaps a bit of information regarding the project to help them get started.'
- next_button: 'Review invitation'
+ description: 'We will send an email to the user, to which you can add a personal message here. An explanation for the invitation could be useful, or prehaps a bit of information regarding the rpoject to help them get started.'
+ next_button: 'Next'
summary:
next_button: 'Send invitation'
diff --git a/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.html b/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.html
index 5a0941eefb4..a77a47c7066 100644
--- a/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.html
+++ b/frontend/src/app/features/boards/board/add-list-modal/add-list-modal.html
@@ -6,7 +6,7 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<div *ngIf="showWarning && warningText"
class="op-toast -warning">
<div class="op-toast--content">
@@ -45,7 +45,7 @@
</div>
</div>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
class="button button_no-margin spot-action-bar--action"
diff --git a/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.html b/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.html
index 6e6066f7be8..c4a56778a43 100644
--- a/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.html
+++ b/frontend/src/app/features/boards/board/configuration-modal/board-configuration.modal.html
@@ -1,16 +1,16 @@
<div
- class="spot-modal wp-table--configuration-modal loading-indicator--location"
+ class="spot-modal loading-indicator--location"
data-indicator-name="modal"
>
<div class="spot-modal--header">{{text.title}}</div>
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<div class="tab-content" #tabContentOutlet></div>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
class="button button_no-margin spot-action-bar--action"
diff --git a/frontend/src/app/features/boards/new-board-modal/new-board-modal.component.ts b/frontend/src/app/features/boards/new-board-modal/new-board-modal.component.ts
index a88e7fa2844..ad50f9fb012 100644
--- a/frontend/src/app/features/boards/new-board-modal/new-board-modal.component.ts
+++ b/frontend/src/app/features/boards/new-board-modal/new-board-modal.component.ts
@@ -83,6 +83,7 @@ export class NewBoardModalComponent extends OpModalComponent implements OnInit {
teaser_text: this.I18n.t('js.boards.upsale.teaser_text'),
upgrade_to_ee_text: this.I18n.t('js.boards.upsale.upgrade'),
more_info_ee_link: enterpriseDocsUrl.boards,
+ cancel_button: this.I18n.t('js.button_cancel'),
};
constructor(
diff --git a/frontend/src/app/features/boards/new-board-modal/new-board-modal.html b/frontend/src/app/features/boards/new-board-modal/new-board-modal.html
index 5739fab3c1b..52e423ab910 100644
--- a/frontend/src/app/features/boards/new-board-modal/new-board-modal.html
+++ b/frontend/src/app/features/boards/new-board-modal/new-board-modal.html
@@ -6,7 +6,7 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<p
*ngIf="eeShowBanners"
>
@@ -28,4 +28,16 @@
</tile-view>
</section>
</div>
+
+ <div class="spot-action-bar">
+ <div class="spot-action-bar--right">
+ <button
+ type="button"
+ class="button button_no-margin spot-action-bar--action"
+ (click)="closeMe()"
+ >
+ {{ text.cancel_button }}
+ </button>
+ </div>
+ </div>
</div>
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 463b7ac38c5..70dca218e15 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
@@ -3,7 +3,7 @@
<div class="spot-divider"></div>
- <div [ngSwitch]="openWindow()" class="spot-modal--body">
+ <div [ngSwitch]="openWindow()" class="spot-modal--body spot-container">
<!-- first modal window -->
<div *ngSwitchCase="1">
<enterprise-trial-form></enterprise-trial-form>
@@ -30,7 +30,7 @@
</div>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<div *ngIf="!eeTrialService.status || eeTrialService.cancelled; else mailSubmitted"
class="spot-action-bar--right">
diff --git a/frontend/src/app/features/invite-user-modal/invite-user-modal.module.ts b/frontend/src/app/features/invite-user-modal/invite-user-modal.module.ts
index f03573f0449..3916eb2ae8c 100644
--- a/frontend/src/app/features/invite-user-modal/invite-user-modal.module.ts
+++ b/frontend/src/app/features/invite-user-modal/invite-user-modal.module.ts
@@ -14,9 +14,7 @@ import { InviteUserModalComponent } from './invite-user.component';
import { ProjectSelectionComponent } from './project-selection/project-selection.component';
import { PrincipalComponent } from './principal/principal.component';
import { PrincipalSearchComponent } from './principal/principal-search.component';
-import { RoleComponent } from './role/role.component';
import { RoleSearchComponent } from './role/role-search.component';
-import { MessageComponent } from './message/message.component';
import { SummaryComponent } from './summary/summary.component';
import { SuccessComponent } from './success/success.component';
@@ -47,9 +45,7 @@ export function initializeServices(injector:Injector) {
ProjectSelectionComponent,
PrincipalComponent,
PrincipalSearchComponent,
- RoleComponent,
RoleSearchComponent,
- MessageComponent,
SuccessComponent,
SummaryComponent,
],
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 ce7ecc4c38b..ab7a1790cbe 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
@@ -9,42 +9,29 @@
[type]="type"
(save)="onProjectSelectionSave($event)"
(close)="closeMe()"
+ tabindex="0"
+ cdkFocusInitial
+ cdkTrapFocus
+ [cdkTrapFocusAutoCapture]="true"
></op-ium-project-selection>
<op-ium-principal
*ngIf="!loading && step === Steps.Principal"
class="spot-modal"
[project]="project"
+ [roleData]="role"
+ [messageData]="message"
[principalData]="principalData"
[type]="type"
(save)="onPrincipalSave($event)"
(back)="goTo(Steps.ProjectSelection)"
(close)="closeMe()"
+ tabindex="0"
+ cdkFocusInitial
+ cdkTrapFocus
+ [cdkTrapFocusAutoCapture]="true"
></op-ium-principal>
-<op-ium-role
- *ngIf="!loading && step === Steps.Role"
- class="spot-modal"
- [role]="role"
- [principal]="principalData.principal"
- [project]="project"
- [type]="type"
- (save)="onRoleSave($event)"
- (back)="goTo(Steps.Principal)"
- (close)="closeMe()"
-></op-ium-role>
-
-<op-ium-message
- *ngIf="!loading && step === Steps.Message"
- class="spot-modal"
- [message]="message"
- [principal]="principalData.principal"
- [project]="project"
- (save)="onMessageSave($event)"
- (back)="goTo(Steps.Role)"
- (close)="closeMe()"
-></op-ium-message>
-
<op-ium-summary
*ngIf="!loading && step === Steps.Summary"
class="spot-modal"
@@ -54,8 +41,12 @@
[role]="role"
[message]="message"
(save)="onSuccessfulSubmission($event)"
- (back)="goTo(this.type === 'placeholder' ? Steps.Role : Steps.Message)"
+ (back)="goTo(Steps.Principal)"
(close)="closeMe()"
+ tabindex="0"
+ cdkFocusInitial
+ cdkTrapFocus
+ [cdkTrapFocusAutoCapture]="true"
></op-ium-summary>
<op-ium-success
@@ -66,4 +57,8 @@
*ngIf="!loading && step === Steps.Success"
class="spot-modal"
(close)="closeWithPrincipal()"
+ tabindex="0"
+ cdkFocusInitial
+ cdkTrapFocus
+ [cdkTrapFocusAutoCapture]="true"
></op-ium-success>
diff --git a/frontend/src/app/features/invite-user-modal/invite-user.component.ts b/frontend/src/app/features/invite-user-modal/invite-user.component.ts
index 529c98766a2..05f291490f5 100644
--- a/frontend/src/app/features/invite-user-modal/invite-user.component.ts
+++ b/frontend/src/app/features/invite-user-modal/invite-user.component.ts
@@ -19,8 +19,6 @@ import { ProjectResource } from 'core-app/features/hal/resources/project-resourc
enum Steps {
ProjectSelection,
Principal,
- Role,
- Message,
Summary,
Success,
}
@@ -99,28 +97,17 @@ export class InviteUserModalComponent extends OpModalComponent implements OnInit
this.goTo(Steps.Principal);
}
- onPrincipalSave({ principalData, isAlreadyMember }:{ principalData:PrincipalData, isAlreadyMember:boolean }):void {
+ onPrincipalSave({
+ principalData, isAlreadyMember, role, message,
+ }:{ principalData:PrincipalData, isAlreadyMember:boolean, role:RoleResource, message:string }):void {
this.principalData = principalData;
+ this.role = role;
+ this.message = message;
if (isAlreadyMember) {
return this.closeWithPrincipal();
}
- return this.goTo(Steps.Role);
- }
-
- onRoleSave(role:RoleResource):void {
- this.role = role;
-
- if (this.type === PrincipalType.Placeholder) {
- this.goTo(Steps.Summary);
- } else {
- this.goTo(Steps.Message);
- }
- }
-
- onMessageSave({ message }:{ message:string }):void {
- this.message = message;
- this.goTo(Steps.Summary);
+ return this.goTo(Steps.Summary);
}
onSuccessfulSubmission($event:{ principal:HalResource }):void {
diff --git a/frontend/src/app/features/invite-user-modal/message/message.component.html b/frontend/src/app/features/invite-user-modal/message/message.component.html
deleted file mode 100644
index 1c590537e6e..00000000000
--- a/frontend/src/app/features/invite-user-modal/message/message.component.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<form
- [formGroup]="messageForm"
- (ngSubmit)="onSubmit($event)"
->
- <div class="spot-modal--header">{{text.title()}}</div>
-
- <div class="spot-divider"></div>
-
- <div class="spot-modal--body op-form">
- <op-form-field [label]="text.label">
- <p class="op-form-field--description" slot="description">
- {{ text.description() }}
- </p>
- <textarea
- class="op-input op-ium-invite-message-field"
- [formControl]="messageControl"
- slot="input"
- #input
- autofocus>
- </textarea>
- </op-form-field>
- </div>
-
- <div class="spot-modal--footer spot-action-bar">
- <div class="spot-action-bar--right">
- <button
- type="button"
- class="button button_no-margin spot-action-bar--action"
- (click)="back.emit()"
- >{{ text.backButton }}</button>
- <button class="button button_no-margin -highlight spot-action-bar--action">{{ text.nextButton }}</button>
- </div>
- </div>
-</form>
diff --git a/frontend/src/app/features/invite-user-modal/message/message.component.sass b/frontend/src/app/features/invite-user-modal/message/message.component.sass
deleted file mode 100644
index b4366a5fbf7..00000000000
--- a/frontend/src/app/features/invite-user-modal/message/message.component.sass
+++ /dev/null
@@ -1,2 +0,0 @@
-.op-ium-invite-message-field
- height: 8em
diff --git a/frontend/src/app/features/invite-user-modal/message/message.component.ts b/frontend/src/app/features/invite-user-modal/message/message.component.ts
deleted file mode 100644
index 2a03f47587d..00000000000
--- a/frontend/src/app/features/invite-user-modal/message/message.component.ts
+++ /dev/null
@@ -1,84 +0,0 @@
-import {
- Component,
- OnInit,
- Input,
- EventEmitter,
- Output,
- ElementRef,
- ViewChild,
-} from '@angular/core';
-import {
- FormControl,
- FormGroup,
-} from '@angular/forms';
-import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { ProjectResource } from 'core-app/features/hal/resources/project-resource';
-import { HalResource } from 'core-app/features/hal/resources/hal-resource';
-import { PrincipalType } from '../invite-user.component';
-
-@Component({
- selector: 'op-ium-message',
- templateUrl: './message.component.html',
- styleUrls: ['./message.component.sass'],
-})
-export class MessageComponent implements OnInit {
- @Input() type:PrincipalType;
-
- @Input() project:ProjectResource;
-
- @Input() principal:HalResource;
-
- @Input() message = '';
-
- @Output() close = new EventEmitter<void>();
-
- @Output() back = new EventEmitter<void>();
-
- @Output() save = new EventEmitter<{ message:string }>();
-
- @ViewChild('input') input:ElementRef;
-
- public text = {
- title: () => this.I18n.t('js.invite_user_modal.title.invite_principal_to_project', {
- principal: this.principal?.name,
- project: this.project?.name,
- }),
- label: this.I18n.t('js.invite_user_modal.message.label'),
- description: () => this.I18n.t('js.invite_user_modal.message.description', {
- principal: this.principal?.name,
- }),
- backButton: this.I18n.t('js.invite_user_modal.back'),
- nextButton: this.I18n.t('js.invite_user_modal.message.next_button'),
- };
-
- messageForm = new FormGroup({
- message: new FormControl(''),
- });
-
- get messageControl() {
- return this.messageForm.get('message');
- }
-
- constructor(
- readonly I18n:I18nService,
- readonly elementRef:ElementRef,
- ) {}
-
- ngOnInit() {
- this.messageControl?.setValue(this.message);
- }
-
- ngAfterViewInit() {
- this.input.nativeElement.focus();
- }
-
- onSubmit($e:Event) {
- $e.preventDefault();
- if (this.messageForm.invalid) {
- this.messageForm.markAsDirty();
- return;
- }
-
- this.save.emit({ message: this.messageControl?.value });
- }
-}
diff --git a/frontend/src/app/features/invite-user-modal/principal/principal-search.component.html b/frontend/src/app/features/invite-user-modal/principal/principal-search.component.html
index 43b1dc53dff..455aaf0546c 100644
--- a/frontend/src/app/features/invite-user-modal/principal/principal-search.component.html
+++ b/frontend/src/app/features/invite-user-modal/principal/principal-search.component.html
@@ -9,7 +9,6 @@
[clearSearchOnAdd]="false"
[compareWith]="compareWith"
bindValue="principal"
- autofocus
#ngselect
>
<ng-template ng-label-tmp let-item="item">
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 df6c9fd0e58..d07c17dc105 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
@@ -2,11 +2,11 @@
[formGroup]="principalForm"
(ngSubmit)="onSubmit($event)"
>
- <div class="spot-modal--header">{{text.title()}}</div>
+ <div class="spot-modal--header">{{text.principal.title()}}</div>
<div class="spot-divider"></div>
- <div class="spot-modal--body op-form">
+ <div class="spot-modal--body spot-container">
<op-form-field
[label]="textLabel"
required
@@ -24,32 +24,32 @@
*ngIf="isNewPrincipal && type === PrincipalType.User"
slot="input"
>
- <b>{{ text.inviteUser }}</b> {{ principal.name }}
+ <b>{{ text.principal.inviteUser }}</b> {{ principal.name }}
<button
type="button"
class="spot-link"
(click)="principalControl?.setValue(null)"
- >{{ text.change }}</button>
+ >{{ text.principal.change }}</button>
</p>
<p
*ngIf="isNewPrincipal && type === PrincipalType.Placeholder"
slot="input"
>
- <b>{{ text.createNewPlaceholder }}</b> {{ principal.name }}
+ <b>{{ text.principal.createNewPlaceholder }}</b> {{ principal.name }}
<button
type="button"
class="spot-link"
(click)="principalControl?.setValue(null)"
- >{{ text.change }}</button>
+ >{{ text.principal.change }}</button>
</p>
<div
slot="errors"
class="op-form-field--error"
- *ngIf="principalControl?.touched && principalControl?.invalid"
+ *ngIf="principalControl?.invalid"
>
- {{ text.required[type] }}
+ {{ text.principal.required[type] }}
</div>
</op-form-field>
@@ -60,16 +60,69 @@
[formUrl]="apiV3Service.users.form.path"
[handleSubmit]="false"
></op-dynamic-form>
+
+ <op-form-field
+ [label]="text.role.label()"
+ required
+ >
+ <op-ium-role-search
+ [opFormBinding]="roleControl"
+ slot="input"
+ ></op-ium-role-search>
+ <p
+ class="op-form-field--description"
+ slot="help-text"
+ [innerHtml]="text.role.description()"
+ ></p>
+
+ <div
+ slot="errors"
+ class="op-form-field--error"
+ *ngIf="roleControl?.invalid"
+ >
+ {{ text.role.required }}
+ </div>
+ </op-form-field>
+
+ <op-form-field
+ [label]="text.message.label"
+ *ngIf="type !== PrincipalType.Placeholder"
+ >
+
+ <textarea
+ class="op-input op-ium-invite-message-field"
+ [formControl]="messageControl"
+ slot="input"
+ #input>
+ </textarea>
+
+ <p class="op-form-field--description" slot="help-text">
+ {{ text.message.description() }}
+ </p>
+ </op-form-field>
</div>
- <div class="spot-modal--footer spot-action-bar">
- <div class="spot-action-bar--right">
+ <div class="spot-action-bar">
+ <div class="spot-action-bar--left">
<button
type="button"
class="button button_no-margin spot-action-bar--action"
(click)="back.emit()"
- >{{ text.backButton }}</button>
- <button class="button button_no-margin -highlight spot-action-bar--action">{{ text.nextButton }}</button>
+ >
+ <op-icon icon-classes="button--icon icon-arrow-left1"></op-icon>
+ {{ text.principal.backButton }}
+ </button>
+ </div>
+
+ <div class="spot-action-bar--right">
+ <button
+ type="button"
+ class="button button_no-margin spot-action-bar--action"
+ (click)="close.emit()"
+ >
+ {{ text.principal.cancelButton }}
+ </button>
+ <button class="button button_no-margin -highlight spot-action-bar--action">{{ text.principal.nextButton }}</button>
</div>
</div>
</form>
diff --git a/frontend/src/app/features/invite-user-modal/principal/principal.component.sass b/frontend/src/app/features/invite-user-modal/principal/principal.component.sass
index e69de29bb2d..437bfcec4e0 100644
--- a/frontend/src/app/features/invite-user-modal/principal/principal.component.sass
+++ b/frontend/src/app/features/invite-user-modal/principal/principal.component.sass
@@ -0,0 +1,2 @@
+.op-ium-invite-message-field
+ height: 8em
\ No newline at end of file
diff --git a/frontend/src/app/features/invite-user-modal/principal/principal.component.ts b/frontend/src/app/features/invite-user-modal/principal/principal.component.ts
index de830aec154..47f2dbdd431 100644
--- a/frontend/src/app/features/invite-user-modal/principal/principal.component.ts
+++ b/frontend/src/app/features/invite-user-modal/principal/principal.component.ts
@@ -1,4 +1,5 @@
import {
+ ChangeDetectionStrategy,
ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output, ViewChild,
} from '@angular/core';
import { HttpClient } from '@angular/common/http';
@@ -6,6 +7,7 @@ import {
FormGroup,
FormControl,
Validators,
+ AbstractControl,
} from '@angular/forms';
import { take } from 'rxjs/internal/operators/take';
import { map } from 'rxjs/operators';
@@ -16,6 +18,7 @@ import { PrincipalData, PrincipalLike } from 'core-app/shared/components/princip
import { ProjectResource } from 'core-app/features/hal/resources/project-resource';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { PrincipalType } from '../invite-user.component';
+import { RoleResource } from 'core-app/features/hal/resources/role-resource';
function extractCustomFieldsFromSchema(schema:IOPFormSettings['_embedded']['schema']) {
return Object.keys(schema)
@@ -35,6 +38,7 @@ function extractCustomFieldsFromSchema(schema:IOPFormSettings['_embedded']['sche
selector: 'op-ium-principal',
templateUrl: './principal.component.html',
styleUrls: ['./principal.component.sass'],
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class PrincipalComponent implements OnInit {
@Input() principalData:PrincipalData;
@@ -43,9 +47,13 @@ export class PrincipalComponent implements OnInit {
@Input() type:PrincipalType;
+ @Input() roleData:RoleResource;
+
+ @Input() messageData = '';
+
@Output() close = new EventEmitter<void>();
- @Output() save = new EventEmitter<{ principalData:PrincipalData, isAlreadyMember:boolean }>();
+ @Output() save = new EventEmitter<{ principalData:PrincipalData, isAlreadyMember:boolean, role:RoleResource, message:string }>();
@Output() back = new EventEmitter();
@@ -54,31 +62,50 @@ export class PrincipalComponent implements OnInit {
public PrincipalType = PrincipalType;
public text = {
- title: () => this.I18n.t('js.invite_user_modal.title.invite_to_project', {
- type: this.I18n.t(`js.invite_user_modal.title.${this.type}`),
- project: this.project.name,
- }),
- label: {
- User: this.I18n.t('js.invite_user_modal.principal.label.name_or_email'),
- PlaceholderUser: this.I18n.t('js.invite_user_modal.principal.label.name'),
- Group: this.I18n.t('js.invite_user_modal.principal.label.name'),
- Email: this.I18n.t('js.label_email'),
+ principal: {
+ title: ():string => this.I18n.t('js.invite_user_modal.title.invite'),
+ label: {
+ User: this.I18n.t('js.invite_user_modal.principal.label.name_or_email'),
+ PlaceholderUser: this.I18n.t('js.invite_user_modal.principal.label.name'),
+ Group: this.I18n.t('js.invite_user_modal.principal.label.name'),
+ Email: this.I18n.t('js.label_email'),
+ },
+ change: this.I18n.t('js.label_change'),
+ inviteUser: this.I18n.t('js.invite_user_modal.principal.invite_user'),
+ createNewPlaceholder: this.I18n.t('js.invite_user_modal.principal.create_new_placeholder'),
+ required: {
+ User: this.I18n.t('js.invite_user_modal.principal.required.user'),
+ PlaceholderUser: this.I18n.t('js.invite_user_modal.principal.required.placeholder'),
+ Group: this.I18n.t('js.invite_user_modal.principal.required.group'),
+ },
+ backButton: this.I18n.t('js.invite_user_modal.back'),
+ nextButton: this.I18n.t('js.invite_user_modal.principal.next_button'),
+ cancelButton: this.I18n.t('js.button_cancel'),
},
- change: this.I18n.t('js.label_change'),
- inviteUser: this.I18n.t('js.invite_user_modal.principal.invite_user'),
- createNewPlaceholder: this.I18n.t('js.invite_user_modal.principal.create_new_placeholder'),
- required: {
- User: this.I18n.t('js.invite_user_modal.principal.required.user'),
- PlaceholderUser: this.I18n.t('js.invite_user_modal.principal.required.placeholder'),
- Group: this.I18n.t('js.invite_user_modal.principal.required.group'),
+ role: {
+ label: ():string => this.I18n.t('js.invite_user_modal.role.label', {
+ project: this.project?.name,
+ }),
+ description: ():string => this.I18n.t('js.invite_user_modal.role.description', {
+ principal: this.principal?.name,
+ }),
+ required: this.I18n.t('js.invite_user_modal.role.required'),
+ },
+ message: {
+ label: this.I18n.t('js.invite_user_modal.message.label'),
+ description: ():string => this.I18n.t('js.invite_user_modal.message.description', {
+ principal: this.principal?.name,
+ }),
},
- backButton: this.I18n.t('js.invite_user_modal.back'),
- nextButton: this.I18n.t('js.invite_user_modal.principal.next_button'),
};
public principalForm = new FormGroup({
+ // eslint-disable-next-line @typescript-eslint/unbound-method
principal: new FormControl(null, [Validators.required]),
userDynamicFields: new FormGroup({}),
+ // eslint-disable-next-line @typescript-eslint/unbound-method
+ role: new FormControl(null, [Validators.required]),
+ message: new FormControl(''),
});
public userDynamicFieldConfig:{
@@ -89,15 +116,31 @@ export class PrincipalComponent implements OnInit {
schema: null,
};
- get principalControl() {
+ get messageControl():AbstractControl|null {
+ return this.principalForm.get('message');
+ }
+
+ get roleControl():AbstractControl|null {
+ return this.principalForm.get('role');
+ }
+
+ get principalControl():AbstractControl|null {
return this.principalForm.get('principal');
}
get principal():PrincipalLike|undefined {
- return this.principalControl?.value;
+ return this.principalControl?.value as PrincipalLike|undefined;
+ }
+
+ get role():RoleResource|undefined {
+ return this.roleControl?.value as RoleResource|undefined;
+ }
+
+ get message():string|undefined {
+ return this.messageControl?.value as string|undefined;
}
- get dynamicFieldsControl() {
+ get dynamicFieldsControl():AbstractControl|null {
return this.principalForm.get('userDynamicFields');
}
@@ -105,22 +148,22 @@ export class PrincipalComponent implements OnInit {
return this.dynamicFieldsControl?.value;
}
- get hasPrincipalSelected() {
+ get hasPrincipalSelected():boolean {
return !!this.principal;
}
- get textLabel() {
+ get textLabel():string {
if (this.type === PrincipalType.User && this.isNewPrincipal) {
- return this.text.label.Email;
+ return this.text.principal.label.Email;
}
- return this.text.label[this.type];
+ return this.text.principal.label[this.type];
}
- get isNewPrincipal() {
+ get isNewPrincipal():boolean {
return this.hasPrincipalSelected && !(this.principal instanceof HalResource);
}
- get isMemberOfCurrentProject() {
+ get isMemberOfCurrentProject():boolean {
return !!this.principalControl?.value?.memberships?.elements?.find((mem:any) => mem.project.id === this.project.id);
}
@@ -131,8 +174,10 @@ export class PrincipalComponent implements OnInit {
readonly cdRef:ChangeDetectorRef,
) {}
- ngOnInit() {
+ ngOnInit():void {
this.principalControl?.setValue(this.principalData.principal);
+ this.roleControl?.setValue(this.roleData);
+ this.messageControl?.setValue(this.messageData);
if (this.type === PrincipalType.User) {
const payload = this.isNewPrincipal ? this.principalData.customFields : {};
@@ -155,11 +200,11 @@ export class PrincipalComponent implements OnInit {
}
}
- createNewFromInput(input:PrincipalLike) {
+ createNewFromInput(input:PrincipalLike):void {
this.principalControl?.setValue(input);
}
- onSubmit($e:Event) {
+ onSubmit($e:Event):void {
$e.preventDefault();
if (this.dynamicForm) {
@@ -171,7 +216,7 @@ export class PrincipalComponent implements OnInit {
}
}
- onValidatedSubmit() {
+ onValidatedSubmit():void {
if (this.principalForm.invalid) {
return;
}
@@ -202,9 +247,11 @@ export class PrincipalComponent implements OnInit {
this.save.emit({
principalData: {
customFields,
- principal: this.principal!,
+ principal: this.principal as PrincipalLike,
},
isAlreadyMember: this.isMemberOfCurrentProject,
+ role: this.role as RoleResource,
+ message: this.message as string,
});
}
}
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 48b1f0c0e72..4feedfdff11 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
@@ -6,7 +6,7 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body op-form">
+ <div class="spot-modal--body spot-container">
<op-form-field
[label]="text.project.label"
required
@@ -62,9 +62,15 @@
</op-form-field>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
+ <button
+ type="button"
+ class="button button_no-margin spot-action-bar--action"
+ (click)="close.emit()"> {{ text.cancelButton }}
+ </button>
<button class="button button_no-margin -highlight spot-action-bar--action">{{ text.nextButton }}</button>
+
</div>
</div>
</form>
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 c10f3c9b958..cc12247668d 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
@@ -57,6 +57,7 @@ export class ProjectSelectionComponent implements OnInit {
required: this.I18n.t('js.invite_user_modal.type.required'),
},
nextButton: this.I18n.t('js.invite_user_modal.project.next_button'),
+ cancelButton: this.I18n.t('js.button_cancel'),
};
public typeOptions:IOpOptionListOption<string>[] = [
diff --git a/frontend/src/app/features/invite-user-modal/role/role-search.component.html b/frontend/src/app/features/invite-user-modal/role/role-search.component.html
index 34272bcdc82..455d8b3953c 100644
--- a/frontend/src/app/features/invite-user-modal/role/role-search.component.html
+++ b/frontend/src/app/features/invite-user-modal/role/role-search.component.html
@@ -8,7 +8,6 @@
[clearOnBackspace]="false"
[clearSearchOnAdd]="false"
bindLabel="name"
- autofocus
#ngselect
>
<!--Selectable option-->
diff --git a/frontend/src/app/features/invite-user-modal/role/role.component.html b/frontend/src/app/features/invite-user-modal/role/role.component.html
deleted file mode 100644
index 6c7daa7db4e..00000000000
--- a/frontend/src/app/features/invite-user-modal/role/role.component.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<form
- [formGroup]="roleForm"
- (ngSubmit)="onSubmit($event)"
->
- <div class="spot-modal--header">{{text.title()}}</div>
-
- <div class="spot-divider"></div>
-
- <div class="spot-modal--body op-form">
- <op-form-field
- [label]="text.label()"
- required
- >
- <p
- class="op-form-field--description"
- slot="description"
- [innerHtml]="text.description()"
- ></p>
- <op-ium-role-search
- [opFormBinding]="roleControl"
- slot="input"
- ></op-ium-role-search>
-
- <div
- slot="errors"
- class="op-form-field--error"
- *ngIf="roleControl?.touched && roleControl?.invalid"
- >
- {{ text.required }}
- </div>
- </op-form-field>
- </div>
-
- <div class="spot-modal--footer spot-action-bar">
- <div class="spot-action-bar--right">
- <button
- type="button"
- class="button button_no-margin spot-action-bar--action"
- (click)="back.emit()"
- >{{ text.backButton }}</button>
- <button class="button button_no-margin -highlight spot-action-bar--action">{{ text.nextButton }}</button>
- </div>
- </div>
-</form>
diff --git a/frontend/src/app/features/invite-user-modal/role/role.component.sass b/frontend/src/app/features/invite-user-modal/role/role.component.sass
deleted file mode 100644
index e69de29bb2d..00000000000
diff --git a/frontend/src/app/features/invite-user-modal/role/role.component.ts b/frontend/src/app/features/invite-user-modal/role/role.component.ts
deleted file mode 100644
index eb1f91ee27a..00000000000
--- a/frontend/src/app/features/invite-user-modal/role/role.component.ts
+++ /dev/null
@@ -1,78 +0,0 @@
-import {
- Component,
- OnInit,
- Input,
- EventEmitter,
- Output,
-} from '@angular/core';
-import {
- FormControl,
- FormGroup,
- Validators,
-} from '@angular/forms';
-import { I18nService } from 'core-app/core/i18n/i18n.service';
-import { RoleResource } from 'core-app/features/hal/resources/role-resource';
-import { ProjectResource } from 'core-app/features/hal/resources/project-resource';
-import { HalResource } from 'core-app/features/hal/resources/hal-resource';
-import { PrincipalType } from '../invite-user.component';
-
-@Component({
- selector: 'op-ium-role',
- templateUrl: './role.component.html',
- styleUrls: ['./role.component.sass'],
-})
-export class RoleComponent implements OnInit {
- @Input() type:PrincipalType;
-
- @Input() project:ProjectResource;
-
- @Input() principal:HalResource;
-
- @Input() role:RoleResource;
-
- @Output() close = new EventEmitter<void>();
-
- @Output() back = new EventEmitter<void>();
-
- @Output() save = new EventEmitter<RoleResource>();
-
- public text = {
- title: () => this.I18n.t('js.invite_user_modal.title.invite_principal_to_project', {
- principal: this.principal?.name,
- project: this.project?.name,
- }),
- label: () => this.I18n.t('js.invite_user_modal.role.label', {
- project: this.project?.name,
- }),
- description: () => this.I18n.t('js.invite_user_modal.role.description', {
- principal: this.principal?.name,
- }),
- required: this.I18n.t('js.invite_user_modal.role.required'),
- backButton: this.I18n.t('js.invite_user_modal.back'),
- nextButton: this.I18n.t('js.invite_user_modal.role.next_button'),
- };
-
- roleForm = new FormGroup({
- role: new FormControl(null, [Validators.required]),
- });
-
- get roleControl() {
- return this.roleForm.get('role');
- }
-
- constructor(readonly I18n:I18nService) {}
-
- ngOnInit() {
- this.roleControl?.setValue(this.role);
- }
-
- onSubmit($e:Event) {
- $e.preventDefault();
- if (this.roleForm.invalid) {
- this.roleForm.markAsDirty();
- return;
- }
-
- this.save.emit(this.roleForm?.value.role);
- }
-}
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 36992d53327..b0b1b0576f2 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="spot-modal--body op-ium-success--content">
+ <div class="spot-modal--body spot-container op-ium-success--content">
<img [src]="type === PrincipalType.Placeholder ? placeholder_image : user_image" />
<h1 [textContent]="text.title()"></h1>
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 9ba3d854955..0f7be49800d 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
@@ -7,7 +7,7 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body op-form">
+ <div class="spot-modal--body spot-container">
<op-form-field [label]="text.projectLabel">
<p slot="input">{{ project.name }}</p>
</op-form-field>
@@ -27,13 +27,24 @@
</op-form-field>
</div>
- <div class="spot-modal--footer spot-action-bar">
- <div class="spot-action-bar--right">
+ <div class="spot-action-bar">
+ <div class="spot-action-bar--left">
<button
type="button"
class="button button_no-margin spot-action-bar--action"
(click)="back.emit()"
- >{{ text.backButton }}</button>
+ >
+ <op-icon icon-classes="button--icon icon-arrow-left1"></op-icon>
+ {{ text.backButton }}
+ </button>
+ </div>
+
+ <div class="spot-action-bar--right">
+ <button
+ type="button"
+ class="button button_no-margin spot-action-bar--action"
+ (click)="close.emit()"
+ >{{ text.cancelButton }}</button>
<button
class="button button_no-margin -highlight spot-action-bar--action"
>{{ text.nextButton() }}</button>
diff --git a/frontend/src/app/features/invite-user-modal/summary/summary.component.ts b/frontend/src/app/features/invite-user-modal/summary/summary.component.ts
index 14e6f34240d..6cbef54347a 100644
--- a/frontend/src/app/features/invite-user-modal/summary/summary.component.ts
+++ b/frontend/src/app/features/invite-user-modal/summary/summary.component.ts
@@ -4,13 +4,14 @@ import {
EventEmitter,
Output,
ElementRef,
+ ChangeDetectionStrategy,
} from '@angular/core';
import { Observable, of } from 'rxjs';
import { mapTo, switchMap } from 'rxjs/operators';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import { RoleResource } from 'core-app/features/hal/resources/role-resource';
-import { PrincipalData } from 'core-app/shared/components/principal/principal-types';
+import { PrincipalData, PrincipalLike } from 'core-app/shared/components/principal/principal-types';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { ProjectResource } from 'core-app/features/hal/resources/project-resource';
import { PrincipalType } from '../invite-user.component';
@@ -19,6 +20,7 @@ import { PrincipalType } from '../invite-user.component';
selector: 'op-ium-summary',
templateUrl: './summary.component.html',
styleUrls: ['./summary.component.sass'],
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SummaryComponent {
@Input() type:PrincipalType;
@@ -40,28 +42,26 @@ export class SummaryComponent {
public PrincipalType = PrincipalType;
public text = {
- title: () => this.I18n.t('js.invite_user_modal.title.invite_principal_to_project', {
- principal: this.principal?.name,
- project: this.project?.name,
- }),
+ title: ():string => this.I18n.t('js.invite_user_modal.title.invite'),
projectLabel: this.I18n.t('js.invite_user_modal.project.label'),
principalLabel: {
User: this.I18n.t('js.invite_user_modal.principal.label.name_or_email'),
PlaceholderUser: this.I18n.t('js.invite_user_modal.principal.label.name'),
Group: this.I18n.t('js.invite_user_modal.principal.label.name'),
},
- roleLabel: () => this.I18n.t('js.invite_user_modal.role.label', {
+ roleLabel: ():string => this.I18n.t('js.invite_user_modal.role.label', {
project: this.project?.name,
}),
messageLabel: this.I18n.t('js.invite_user_modal.message.label'),
backButton: this.I18n.t('js.invite_user_modal.back'),
- nextButton: () => this.I18n.t('js.invite_user_modal.summary.next_button', {
+ cancelButton: this.I18n.t('js.invite_user_modal.summary.cancel_button'),
+ nextButton: ():string => this.I18n.t('js.invite_user_modal.summary.next_button', {
type: this.type,
principal: this.principal,
}),
};
- public get principal() {
+ public get principal():PrincipalLike|null {
return this.principalData.principal;
}
@@ -71,7 +71,7 @@ export class SummaryComponent {
readonly api:ApiV3Service,
) { }
- invite() {
+ invite():Observable<HalResource> {
return of(this.principalData)
.pipe(
switchMap((principalData:PrincipalData) => this.createPrincipal(principalData)),
@@ -99,18 +99,18 @@ export class SummaryComponent {
switch (this.type) {
case PrincipalType.User:
return this.api.users.post({
- email: principal!.name,
+ email: (principal as PrincipalLike).name,
status: 'invited',
...customFields,
});
case PrincipalType.Placeholder:
- return this.api.placeholder_users.post({ name: principal!.name });
+ return this.api.placeholder_users.post({ name: (principal as PrincipalLike).name });
default:
throw new Error('Unsupported PrincipalType given');
}
}
- onSubmit($e:Event) {
+ onSubmit($e:Event):void {
$e.preventDefault();
this
diff --git a/frontend/src/app/features/job-status/job-status-modal/job-status.modal.html b/frontend/src/app/features/job-status/job-status-modal/job-status.modal.html
index d4618545903..8c3ce8b369a 100644
--- a/frontend/src/app/features/job-status/job-status-modal/job-status.modal.html
+++ b/frontend/src/app/features/job-status/job-status-modal/job-status.modal.html
@@ -8,7 +8,7 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<div class="loading-indicator--location"
data-indicator-name="modal">
<div class="status-icon-wrapper" *ngIf="!isLoading && statusIcon">
diff --git a/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.html b/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.html
index fa9e13f117e..b5c45797cf4 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.html
+++ b/frontend/src/app/features/work-packages/components/wp-table/configuration-modal/wp-table-configuration.modal.html
@@ -6,7 +6,7 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<ng-container *ngIf="!!prependModalComponent">
<ng-container *ngComponentOutlet="prependModalComponent; injector: injector"></ng-container>
@@ -22,8 +22,14 @@
</op-scrollable-tabs>
<div class="tab-content" #tabContentOutlet></div>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
+ <button
+ class="button button_no-margin spot-action-bar--action"
+ [textContent]="text.cancelButton"
+ (click)="closeMe($event)"
+ >
+ </button>
<button
class="button button_no-margin -highlight spot-action-bar--action"
data-qa-selector="spot-modal-wp-table-configuration-save-button"
@@ -31,12 +37,6 @@
(click)="saveChanges()"
>
</button>
- <button
- class="button button_no-margin spot-action-bar--action"
- [textContent]="text.cancelButton"
- (click)="closeMe($event)"
- >
- </button>
</div>
</div>
</div>
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 d5195a96fbf..2dcebcb523a 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,12 +7,11 @@
data-qa-selector="attribute-help-text--header"
>
<span class="spot-icon spot-icon_help1"></span>
- <span [textContent]="helpText.attributeCaption"></span>
+ <span class="attribute-help-text--header-text"
+ [textContent]="helpText.attributeCaption"></span>
</div>
- <div class="spot-divider"></div>
-
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<div
class="op-uc-container op-uc-container__no-permalinks"
[innerHtml]="helpText.helpText.html"
@@ -24,8 +23,15 @@
></attachments>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
+ <button
+ type="button"
+ class="button button_no-margin spot-action-bar--action"
+ (click)="closeMe()"
+ >
+ {{ text.close }}
+ </button>
<a
class="help-text--edit-button button button_no-margin spot-action-bar--action"
*ngIf="helpText.editText"
diff --git a/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.html b/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.html
index 7f6d541532b..075f45caec8 100644
--- a/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.html
+++ b/frontend/src/app/shared/components/datepicker/multi-date-modal/multi-date.modal.html
@@ -8,7 +8,7 @@
>
<op-datepicker-banner [scheduleManually]="scheduleManually"></op-datepicker-banner>
- <div class="spot-modal--body form -vertical">
+ <div class="spot-modal--body spot-container form -vertical">
<div class="op-datepicker-modal--toggle-actions-container">
<op-datepicker-scheduling-toggle
name="scheduleManually"
@@ -24,7 +24,7 @@
</div>
<div class="op-datepicker-modal--dates-container">
- <div class="form--field op-datepicker-modal--date-form"
+ <div class="op-form-field op-datepicker-modal--date-form"
data-qa-selector="datepicker-start-date"
>
<label class="form--label"
@@ -47,13 +47,16 @@
</div>
</div>
<div class="form--field-extra-actions">
- <a *ngIf="showTodayLink()"
- (click)="setToday('start')"
- [textContent]="text.today">
- </a>
+ <button
+ type="button"
+ class="spot-link"
+ [ngClass]="{ 'op-datepicker-modal--hidden-link': !showTodayLink() }"
+ (click)="setToday('start')"
+ [textContent]="text.today">
+ </button>
</div>
</div>
- <div class="form--field op-datepicker-modal--date-form"
+ <div class="op-form-field op-datepicker-modal--date-form"
data-qa-selector="datepicker-end-date"
>
<label class="form--label"
@@ -76,13 +79,16 @@
</div>
</div>
<div class="form--field-extra-actions">
- <a *ngIf="showTodayLink()"
- (click)="setToday('end')"
- [textContent]="text.today">
- </a>
+ <button
+ type="button"
+ class="spot-link"
+ [ngClass]="{ 'op-datepicker-modal--hidden-link': !showTodayLink() }"
+ (click)="setToday('end')"
+ [textContent]="text.today">
+ </button>
</div>
</div>
- <div class="form--field op-datepicker-modal--date-form"
+ <div class="op-form-field op-datepicker-modal--date-form"
data-qa-selector="datepicker-duration"
>
<label class="form--label"
@@ -113,7 +119,7 @@
hidden>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
(click)="cancel()"
diff --git a/frontend/src/app/shared/components/datepicker/scheduling-mode/datepicker-scheduling-toggle.component.html b/frontend/src/app/shared/components/datepicker/scheduling-mode/datepicker-scheduling-toggle.component.html
index 167c6756d18..f32a64deb0d 100644
--- a/frontend/src/app/shared/components/datepicker/scheduling-mode/datepicker-scheduling-toggle.component.html
+++ b/frontend/src/app/shared/components/datepicker/scheduling-mode/datepicker-scheduling-toggle.component.html
@@ -1,4 +1,4 @@
-<div class="form--field">
+<div class="op-form-field">
<label class="form--label">
{{text.scheduling.title}}
</label>
diff --git a/frontend/src/app/shared/components/datepicker/single-date-modal/single-date.modal.html b/frontend/src/app/shared/components/datepicker/single-date-modal/single-date.modal.html
index adde31a5f52..b53114e8fe6 100644
--- a/frontend/src/app/shared/components/datepicker/single-date-modal/single-date.modal.html
+++ b/frontend/src/app/shared/components/datepicker/single-date-modal/single-date.modal.html
@@ -8,7 +8,7 @@
>
<op-datepicker-banner [scheduleManually]="scheduleManually"></op-datepicker-banner>
- <div class="spot-modal--body form -vertical">
+ <div class="spot-modal--body spot-container">
<div class="op-datepicker-modal--toggle-actions-container">
<op-datepicker-scheduling-toggle
name="scheduleManually"
@@ -40,10 +40,13 @@
</div>
</div>
<div class="form--field-extra-actions">
- <a *ngIf="dateModalScheduling.isSchedulable"
- (click)="setToday()"
- [textContent]="text.today">
- </a>
+ <button
+ type="button"
+ class="spot-link"
+ [ngClass]="{ 'op-datepicker-modal--hidden-link': !dateModalScheduling.isSchedulable }"
+ (click)="setToday()"
+ [textContent]="text.today">
+ </button>
</div>
</div>
</div>
@@ -52,7 +55,7 @@
hidden>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
(click)="cancel()"
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 7286243155d..350e34c39f0 100644
--- a/frontend/src/app/shared/components/datepicker/styles/datepicker.modal.sass
+++ b/frontend/src/app/shared/components/datepicker/styles/datepicker.modal.sass
@@ -21,8 +21,6 @@
display: grid
grid-template-columns: 1fr 1fr 150px
grid-column-gap: $spot-spacing-1
- // avoid a jump when the today link is hidden in disabled mode
- min-height: 90px
&--date-field
&_current,
@@ -36,3 +34,6 @@
&--action
&:last-of-type
margin-right: 0
+
+ &--hidden-link
+ visibility: hidden
diff --git a/frontend/src/app/shared/components/datepicker/toggle/datepicker-working-days-toggle.component.html b/frontend/src/app/shared/components/datepicker/toggle/datepicker-working-days-toggle.component.html
index f99917db7ac..f9dca416454 100644
--- a/frontend/src/app/shared/components/datepicker/toggle/datepicker-working-days-toggle.component.html
+++ b/frontend/src/app/shared/components/datepicker/toggle/datepicker-working-days-toggle.component.html
@@ -1,4 +1,4 @@
-<div class="form--field">
+<div class="op-form-field">
<label class="form--label">
{{ text.ignoreNonWorkingDays.title }}
</label>
diff --git a/frontend/src/app/shared/components/grids/widgets/add/add.modal.html b/frontend/src/app/shared/components/grids/widgets/add/add.modal.html
index e6e3fd22fbf..1fbccc47cb9 100644
--- a/frontend/src/app/shared/components/grids/widgets/add/add.modal.html
+++ b/frontend/src/app/shared/components/grids/widgets/add/add.modal.html
@@ -1,12 +1,16 @@
<div
class="spot-modal loading-indicator--location"
+ tabindex="0"
+ cdkFocusInitial
+ cdkTrapFocus
+ [cdkTrapFocusAutoCapture]="true"
data-indicator-name="modal"
>
<div class="spot-modal--header">{{text.title}}</div>
<div class="spot-divider"></div>
- <div class="ngdialog-body spot-modal--body">
+ <div class="ngdialog-body spot-modal--body spot-container">
<op-enterprise-banner
*ngIf="eeShowBanners"
@@ -17,12 +21,31 @@
opReferrer="grids#add-widget"
></op-enterprise-banner>
- <div
- *ngFor="let widget of selectable;trackBy: trackWidgetBy"
- (click)="select($event, widget)"
- [id]="widget.identifier"
- [textContent]="widget.title"
- class="grid--addable-widget"
- ></div>
+ <ul class="spot-list">
+ <li
+ *ngFor="let widget of selectable;trackBy: trackWidgetBy"
+ class="spot-list--item"
+ data-qa-selector="op-grid--addable-widget">
+ <button
+ type="button"
+ class="spot-list--item-action"
+ (click)="select($event, widget)"
+ [id]="widget.identifier"
+ [textContent]="widget.title"
+ ></button>
+ </li>
+ </ul>
+ </div>
+
+ <div class="spot-action-bar">
+ <div class="spot-action-bar--right">
+ <button
+ type="button"
+ class="button button_no-margin spot-action-bar--action"
+ (click)="closeMe()"
+ >
+ {{ text.cancel_button }}
+ </button>
+ </div>
</div>
</div>
diff --git a/frontend/src/app/shared/components/grids/widgets/add/add.modal.ts b/frontend/src/app/shared/components/grids/widgets/add/add.modal.ts
index 2e628cb23fe..8c50dfd013f 100644
--- a/frontend/src/app/shared/components/grids/widgets/add/add.modal.ts
+++ b/frontend/src/app/shared/components/grids/widgets/add/add.modal.ts
@@ -19,6 +19,7 @@ export class AddGridWidgetModalComponent extends OpModalComponent {
close_popup: this.i18n.t('js.button_close'),
upsale_link: this.i18n.t('js.grid.upsale.link'),
upsale_text: this.i18n.t('js.grid.upsale.text'),
+ cancel_button: this.i18n.t('js.button_cancel'),
more_info_link: enterpriseDocsUrl.graphWidgets,
};
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 a78a59c910a..c44713238ce 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
@@ -6,7 +6,7 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<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">
@@ -17,7 +17,7 @@
</div>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
class="button button_no-margin spot-action-bar--action"
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 cfd0dd04eb6..e1b4144755b 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
@@ -7,19 +7,23 @@
[cdkTrapFocusAutoCapture]="true"
>
<div class="spot-modal--header">{{text.title}}</div>
- <div class="spot-divider"></div>
- <div class="spot-modal--body">
- <span class="op-confirm-dialog--text"
+ <div *ngIf="divideContent" class="spot-divider"></div>
+
+ <div class="spot-modal--body spot-container">
+ <span class="op-confirm-dialog--text spot-body-small"
[textContent]="text.text"
></span>
- <span *ngFor="let data of passedData">
+ <span
+ *ngFor="let data of passedData"
+ class="spot-body-small"
+ >
<br/>
<strong>{{data}}</strong>
</span>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
type="button"
diff --git a/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.ts b/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.ts
index 9ca1c96a428..87cc9ed271e 100644
--- a/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.ts
+++ b/frontend/src/app/shared/components/modals/confirm-dialog/confirm-dialog.modal.ts
@@ -55,6 +55,7 @@ export interface ConfirmDialogOptions {
closeByDocument?:boolean;
passedData?:string[];
dangerHighlighting?:boolean;
+ divideContent?:boolean;
}
@Component({
@@ -65,6 +66,8 @@ export interface ConfirmDialogOptions {
export class ConfirmDialogModalComponent extends OpModalComponent {
public showClose:boolean;
+ public divideContent:boolean;
+
public confirmed = false;
private options:ConfirmDialogOptions;
@@ -98,6 +101,7 @@ export class ConfirmDialogModalComponent extends OpModalComponent {
this.closeOnEscape = _.defaultTo(this.options.closeByEscape, true);
this.closeOnOutsideClick = _.defaultTo(this.options.closeByDocument, true);
this.showClose = _.defaultTo(this.options.showClose, true);
+ this.divideContent = _.defaultTo(this.options.divideContent, false);
// override default texts and icons if any
this.text = _.defaults(this.options.text, this.text);
this.icon = _.defaults(this.options.icon, this.icon);
diff --git a/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.html b/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.html
index ebb47fd34ee..1a26adc7e9c 100644
--- a/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.html
+++ b/frontend/src/app/shared/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.html
@@ -6,7 +6,7 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body form">
+ <div class="spot-modal--body spot-container form">
<fieldset class="form--fieldset">
<legend [textContent]="text.page"></legend>
<div class="form--field">
@@ -51,7 +51,7 @@
<p [textContent]="text.hint"></p>
</fieldset>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
class="spot-modal--cancel-button button button_no-margin spot-action-bar--action"
diff --git a/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.html b/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.html
index e83b6383055..998e82294e7 100644
--- a/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.html
+++ b/frontend/src/app/shared/components/modals/editor/macro-code-block-modal/code-block-macro.modal.html
@@ -6,7 +6,7 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<textarea name="codemirror-element"
id="codemirror-element"
[ngModel]="content"
@@ -35,7 +35,7 @@
</div>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
class="spot-modal--cancel-button button button_no-margin spot-action-bar--action"
diff --git a/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.html b/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.html
index 98bee8a1f19..79c46b8f53e 100644
--- a/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.html
+++ b/frontend/src/app/shared/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.html
@@ -6,7 +6,7 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<fieldset class="form--fieldset">
<legend [textContent]="text.page"></legend>
<div class="form--field">
@@ -33,7 +33,7 @@
</div>
</fieldset>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
class="spot-modal--cancel-button button button_no-margin spot-action-bar--action"
diff --git a/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.html b/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.html
index d3cea449767..95adc5301c3 100644
--- a/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.html
+++ b/frontend/src/app/shared/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.html
@@ -7,7 +7,7 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body form">
+ <div class="spot-modal--body spot-container form">
<fieldset class="form--fieldset">
<legend [textContent]="text.selected_type"></legend>
<div class="form--field">
@@ -58,7 +58,7 @@
<p [textContent]="text.button_style_hint"></p>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
class="spot-modal--cancel-button button button_no-margin spot-action-bar--action"
diff --git a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.html b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.html
index c12da90b26d..9fa9a37bbb2 100644
--- a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.html
+++ b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.html
@@ -1,10 +1,10 @@
-<div class="spot-modal spot-modal_wide wp-table--configuration-modal op-wp-table-export">
+<div class="spot-modal spot-modal_wide op-wp-table-export">
<div class="spot-modal--header">{{text.title}}</div>
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<ul *ngIf="exportOptions" class="op-export-options" [ngClass]="{'-hidden': isLoading}">
<li
*ngFor="let option of exportOptions"
@@ -22,4 +22,15 @@
</li>
</ul>
</div>
+ <div class="spot-action-bar">
+ <div class="spot-action-bar--right">
+ <button
+ type="button"
+ class="button button_no-margin spot-action-bar--action"
+ (click)="closeMe()"
+ >
+ {{ text.cancelButton }}
+ </button>
+ </div>
+ </div>
</div>
diff --git a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts
index 439ad4c7db2..aa985790bde 100644
--- a/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts
+++ b/frontend/src/app/shared/components/modals/export-modal/wp-table-export.modal.ts
@@ -43,6 +43,7 @@ export class WpTableExportModalComponent extends OpModalComponent implements OnI
title: this.I18n.t('js.label_export'),
closePopup: this.I18n.t('js.close_popup_title'),
exportPreparing: this.I18n.t('js.label_export_preparing'),
+ cancelButton: this.I18n.t('js.button_cancel'),
};
constructor(@Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,
diff --git a/frontend/src/app/shared/components/modals/modal-wrapper/dynamic-content.modal.ts b/frontend/src/app/shared/components/modals/modal-wrapper/dynamic-content.modal.ts
index c2b41e42628..cdf9a4360ba 100644
--- a/frontend/src/app/shared/components/modals/modal-wrapper/dynamic-content.modal.ts
+++ b/frontend/src/app/shared/components/modals/modal-wrapper/dynamic-content.modal.ts
@@ -27,6 +27,7 @@
//++
import {
+ ChangeDetectionStrategy,
ChangeDetectorRef, Component, ElementRef, Inject, OnDestroy, OnInit,
} from '@angular/core';
import { OpModalLocalsToken } from 'core-app/shared/components/modal/modal.service';
@@ -36,6 +37,7 @@ import { I18nService } from 'core-app/core/i18n/i18n.service';
@Component({
templateUrl: './dynamic-content.modal.html',
+ changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DynamicContentModalComponent extends OpModalComponent implements OnInit, OnDestroy {
// override superclass
@@ -58,6 +60,10 @@ export class DynamicContentModalComponent extends OpModalComponent implements On
.find('.dynamic-content-modal--wrapper')
.addClass(this.locals.modalClassName)
.append(this.locals.modalBody);
+
+ const modal = document.querySelector('.spot-modal') as HTMLElement;
+ const closeButton = modal.querySelector('[dynamic-content-modal-close-button]') as HTMLMetaElement;
+ closeButton.addEventListener('click', () => this.closeMe());
}
ngOnDestroy():void {
diff --git a/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.html b/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.html
index 7466452254f..b0af7fe636f 100644
--- a/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.html
+++ b/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.html
@@ -7,9 +7,9 @@
<div class="spot-divider"></div>
- <div class="spot-modal--body request-for-confirmation--form form">
+ <div class="spot-modal--body spot-container form">
<div class="form--field -required">
- <label class="form--label"
+ <label class="form--label -bold"
for="request_for_confirmation_password"
[attr.aria-label]="additionalText.field_description"
[textContent]="additionalText.password">
@@ -28,12 +28,18 @@
</div>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
+ <button
+ class="button button_no-margin spot-action-bar--action"
+ [textContent]="additionalText.cancel_button"
+ (click)="closeMe()"
+ >
+ </button>
<button
class="button button_no-margin -highlight spot-action-bar--action"
- data-qa-selector="confirmation-modal--confirmed"
[textContent]="additionalText.confirm_button"
+ data-qa-selector="confirmation-modal--confirmed"
[disabled]="!passwordValuePresent()">
</button>
</div>
diff --git a/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.ts b/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.ts
index 52e3e05c5a7..8e8fb6c2ba7 100644
--- a/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.ts
+++ b/frontend/src/app/shared/components/modals/request-for-confirmation/password-confirmation.modal.ts
@@ -49,13 +49,13 @@ export class PasswordConfirmationModalComponent extends ConfirmDialogModalCompon
field_description: I18n.t('js.password_confirmation.field_description'),
confirm_button: I18n.t('js.button_confirm'),
password: I18n.t('js.label_password'),
+ cancel_button: I18n.t('js.button_cancel'),
};
public ngOnInit():void {
super.ngOnInit();
this.text.title = I18n.t('js.password_confirmation.title');
-
this.closeOnEscape = false;
this.closeOnOutsideClick = false;
this.showClose = false;
diff --git a/frontend/src/app/shared/components/modals/save-modal/save-query.modal.html b/frontend/src/app/shared/components/modals/save-modal/save-query.modal.html
index 170c75eb357..3c5607eade1 100644
--- a/frontend/src/app/shared/components/modals/save-modal/save-query.modal.html
+++ b/frontend/src/app/shared/components/modals/save-modal/save-query.modal.html
@@ -1,16 +1,16 @@
<form
- class="spot-modal wp-table--configuration-modal loading-indicator--location"
+ class="spot-modal loading-indicator--location"
data-indicator-name="modal"
name="modalSaveForm"
(submit)="saveQueryAs($event)"
>
- <div class="spot-modal--header">{{text.save_as}}</div>
-
+ <h1 class="spot-modal--header">{{text.save_as}}</h1>
+
<div class="spot-divider"></div>
<div
name="modalSaveForm"
- class="spot-modal--body form"
+ class="spot-modal--body spot-container"
>
<div class="form--field -required">
<label class="form--label" for="save-query-name" [textContent]="text.label_name"></label>
@@ -28,28 +28,28 @@
</div>
</div>
</div>
-
- <section class="form--section">
- <h3 [textContent]="text.label_visibility_settings"></h3>
+ <div class="spot-divider"></div>
+
+ <h2 class="spot-subheader-extra-small">{{ text.label_visibility_settings }}</h2>
+
<query-sharing-form
[isSave]="true"
(onChange)="setValues($event)"
[isStarred]="isStarred"
[isPublic]="isPublic">
</query-sharing-form>
- </section>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
type="button"
- class="button button_no-margin -with-icon icon-cancel spot-action-bar--action"
+ class="button button_no-margin spot-action-bar--action"
[textContent]="text.button_cancel"
(click)="closeMe($event)"
></button>
<button
- class="button button_no-margin -highlight -with-icon icon-checkmark spot-action-bar--action"
+ class="button button_no-margin -highlight -with-icon icon-save spot-action-bar--action"
[textContent]="text.button_save"
[disabled]="isBusy || !queryName"
></button>
diff --git a/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.html b/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.html
index 41b340696c8..fcc3ead7504 100644
--- a/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.html
+++ b/frontend/src/app/shared/components/modals/share-modal/query-sharing.modal.html
@@ -1,5 +1,5 @@
<div
- class="spot-modal wp-table--configuration-modal loading-indicator--location"
+ class="spot-modal loading-indicator--location"
data-indicator-name="modal"
>
<div class="spot-modal--header">{{text.label_visibility_settings}}</div>
@@ -7,24 +7,24 @@
<div class="spot-divider"></div>
<query-sharing-form
- class="spot-modal--body"
+ class="spot-modal--body spot-container"
[isSave]="false"
(onChange)="setValues($event)"
[isStarred]="isStarred"
[isPublic]="isPublic">
</query-sharing-form>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
- <button class="button button_no-margin -highlight -with-icon icon-checkmark spot-action-bar--action"
- (click)="saveQuery($event)"
- [textContent]="text.button_save">
- </button>
- <button class="button button_no-margin -with-icon icon-cancel spot-action-bar--action"
+ <button class="button button_no-margin spot-action-bar--action"
[textContent]="text.button_cancel"
[disabled]="isBusy"
(click)="closeMe($event)">
</button>
+ <button class="button button_no-margin -highlight -with-icon icon-save spot-action-bar--action"
+ (click)="saveQuery($event)"
+ [textContent]="text.button_save">
+ </button>
</div>
</div>
</div>
diff --git a/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.html b/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.html
index c2c1ab2ddd6..31c1d22c562 100644
--- a/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.html
+++ b/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.html
@@ -1,22 +1,20 @@
<div
- class="spot-modal wp-table--configuration-modal loading-indicator--location"
+ class="spot-modal"
data-indicator-name="modal"
id="wp_destroy_modal"
>
<div class="spot-modal--header">{{text.title}}</div>
- <div class="spot-divider"></div>
-
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<ng-container *ngIf="singleWorkPackage">
<p>
- <span [textContent]="text.text"></span>
- <br/>
+ <span [textContent]="text.single_text"></span>
<strong>
- {{ singleWorkPackage.type.name }}
- #{{ singleWorkPackage.id }}
+
{{ singleWorkPackage.subject }}
+ #{{ singleWorkPackage.id }}
</strong>
+ ?
</p>
<div *ngIf="singleWorkPackageChildren && singleWorkPackageChildren.length > 0">
<p class="danger-zone--warning">
@@ -38,7 +36,7 @@
<ng-container *ngIf="workPackages.length > 1">
<p class="danger-zone--warning">
<span class="icon-context icon-error"></span>
- <strong [textContent]="text.text"></strong>
+ <strong [textContent]="text.bulk_text"></strong>
</p>
<ul>
<li *ngFor="let wp of workPackages">
@@ -65,7 +63,7 @@
</div>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
class="button button_no-margin spot-action-bar--action"
@@ -74,10 +72,11 @@
></button>
<button
class="button button_no-margin -danger spot-action-bar--action"
- [textContent]="text.confirm"
[attr.disabled]="busy || blockedDueToUnconfirmedChildren || undefined"
- (click)="confirmDeletion($event)"
- ></button>
+ (click)="confirmDeletion($event)">
+ <span class="spot-icon spot-icon_delete"></span>
+ {{ text.confirm }}
+ </button>
</div>
</div>
</div>
diff --git a/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.ts b/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.ts
index 1e709e610ee..6ffaa5d109f 100644
--- a/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.ts
+++ b/frontend/src/app/shared/components/modals/wp-destroy-modal/wp-destroy.modal.ts
@@ -69,13 +69,14 @@ export class WpDestroyModalComponent extends OpModalComponent implements OnInit
public text = {
label_visibility_settings: this.I18n.t('js.label_visibility_settings'),
button_save: this.I18n.t('js.modals.button_save'),
- confirm: this.I18n.t('js.button_confirm'),
+ confirm: this.I18n.t('js.modals.button_delete'),
warning: this.I18n.t('js.label_warning'),
cancel: this.I18n.t('js.button_cancel'),
close: this.I18n.t('js.close_popup_title'),
label_confirm_children_deletion: this.I18n.t('js.modals.destroy_work_package.confirm_deletion_children'),
title: '',
- text: '',
+ bulk_text: '',
+ single_text: this.I18n.t('js.modals.destroy_work_package.single_text'),
childCount: (_wp:WorkPackageResource):string => '',
hasChildren: (_wp:WorkPackageResource):string => '',
deletesChildren: '',
@@ -108,7 +109,7 @@ export class WpDestroyModalComponent extends OpModalComponent implements OnInit
}
this.text.title = this.I18n.t('js.modals.destroy_work_package.title', { label: this.workPackageLabel });
- this.text.text = this.I18n.t('js.modals.destroy_work_package.text', {
+ this.text.bulk_text = this.I18n.t('js.modals.destroy_work_package.bulk_text', {
label: this.workPackageLabel,
count: this.workPackages.length,
});
diff --git a/frontend/src/app/shared/components/project-include/list/project-include-list.component.html b/frontend/src/app/shared/components/project-include/list/project-include-list.component.html
index b03130b396e..ae474de9600 100644
--- a/frontend/src/app/shared/components/project-include/list/project-include-list.component.html
+++ b/frontend/src/app/shared/components/project-include/list/project-include-list.component.html
@@ -1,27 +1,27 @@
<li
- class="spot-list--item"
- *ngFor="let project of projects; index as i; first as isFirst; last as isLast"
+ class="spot-list--item op-project-include-list--item"
+ *ngFor="let project of projects; index as i; first as isFirst"
data-qa-selector="op-project-include-list--item"
[attr.data-list-selector]="projectListItemIdentifier"
>
- <label
- tabindex="-1"
- class="spot-list--item-action op-project-include-list--item-action"
- (keydown.space)="changeSelected(project)"
- [ngClass]="{
- 'spot-list--item-action_disabled': project.disabled,
- 'spot-list--item-action_active': (searchableProjectListService.activeItemID$ | async) === project.id
- }"
- [attr.data-list-selector]="projectListActionIdentifier"
- [attr.data-list-disabled]="project.disabled || undefined"
+ <spot-tooltip
+ class="op-project-include-list--tooltip spot-list--item-floating-wrapper"
+ [alignment]="getTooltipAlignment(isFirst)"
+ [disabled]="!project.disabled"
+ [dark]="true"
>
- <spot-tooltip
- class="op-project-include-list--tooltip"
- [alignment]="getTooltipAlignment(project, isFirst, isLast)"
- [disabled]="!project.disabled"
- [dark]="true"
- >
- <ng-container slot="trigger">
+ <ng-container slot="trigger">
+ <label
+ tabindex="-1"
+ class="spot-list--item-action op-project-include-list--item-action"
+ (keydown.space)="changeSelected(project)"
+ [ngClass]="{
+ 'spot-list--item-action_disabled': project.disabled,
+ 'spot-list--item-action_active': (searchableProjectListService.activeItemID$ | async) === project.id
+ }"
+ [attr.data-list-selector]="projectListActionIdentifier"
+ [attr.data-list-disabled]="project.disabled || undefined"
+ >
<spot-checkbox
[tabindex]="-1"
[checked]="isChecked(project.href) || (includeSubprojects && parentChecked)"
@@ -36,23 +36,23 @@
[opSearchHighlight]="searchText"
[title]="project.name"
>{{ project.name }}</div>
- </ng-container>
+ </label>
+ </ng-container>
- <p
- slot="body"
- class="spot-body-small"
- >
- <span *ngIf="project.href === currentProjectHref else otherMessages">{{ text.current_project }}</span>
+ <p
+ slot="body"
+ class="spot-body-small"
+ >
+ <span *ngIf="project.href === currentProjectHref else otherMessages">{{ text.current_project }}</span>
- <ng-template #otherMessages>
- <span *ngIf="includeSubprojects && parentChecked else searchMatch">{{ text.include_all_selected }}</span>
- <ng-template #searchMatch>
- <span *ngIf="project.disabled">{{ text.does_not_match_search }}</span>
- </ng-template>
- </ng-template>
- </p>
- </spot-tooltip>
- </label>
+ <ng-template #otherMessages>
+ <span *ngIf="includeSubprojects && parentChecked else searchMatch">{{ text.include_all_selected }}</span>
+ <ng-template #searchMatch>
+ <span *ngIf="project.disabled">{{ text.does_not_match_search }}</span>
+ </ng-template>
+ </ng-template>
+ </p>
+ </spot-tooltip>
<ul
*ngIf="project.children.length"
diff --git a/frontend/src/app/shared/components/project-include/list/project-include-list.component.ts b/frontend/src/app/shared/components/project-include/list/project-include-list.component.ts
index 6436a883e81..84ee59c6dbb 100644
--- a/frontend/src/app/shared/components/project-include/list/project-include-list.component.ts
+++ b/frontend/src/app/shared/components/project-include/list/project-include-list.component.ts
@@ -81,15 +81,11 @@ export class OpProjectIncludeListComponent {
}
}
- public getTooltipAlignment(project:IProjectData, isFirst:boolean, isLast:boolean):SpotDropAlignmentOption {
+ public getTooltipAlignment(isFirst:boolean):SpotDropAlignmentOption {
if (!this.root || !isFirst) {
return SpotDropAlignmentOption.TopLeft;
}
- if (isLast && !project.children.length) {
- return SpotDropAlignmentOption.RightCenter;
- }
-
return SpotDropAlignmentOption.BottomLeft;
}
diff --git a/frontend/src/app/shared/components/project-include/project-include.component.sass b/frontend/src/app/shared/components/project-include/project-include.component.sass
index d9abf1aaf7d..13090176013 100644
--- a/frontend/src/app/shared/components/project-include/project-include.component.sass
+++ b/frontend/src/app/shared/components/project-include/project-include.component.sass
@@ -10,3 +10,8 @@
// A true center aligned text does not look center aligned
padding-top: 1px
margin-left: $spot-spacing-0_5
+
+ &--list
+ // If there is only one item and it is disabled, we'll need to be able to view the
+ // tooltip message. If we wouldn't have a default height here, the user would need to scroll
+ min-height: $spot-spacing-7
diff --git a/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.html b/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.html
index 27f1bb387bf..59e40197d6e 100644
--- a/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.html
+++ b/frontend/src/app/shared/components/time_entries/shared/modal/base.modal.html
@@ -9,7 +9,7 @@
<div class="spot-divider"></div>
- <div class="ngdialog-body spot-modal--body">
+ <div class="ngdialog-body spot-modal--body spot-container">
<te-form #editForm
[changeset]="changeset"
[showWorkPackageField]="showWorkPackageField"
@@ -18,7 +18,7 @@
</te-form>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--left">
<button class="button button_no-margin -danger spot-action-bar--action"
*ngIf="deleteAllowed"
diff --git a/frontend/src/app/shared/directives/focus/autofocus.directive.ts b/frontend/src/app/shared/directives/focus/autofocus.directive.ts
index 827ca28452e..e6e411bf76e 100644
--- a/frontend/src/app/shared/directives/focus/autofocus.directive.ts
+++ b/frontend/src/app/shared/directives/focus/autofocus.directive.ts
@@ -10,19 +10,24 @@ import { FocusHelperService } from './focus-helper';
selector: '[opAutofocus]',
})
export class AutofocusDirective implements AfterViewInit {
- @Input('opAutofocus') public condition = true;
+ @Input('opAutofocus') public condition:string|boolean = true;
constructor(
readonly FocusHelper:FocusHelperService,
readonly elementRef:ElementRef,
) { }
- ngAfterViewInit() {
+ ngAfterViewInit():void {
this.updateFocus();
}
- private updateFocus() {
- if (this.condition) {
+ private updateFocus():void {
+ // Empty string should count as true because just using the directive like the
+ // plain HTML autofocus attribute should be possible:
+ //
+ // <my-input opAutofocus />
+ //
+ if (this.condition || this.condition === '') {
this.FocusHelper.focus(this.elementRef.nativeElement);
}
}
diff --git a/frontend/src/app/spot/components/toggle/toggle.component.html b/frontend/src/app/spot/components/toggle/toggle.component.html
index 49c7cd3de4f..bbb274786bc 100644
--- a/frontend/src/app/spot/components/toggle/toggle.component.html
+++ b/frontend/src/app/spot/components/toggle/toggle.component.html
@@ -1,6 +1,6 @@
<label
*ngFor="let option of options"
- [ngClass]="{ 'button': true, '-disabled': disabled, 'form--field-inline-button': true, '-active': value === option.value }"
+ [ngClass]="{ 'button': true, '-disabled': disabled, 'form--field-inline-button': true, '-active': value === option.value, 'spot-toggle--button': true }"
data-qa-selector="spot-toggle--option"
[attr.data-qa-disabled]="disabled || undefined"
[attr.data-qa-active-toggle]="value === option.value"
diff --git a/frontend/src/app/spot/spot-docs.component.html b/frontend/src/app/spot/spot-docs.component.html
index 4e50f9b69d5..3bab450c52a 100644
--- a/frontend/src/app/spot/spot-docs.component.html
+++ b/frontend/src/app/spot/spot-docs.component.html
@@ -543,8 +543,10 @@ Currently selected value is {{ toggleValue }}
<div class="spot-modal">
<div class="spot-modal--header">Default size modal</div>
- <div class="spot-modal--body">Here is some text in the body. Additionally this is a destructive action.</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-modal--body spot-container">
+ <p class="spot-body-small">Here is some text in the body. Additionally this is a destructive action.</p>
+ </div>
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button class="spot-button spot-button_outlined spot-button_main spot-action-bar--action">
Cancel
@@ -563,11 +565,11 @@ Currently selected value is {{ toggleValue }}
<span>Wide modal</span>
</div>
<div class="spot-divider"></div>
- <div class="spot-modal--body">
- <p>Here is some text in the body.</p>
- <p>But this modal has a mininmal height!</p>
+ <div class="spot-modal--body spot-container">
+ <p class="spot-body-small">Here is some text in the body.</p>
+ <p class="spot-body-small">But this modal has a minimal height!</p>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<span>Some explanatory text.</span>
<button class="spot-button spot-button_main spot-action-bar--action">
diff --git a/frontend/src/app/spot/spot.module.ts b/frontend/src/app/spot/spot.module.ts
index c8ccdd98554..8480e13ecfd 100644
--- a/frontend/src/app/spot/spot.module.ts
+++ b/frontend/src/app/spot/spot.module.ts
@@ -1,7 +1,6 @@
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
-import { A11yModule } from '@angular/cdk/a11y';
import { UIRouterModule } from '@uirouter/angular';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { SPOT_DOCS_ROUTES } from './spot.routes';
diff --git a/frontend/src/app/spot/styles/sass/common/container-overrides.sass b/frontend/src/app/spot/styles/sass/common/container-overrides.sass
new file mode 100644
index 00000000000..eafed0f0cf5
--- /dev/null
+++ b/frontend/src/app/spot/styles/sass/common/container-overrides.sass
@@ -0,0 +1,6 @@
+.spot-container
+ &.spot-modal--body > *
+ margin: $spot-spacing-1 $spot-spacing-1 0
+
+ &:last-child
+ margin-bottom: $spot-spacing-1
diff --git a/frontend/src/app/spot/styles/sass/common/container.sass b/frontend/src/app/spot/styles/sass/common/container.sass
index bb157e14b21..a8d038d40ee 100644
--- a/frontend/src/app/spot/styles/sass/common/container.sass
+++ b/frontend/src/app/spot/styles/sass/common/container.sass
@@ -6,24 +6,16 @@
> .spot-header-small,
> .spot-subheader-big,
> .spot-subheader-small,
+ > .spot-subheader-extra-small,
> .spot-body-big,
> .spot-body-small,
> .spot-caption,
+ > .spot-divider,
> .spot-text-field
- margin: 0 $spot-spacing-1
- margin-top: $spot-spacing-1
-
- &:first-child
- margin-top: $spot-spacing-0-5
+ margin: $spot-spacing-1 $spot-spacing-1 0
&:last-child
- margin-bottom: $spot-spacing-0-5
+ margin-bottom: $spot-spacing-1
> .spot-list
- padding: $spot-spacing-1 0
-
- &:first-child
- padding-top: $spot-spacing-1
-
- &:last-child
- padding-bottom: $spot-spacing-1
+ margin: $spot-spacing-1 0
diff --git a/frontend/src/app/spot/styles/sass/common/index.sass b/frontend/src/app/spot/styles/sass/common/index.sass
index f2d34b833e9..a6fa8a1a03e 100644
--- a/frontend/src/app/spot/styles/sass/common/index.sass
+++ b/frontend/src/app/spot/styles/sass/common/index.sass
@@ -1,4 +1,5 @@
@import './icon'
@import './focus'
@import './container'
+@import './container-overrides'
@import './typography'
diff --git a/frontend/src/app/spot/styles/sass/common/typography.sass b/frontend/src/app/spot/styles/sass/common/typography.sass
index cc191c8215f..63b31a23068 100644
--- a/frontend/src/app/spot/styles/sass/common/typography.sass
+++ b/frontend/src/app/spot/styles/sass/common/typography.sass
@@ -2,21 +2,31 @@
@include spot-header-big
padding: 0
margin: 0
+ border: 0
.spot-header-small
@include spot-header-small
padding: 0
margin: 0
+ border: 0
.spot-subheader-big
@include spot-subheader-big
padding: 0
margin: 0
+ border: 0
.spot-subheader-small
@include spot-subheader-small
padding: 0
margin: 0
+ border: 0
+
+.spot-subheader-extra-small
+ @include spot-subheader-extra-small
+ padding: 0
+ margin: 0
+ border: 0
.spot-body-big
@include spot-body-big
@@ -32,6 +42,7 @@
@include spot-caption
padding: 0
margin: 0
+ border: 0
.spot-header-big,
.spot-header-small,
diff --git a/frontend/src/app/spot/styles/sass/components/divider.sass b/frontend/src/app/spot/styles/sass/components/divider.sass
index 8ee7f8fa9f2..9b1aa097732 100644
--- a/frontend/src/app/spot/styles/sass/components/divider.sass
+++ b/frontend/src/app/spot/styles/sass/components/divider.sass
@@ -1,5 +1,4 @@
.spot-divider
- margin-top: $spot-spacing-1
border-bottom: 1px solid $spot-color-basic-gray-5
&_strong
diff --git a/frontend/src/app/spot/styles/sass/components/modal.sass b/frontend/src/app/spot/styles/sass/components/modal.sass
index ab352bddafb..badb093a040 100644
--- a/frontend/src/app/spot/styles/sass/components/modal.sass
+++ b/frontend/src/app/spot/styles/sass/components/modal.sass
@@ -27,7 +27,7 @@
max-width: calc(100vw - 6rem)
&_wide
- width: 70rem
+ width: 60rem
min-height: 40vh
&--header
@@ -38,7 +38,10 @@
position: relative
align-items: center
- .spot-icon
+ + .spot-divider
+ margin-top: $spot-spacing-1
+
+ > .spot-icon
width: $spot-spacing-1-5
height: $spot-spacing-1-5
margin-right: $spot-spacing-0-5
@@ -56,13 +59,9 @@
display: flex
flex-direction: column
- padding: 1rem
flex-grow: 1
flex-shrink: 1
overflow-y: auto
&:focus
outline-style: none
-
- &--footer
- width: 100%
diff --git a/frontend/src/app/spot/styles/sass/components/toggle.sass b/frontend/src/app/spot/styles/sass/components/toggle.sass
index 4d5108a6e97..8bbe9bd6576 100644
--- a/frontend/src/app/spot/styles/sass/components/toggle.sass
+++ b/frontend/src/app/spot/styles/sass/components/toggle.sass
@@ -45,3 +45,6 @@
width: 1px
overflow: hidden
clip: rect(1px,1px,1px,1px)
+
+ &--button
+ margin: 0
diff --git a/frontend/src/app/spot/styles/sass/components/tooltip.sass b/frontend/src/app/spot/styles/sass/components/tooltip.sass
index dd0fe58cdff..7b03141b847 100644
--- a/frontend/src/app/spot/styles/sass/components/tooltip.sass
+++ b/frontend/src/app/spot/styles/sass/components/tooltip.sass
@@ -8,6 +8,8 @@
@include spot-z-index("tooltip", 1)
pointer-events: none
opacity: 0
+ height: 0
+ width: 0
position: absolute
min-width: $spot-spacing-10 + $spot-spacing-10
@@ -141,6 +143,8 @@
&:hover &--body
pointer-events: all
opacity: 1
+ height: auto
+ width: auto
&_dark &--body
color: $spot-color-basic-white
diff --git a/frontend/src/app/spot/styles/sass/variables/typography.sass b/frontend/src/app/spot/styles/sass/variables/typography.sass
index c01905b1f7f..b8391d766b8 100644
--- a/frontend/src/app/spot/styles/sass/variables/typography.sass
+++ b/frontend/src/app/spot/styles/sass/variables/typography.sass
@@ -26,6 +26,13 @@
font-style: $style
line-height: 1.5rem
+@mixin spot-subheader-extra-small($weight: bold, $style: normal)
+ font-family: Lato, sans-serif
+ font-size: 1rem
+ font-weight: $weight
+ font-style: $style
+ line-height: 1.5rem
+
@mixin spot-body-big($weight: normal, $style: normal)
font-family: Lato, sans-serif
font-size: 1rem
diff --git a/frontend/src/global_styles/content/_forms.sass b/frontend/src/global_styles/content/_forms.sass
index ce94c5e67b3..410f2eca5ad 100644
--- a/frontend/src/global_styles/content/_forms.sass
+++ b/frontend/src/global_styles/content/_forms.sass
@@ -400,6 +400,9 @@ fieldset.form--fieldset
line-height: $base-line-height
padding-right: 0.325rem
+ &.-bold
+ font-weight: bold
+
&.-top
align-self: flex-start
line-height: 2.15rem
diff --git a/frontend/src/global_styles/content/_grid.sass b/frontend/src/global_styles/content/_grid.sass
index 3b56ccb21c9..7a43867ab91 100644
--- a/frontend/src/global_styles/content/_grid.sass
+++ b/frontend/src/global_styles/content/_grid.sass
@@ -242,7 +242,6 @@ body.widget-grid-layout
.grid--addable-widget
min-width: 400px
padding: 20px 5px
- border-bottom: 1px solid var(--gray)
cursor: pointer
background: none
transition: background 4s ease
diff --git a/frontend/src/global_styles/content/_help_texts.sass b/frontend/src/global_styles/content/_help_texts.sass
index e683d078444..64981d57e49 100644
--- a/frontend/src/global_styles/content/_help_texts.sass
+++ b/frontend/src/global_styles/content/_help_texts.sass
@@ -30,3 +30,6 @@
// Avoid large right margin for conditional button
.help-text--edit-button
margin-right: 0
+
+ .attribute-help-text--header-text
+ @include text-shortener
diff --git a/frontend/src/global_styles/content/_index.sass b/frontend/src/global_styles/content/_index.sass
index 7b54ddf51a7..22ba4e96594 100644
--- a/frontend/src/global_styles/content/_index.sass
+++ b/frontend/src/global_styles/content/_index.sass
@@ -47,7 +47,6 @@
@import principal
@import principal-list
@import progress_bar
-@import request_for_confirmation
@import form_error_messages
@import ajax_indicator
@import tooltips
diff --git a/frontend/src/global_styles/content/_modal.lsg b/frontend/src/global_styles/content/_modal.lsg
index 8db33863916..02451d69de3 100644
--- a/frontend/src/global_styles/content/_modal.lsg
+++ b/frontend/src/global_styles/content/_modal.lsg
@@ -8,7 +8,7 @@
Export
</div>
<div class="spot-divider"></div>
- <div class="spot-modal--body">
+ <div class="spot-modal--body spot-container">
<ul class="export-options">
<li>
<a>
@@ -48,7 +48,7 @@
</li>
</ul>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button name="button" type="submit" class="button button_no-margin spot-action-bar--action">Close</button>
</div>
@@ -66,11 +66,11 @@
<span>Confirm deletion of Work Package</span>
</div>
<div class="spot-divider"></div>
- <div class="spot-modal--body">
- <p>Are you sure you want to delete the following work package?<p>
- <p> ... </p>
+ <div class="spot-modal--body spot-container">
+ <p class="spot-body-small">Are you sure you want to delete the following work package?<p>
+ <p class="spot-body-small"> ... </p>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button name="button" type="submit" class="button button_no-margin spot-action-bar--action">Cancel</button>
<button name="button" type="submit" class="button button_no-margin -danger spot-action-bar--action">Continue</button>
diff --git a/frontend/src/global_styles/content/_request_for_confirmation.sass b/frontend/src/global_styles/content/_request_for_confirmation.sass
deleted file mode 100644
index e9dcaf4d2c6..00000000000
--- a/frontend/src/global_styles/content/_request_for_confirmation.sass
+++ /dev/null
@@ -1,33 +0,0 @@
-//-- copyright
-// OpenProject is an open source project management software.
-// Copyright (C) 2012-2022 the OpenProject GmbH
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License version 3.
-//
-// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-// Copyright (C) 2006-2013 Jean-Philippe Lang
-// Copyright (C) 2010-2013 the ChiliProject Team
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// See COPYRIGHT and LICENSE files for more details.
-//++
-
-.request-for-confirmation--form
- padding: 10px 0 20px 0
-
- label
- font-weight: bold
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 40193e9fce7..df819c7c1ee 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
@@ -19,3 +19,8 @@
.ee-attribute-highlighting-upsale
margin-bottom: 1.5rem
+
+ .tab-content
+ height: 18rem
+ overflow-y: scroll
+ @include styled-scroll-bar
\ No newline at end of file
diff --git a/frontend/src/global_styles/vendor/_flatpickr-overrides.sass b/frontend/src/global_styles/vendor/_flatpickr-overrides.sass
index 34406f709cf..fb8e2ad1d2c 100644
--- a/frontend/src/global_styles/vendor/_flatpickr-overrides.sass
+++ b/frontend/src/global_styles/vendor/_flatpickr-overrides.sass
@@ -2,3 +2,7 @@
@at-root div#{&}
overflow: auto
+
+.flatpickr-calendar.inline
+ // flatpickr default styles introduce a top: 2px, that causes strange scrolling behavior
+ top: unset !important
diff --git a/modules/grids/spec/support/pages/grid.rb b/modules/grids/spec/support/pages/grid.rb
index 07b033d0419..c1034f2d431 100644
--- a/modules/grids/spec/support/pages/grid.rb
+++ b/modules/grids/spec/support/pages/grid.rb
@@ -36,7 +36,7 @@ module Pages
.to have_content(I18n.t('js.grid.add_widget'))
SeleniumHubWaiter.wait
- page.find('.grid--addable-widget', text: Regexp.new("^#{name}$")).click
+ page.find('[data-qa-selector="op-grid--addable-widget"]', text: Regexp.new("^#{name}$")).click
end
end
@@ -100,7 +100,7 @@ module Pages
.to have_content(I18n.t('js.grid.add_widget'))
expect(page)
- .not_to have_selector('.grid--addable-widget', text: Regexp.new("^#{name}$"))
+ .not_to have_selector('[data-qa-selector="op-grid--addable-widget"]', text: Regexp.new("^#{name}$"))
end
end
end
diff --git a/modules/webhooks/app/cells/views/response_body.erb b/modules/webhooks/app/cells/views/response_body.erb
index e06f6f1ca5c..b5ad03ee9ff 100644
--- a/modules/webhooks/app/cells/views/response_body.erb
+++ b/modules/webhooks/app/cells/views/response_body.erb
@@ -8,19 +8,19 @@
</a>
<div class="modal-delivery-element">
<div class="spot-modal--header">
- <%= log_entry.class.human_attribute_name('response_body') %>
+ <h1 class="spot-subheader-big_bold"> <%= log_entry.class.human_attribute_name('response_body') %> </h1>
</div>
<div class="spot-divider"></div>
- <div class="spot-modal--body">
- <h2>Headers</h2>
+ <div class="spot-modal--body spot-container">
+ <h2 class="spot-body-big_bold">Headers</h2>
<pre class="webhooks--response-headers"><%- log_entry.response_headers.each do |k, v| -%><strong><%= k -%></strong>: <span><%= v -%></span><br/><%- end -%></pre>
- <hr/>
- <h2>Response body</h2>
+ <div class="spot-divider"></div>
+ <h2 class="spot-body-big_bold">Response body</h2>
<pre class="webhooks--response-body">
<%= log_entry.response_body %>
</pre>
</div>
- <div class="spot-modal--footer spot-action-bar">
+ <div class="spot-action-bar">
<div class="spot-action-bar--right">
<button
class="button button_no-margin spot-action-bar--action"
diff --git a/spec/features/users/invite_user_modal/custom_fields_spec.rb b/spec/features/users/invite_user_modal/custom_fields_spec.rb
index ed89bdd578d..35824ba0e5e 100644
--- a/spec/features/users/invite_user_modal/custom_fields_spec.rb
+++ b/spec/features/users/invite_user_modal/custom_fields_spec.rb
@@ -116,11 +116,9 @@ describe 'Invite user modal custom fields', type: :feature, js: true do
modal.click_next
# Remaining steps
- modal.role_step
- modal.invitation_step
modal.confirmation_step
modal.click_modal_button 'Send invitation'
- modal.expect_text "Invite #{principal.mail} to #{project.name}"
+ modal.expect_text "Invite user"
# Close
modal.click_modal_button 'Send invitation'
diff --git a/spec/features/users/invite_user_modal/invite_user_modal_spec.rb b/spec/features/users/invite_user_modal/invite_user_modal_spec.rb
index bcc1151135c..85bbd57eae2 100644
--- a/spec/features/users/invite_user_modal/invite_user_modal_spec.rb
+++ b/spec/features/users/invite_user_modal/invite_user_modal_spec.rb
@@ -181,7 +181,7 @@ describe 'Invite user modal', type: :feature, js: true do
it 'does not show the invite user option' do
modal.project_step
- ngselect = modal.open_select_in_step principal.mail
+ ngselect = modal.open_select_in_step 'op-ium-principal-search', query: principal.mail
expect(ngselect).to have_text "No users were found"
expect(ngselect).not_to have_text "Invite: #{principal.mail}"
end
@@ -205,7 +205,7 @@ describe 'Invite user modal', type: :feature, js: true do
end
it 'disables projects for which you do not have rights' do
- ngselect = modal.open_select_in_step
+ ngselect = modal.open_select_in_step '.ng-select-container'
expect(ngselect).to have_text "#{project_no_permissions.name}\nYou are not allowed to invite members to this project"
end
end
@@ -216,7 +216,7 @@ describe 'Invite user modal', type: :feature, js: true do
let(:current_user) { create :admin }
it 'disables projects for which you do not have rights' do
- ngselect = modal.open_select_in_step
+ ngselect = modal.open_select_in_step '.ng-select-container'
expect(ngselect).to have_no_text archived_project
end
end
@@ -243,7 +243,7 @@ describe 'Invite user modal', type: :feature, js: true do
it 'does not allow to invite a new placeholder' do
modal.project_step
- modal.open_select_in_step 'SOME NEW PLACEHOLDER'
+ modal.open_select_in_step 'op-ium-principal-search', query: 'SOME NEW PLACEHOLDER'
expect(page)
.to have_text I18n.t('js.invite_user_modal.principal.no_results_placeholder')
diff --git a/spec/features/users/invite_user_modal/permission_lacking_current_project_spec.rb b/spec/features/users/invite_user_modal/permission_lacking_current_project_spec.rb
index b6cc6a82d2c..6671e116e6f 100644
--- a/spec/features/users/invite_user_modal/permission_lacking_current_project_spec.rb
+++ b/spec/features/users/invite_user_modal/permission_lacking_current_project_spec.rb
@@ -73,15 +73,13 @@ describe 'Inviting user in project the current user is lacking permission in', t
modal.expect_error_displayed I18n.t('js.invite_user_modal.project.lacking_permission')
# Proceeding with a different project
- modal.autocomplete(invite_project.name)
+ modal.autocomplete('.ng-select-container', invite_project.name)
modal.click_next
# Remaining steps
modal.principal_step
- modal.role_step
- modal.invitation_step
- modal.expect_text "Invite #{other_user.name} to #{invite_project.name}"
+ modal.expect_text "Invite user"
modal.confirmation_step
modal.click_modal_button 'Send invitation'
diff --git a/spec/support/components/datepicker/work_package_datepicker.rb b/spec/support/components/datepicker/work_package_datepicker.rb
index 480536e1bea..1d35e77eef2 100644
--- a/spec/support/components/datepicker/work_package_datepicker.rb
+++ b/spec/support/components/datepicker/work_package_datepicker.rb
@@ -145,7 +145,7 @@ module Components
end
page.within("[data-qa-selector='datepicker-#{key}-date']") do
- find('a', text: 'Today').click
+ find('button', text: 'Today').click
end
end
diff --git a/spec/support/components/users/invite_user_modal.rb b/spec/support/components/users/invite_user_modal.rb
index b53632cbee0..ae964aab7c0 100644
--- a/spec/support/components/users/invite_user_modal.rb
+++ b/spec/support/components/users/invite_user_modal.rb
@@ -53,23 +53,13 @@ module Components
# STEP 2: User name
principal_step
- # STEP 3: Role name
- role_step
-
- # STEP 4: Invite message
- invitation_step unless placeholder?
-
- # STEP 5: Confirmation screen
+ # STEP 3: Confirmation screen
confirmation_step
- # Step 6: Perform invite
+ # Step 4: Perform invite
click_modal_button 'Send invitation'
- if invite_user?
- expect_text "Invite #{principal.mail} to #{project.name}"
- else
- expect_text "#{principal_name} was invited!"
- end
+ expect_text "#{principal_name} was invited!"
text =
case principal
@@ -92,14 +82,14 @@ module Components
def project_step(next_step: true, skip_autocomplete: false)
expect_title 'Invite user'
- autocomplete project.name unless skip_autocomplete
+ autocomplete '.ng-select-container', project.name unless skip_autocomplete
select_type type
click_next if next_step
end
- def open_select_in_step(query = '')
- search_autocomplete modal_element.find('.ng-select-container'),
+ def open_select_in_step(selector, query = '')
+ search_autocomplete modal_element.find(selector),
query:,
results_selector: 'body'
end
@@ -109,16 +99,17 @@ module Components
sleep(0.1)
if invite_user?
- autocomplete principal_name, select_text: "Invite: #{principal_name}"
+ autocomplete "op-ium-principal-search", principal_name, select_text: "Invite: #{principal_name}"
else
- autocomplete principal_name
+ autocomplete 'op-ium-principal-search', principal_name
end
-
+ autocomplete 'op-ium-role-search', role.name
+ invitation_message invite_message unless placeholder?
click_next if next_step
end
def role_step(next_step: true)
- autocomplete role.name
+ autocomplete 'op-ium-role-search', role.name
click_next if next_step
end
@@ -137,8 +128,8 @@ module Components
end
end
- def autocomplete(query, select_text: query)
- select_autocomplete modal_element.find('.ng-select-container'),
+ def autocomplete(selector, query, select_text: query)
+ select_autocomplete modal_element.find(selector),
query:,
select_text:,
results_selector: 'body'
diff --git a/spec/support/components/work_packages/destroy_modal.rb b/spec/support/components/work_packages/destroy_modal.rb
index be3a7d5afab..97ce2b4831f 100644
--- a/spec/support/components/work_packages/destroy_modal.rb
+++ b/spec/support/components/work_packages/destroy_modal.rb
@@ -40,10 +40,10 @@ module Components
page.within(container) do
if wps.length == 1
wp = wps.first
- expect(page).to have_selector('strong', text: "#{wp.type.name} ##{wp.id} #{wp.subject}")
+ expect(page).to have_selector('strong', text: "#{wp.subject} ##{wp.id}")
else
expect(page).to have_selector('.danger-zone--warning',
- text: 'Are you sure you want to delete the following work packages ?')
+ text: 'Are you sure you want to delete the following work packages?')
wps.each do |wp|
expect(page).to have_selector('li', text: "##{wp.id} #{wp.subject}")
end
@@ -59,7 +59,7 @@ module Components
def confirm_deletion
page.within(container) do
- click_button 'Confirm'
+ click_button 'Delete'
end
end