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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Epic/placeholder users frontend (#8977)
Aleix Suau44cf9e0c5eda
diff --git a/.gitignore b/.gitignoreindex 6f81b151b1b..fad2f3579da 100644--- a/.gitignore+++ b/.gitignore@@ -88,6 +88,7 @@ npm-debug.log*/.foreman.DS_Store.rspec+.byebug_history# coverage in plugins/lib/plugins/*/coveragediff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rbindex 29faa65813e..e73a1be175e 100644--- a/app/helpers/users_helper.rb+++ b/app/helpers/users_helper.rb@@ -102,7 +102,7 @@ module UsersHelper### Returns the user avatar or a default imagedef user_avatar_icon- op_icon('icon-context icon-user')+ op_icon('op-icon icon-context icon-user')enddef change_user_status_buttons(user)diff --git a/app/views/account/_password_login_form.html.erb b/app/views/account/_password_login_form.html.erbindex 44eccb40769..af6344c3646 100644--- a/app/views/account/_password_login_form.html.erb+++ b/app/views/account/_password_login_form.html.erb@@ -67,7 +67,7 @@ See docs/COPYRIGHT.rdoc for more details.<%= link_to t(:label_register),'',title: t(:label_register),- class: 'registration-modal--activation-link modal-wrapper--activation-link' %>+ class: 'registration-modal--activation-link' %><% end %></div></div>diff --git a/app/views/account/_register.html.erb b/app/views/account/_register.html.erbindex 9001d6ae72d..2f9d0ef0920 100644--- a/app/views/account/_register.html.erb+++ b/app/views/account/_register.html.erb@@ -27,25 +27,28 @@ See docs/COPYRIGHT.rdoc for more details.++#%>-<div class="modal-wrapper--content">+<div class="modal-delivery-element"><%= labelled_tabular_form_for(@user, url: account_register_path, html: { class: 'form -wide-labels' }) do |f| %><%= back_url_hidden_field_tag %><%= error_messages_for :user %>- <div class="op-modal--modal-header">- <h2>- <%= op_icon 'icon-context icon-user' %>+ <div class="op-modal--header">+ <%= op_icon 'icon-context icon-user' %>+ <h1 class="op-modal--title"><%= I18n.t('onboarding.welcome') %>- </h2>- <a class="op-modal--modal-close-button dynamic-content-modal--close-button"- title="<%= t('js.close_popup_title') %>"- aria-label="<%= t('js.close_popup_title') %>">+ </h1>+ <button+ type="button"+ class="op-modal--close-button"+ title="<%= t('js.close_popup_title') %>"+ aria-label="<%= t('js.close_popup_title') %>"+ ><%= op_icon('icon-close') %>- </a>+ </button></div>- <div class="op-modal--modal-body">+ <div class="op-modal--body"><h2><%= t(:label_register) %></h2><section class="form--section"><% if @user.auth_source_id.nil? %>@@ -109,7 +112,7 @@ See docs/COPYRIGHT.rdoc for more details.<%= render partial: 'account/auth_providers', locals: { omniauth_title: I18n.t('account.signup_with_auth_provider'), wide: true } %></div>- <div class="op-modal--modal-footer">+ <div class="op-modal--footer"><%= render partial: 'account/footer' %></div><% end %>diff --git a/app/views/onboarding/_configuration_modal.html.erb b/app/views/onboarding/_configuration_modal.html.erbindex 528848516f9..362403e2a8f 100644--- a/app/views/onboarding/_configuration_modal.html.erb+++ b/app/views/onboarding/_configuration_modal.html.erb@@ -27,32 +27,35 @@ See docs/COPYRIGHT.rdoc for more details.++#%>-<div class="modal-wrapper--content">+<div class="modal-delivery-element"><%= labelled_tabular_form_for current_user, url: { action: 'user_settings', controller: 'onboarding' }, html: { id: 'user-form' } do |f| %>- <div class="onboarding--start-modal">- <div class="onboarding--top-menu op-modal--modal-header">- <%= user_avatar_icon %>- <h2><%= I18n.t('onboarding.welcome') %>, <%= current_user.name %></h2>- <a class="op-modal--modal-close-button dynamic-content-modal--close-button"- title="<%= t('js.close_popup_title') %>"- aria-label="<%= t('js.close_popup_title') %>">- <%= op_icon('icon-close') %>- </a>+ <div class="op-modal--header op-modal--header_highlight">+ <%= user_avatar_icon %>+ <h1 class="op-modal--title">+ <%= I18n.t('onboarding.welcome') %>, <%= current_user.name %>+ </h1>+ <button+ type="button"+ class="op-modal--close-button"+ title="<%= t('js.close_popup_title') %>"+ aria-label="<%= t('js.close_popup_title') %>"+ >+ <%= op_icon('icon-close') %>+ </button>+ </div>++ <div class="onboarding--main op-modal--body">+ <b><%= I18n.t('onboarding.select_language') %></b>+ <fieldset class="form--fieldset">+ <div class="form--field">+ <%= f.select :language, lang_options_for_select, container_class: '-slim' %></div>+ </fieldset>+ </div>- <div class="onboarding--main op-modal--modal-body">- <b><%= I18n.t('onboarding.select_language') %></b>- <fieldset class="form--fieldset">- <div class="form--field">- <%= f.select :language, lang_options_for_select, container_class: '-slim' %>- </div>- </fieldset>- </div>-- <div class="onboarding--footer op-modal--modal-footer">- <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>- </div>- </div>+ <div class="onboarding--footer op-modal--footer">+ <%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark' %>+ </div><% end %></div>diff --git a/app/views/onboarding/_menu_item.html.erb b/app/views/onboarding/_menu_item.html.erbindex 927ccaff79d..51d0a1fd560 100644--- a/app/views/onboarding/_menu_item.html.erb+++ b/app/views/onboarding/_menu_item.html.erb@@ -33,7 +33,7 @@ See docs/COPYRIGHT.rdoc for more details.<%= link_to t(:label_introduction_video),'',title: t(:label_introduction_video),- class: 'modal-wrapper--activation-link' %>+ class: 'modal-delivery-element--activation-link' %></li><%= render partial: '/onboarding/onboarding_video_modal' %></section>diff --git a/app/views/onboarding/_onboarding_video_modal.html.erb b/app/views/onboarding/_onboarding_video_modal.html.erbindex 01dc521ca46..4a66c8dfe38 100644--- a/app/views/onboarding/_onboarding_video_modal.html.erb+++ b/app/views/onboarding/_onboarding_video_modal.html.erb@@ -27,34 +27,39 @@ See docs/COPYRIGHT.rdoc for more details.++#%>-<div class="modal-wrapper--content">- <div class="onboarding--start-modal">- <div class="onboarding--top-menu op-modal--modal-header">- <%= user_avatar_icon %>- <h2><%= I18n.t('onboarding.welcome') %></h2>- <a class="op-modal--modal-close-button dynamic-content-modal--close-button"- title="<%= t('js.close_popup_title') %>"- aria-label="<%= t('js.close_popup_title') %>">- <%= op_icon('icon-close') %>- </a>- </div>+<div class="modal-delivery-element">+ <div class="op-modal--header op-modal--header_highlight">+ <%= op_icon 'icon-context icon-user' %>+ <h1 class="op-modal--title">+ <%= I18n.t('onboarding.welcome') %>+ </h1>+ <button+ type="button"+ class="op-modal--close-button"+ title="<%= t('js.close_popup_title') %>"+ aria-label="<%= t('js.close_popup_title') %>"+ >+ <%= op_icon('icon-close') %>+ </button>+ </div>- <div class="onboarding--main op-modal--modal-body">- <h2><%= I18n.t('onboarding.heading_getting_started') %></h2>- <div class="onboarding--video-block">- <div class="onboarding--video-text">- <span><%= I18n.t('onboarding.text_getting_started_description') %></span>- </div>- <div class="onboarding--video iframe-target-wrapper">- </div>+ <div class="onboarding--main op-modal--body">+ <h2><%= I18n.t('onboarding.heading_getting_started') %></h2>+ <div class="onboarding--video-block">+ <div class="onboarding--video-text">+ <span><%= I18n.t('onboarding.text_getting_started_description') %></span>+ </div>+ <div class="onboarding--video iframe-target-wrapper"></div></div>+ </div>- <div class="onboarding--footer op-modal--modal-footer">- <span><em><%= I18n.t('onboarding.text_show_again') %></em></span>- <button class="dynamic-content-modal--close-button button -highlight"- title=<%= t(:button_close)%>> <%= t(:button_close)%>- </button>- </div>+ <div class="onboarding--footer op-modal--footer">+ <span><em><%= I18n.t('onboarding.text_show_again') %></em></span>+ <button+ class="button -highlight"+ dynamic-content-modal-close-button+ title=<%= t(:button_close)%>+ ><%= t(:button_close)%></button></div></div>diff --git a/app/views/wiki/_wiki_export_modal.html.erb b/app/views/wiki/_wiki_export_modal.html.erbindex 1e6b233bc88..9e54a0168dc 100644--- a/app/views/wiki/_wiki_export_modal.html.erb+++ b/app/views/wiki/_wiki_export_modal.html.erb@@ -27,33 +27,43 @@ See docs/COPYRIGHT.rdoc for more details.++#%>-<div class="modal-wrapper--content">- <div class="onboarding--top-menu op-modal--modal-header">- <h3><%= I18n.t('js.label_export') %></h3>-- <a class="op-modal--modal-close-button dynamic-content-modal--close-button"- title="<%= t('js.close_popup_title') %>"- aria-label="<%= t('js.close_popup_title') %>">+<div class="modal-delivery-element">+ <div class="op-modal--header">+ <h1 class="op-modal--title">+ <%= I18n.t('js.label_export') %>+ </h1>+ <button+ type="button"+ class="op-modal--close-button"+ aria-label="<%= t('js.close_popup_title') %>"+ ><%= op_icon('icon-close') %>- </a>+ </button></div>- <div class="op-modal--modal-body">- <ul class="export-options">- <li>- <%= link_to url_for(controller: '/activities',- action: 'index',- show_wiki_edits: 1,- apply: true,- key: User.current.rss_key, format: 'atom') do %>+ <div class="op-modal--body">+ <ul class="op-export-options">+ <li class="op-export-options--option">+ <%= link_to url_for(+ controller: '/activities',+ action: 'index',+ show_wiki_edits: 1,+ apply: true,+ key: User.current.rss_key,+ format: 'atom',+ ), class: 'op-export-options--option-link' do %><%= op_icon('icon-big icon-export-atom') %>- <span class="export-label"><%= t('export.format.atom') %></span>+ <span class="op-export-options--option-label"><%= t('export.format.atom') %></span><% end %></li>- <li>- <%= link_to url_for(version: @content.version, id: @page, format: 'markdown') do %>+ <li class="op-export-options--option">+ <%= link_to url_for(+ version: @content.version,+ id: @page,+ format: 'markdown',+ ), class: 'op-export-options--option-link' do %><%= op_icon('icon-big icon-ticket') %>- <span class="export-label"><%= t('text_formatting.markdown') %></span>+ <span class="op-export-options--option-label"><%= t('text_formatting.markdown') %></span><% end %></li></ul>diff --git a/app/views/wiki/show.html.erb b/app/views/wiki/show.html.erbindex 9c58f396f0e..b2ab69be951 100644--- a/app/views/wiki/show.html.erb+++ b/app/views/wiki/show.html.erb@@ -106,7 +106,7 @@ See docs/COPYRIGHT.rdoc for more details.<%= link_to I18n.t('js.label_export'),'',title: I18n.t('js.label_export'),- class: 'modal-wrapper--activation-link icon-context icon-export' %>+ class: 'modal-delivery-element--activation-link icon-context icon-export' %></li><%= render partial: 'wiki/wiki_export_modal' %></section>diff --git a/config/locales/js-en.yml b/config/locales/js-en.ymlindex 1a7d34e7e4f..1d46009c435 100644--- a/config/locales/js-en.yml+++ b/config/locales/js-en.yml@@ -1033,3 +1033,82 @@ en:card: 'Cards'list: 'Table'timeline: 'Gantt'++ invite_user_modal:+ back: 'Back'+ invite: 'Invite'+ title:+ invite: 'Invite user'+ invite_to_project: 'Invite %{type} to %{project}'+ user: 'user'+ group: 'group'+ placeholder: 'placeholder user'+ invite_principal_to_project: 'Invite %{principal} to %{project}'+ project:+ label: 'Project'+ required: 'Please select a project'+ next_button: 'Next'+ no_results: 'No projects were found'+ type:+ required: 'Please select the type of principal to be invited'+ user:+ title: 'User'+ description: 'Permissions based on the assigned role in the selected project'+ group:+ title: 'Group'+ description: 'Permissions based on the assigned role in the selected project'+ placeholder:+ title: 'Placeholder'+ description: 'Has no access to the project and no emails are sent out'++ principal:+ label:+ name_or_email: 'Name or email address'+ name: 'Name'++ already_member_message: 'Already a member of %{project}'+ no_results_user: 'No users were found'+ invite_user: 'Invite: %{email}'+ change_user_selection: 'Change e-mail-address or select an existing user'++ no_results_placeholder: 'No placeholders were found'+ change_placeholder_selection: 'Change name or select an existing placeholder'+ create_new_placeholder: 'Create new placeholder: %{name}'++ no_results_group: 'No groups were found'+ create_new_group: 'Create new group: %{name}'+ change_group_selection: 'Change name or select an existing group'++ next_button: 'Next'++ required:+ user: 'Please select a user'+ placeholder: 'Please select a placeholder'+ group: 'Please select a group'++ role:+ label: 'Role in %{project}'+ 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.+ <a+ href="%{href}"+ target="_blank">+ learn more about roles and permissions.+ </a>'+ required: 'Please select a role'+ next_button: 'Next'++ 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'++ summary:+ next_button: 'Send Invitation'++ success:+ title: '%{principal} was invited!'+ description:+ user: 'The user can now login to access %{project}. Meanwhile you can already plan with that user and assign work packages for instance.'+ placeholder: 'The placeholder can now be used in %{project}. Meanwhile you can already plan with that user and assign work packages for instance.'+ group: 'The group is now a part of %{project}. Meanwhile you can already plan with that group and assign work packages for instance.'+ next_button: 'Continue'diff --git a/docker-compose.yml b/docker-compose.ymlindex c01fe0fb83e..9b3d69520a2 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -34,25 +34,6 @@ x-op-frontend-build: &frontend-buildDEV_GID: $DEV_GIDservices:- db:- image: postgres:10- <<: *restart_policy- stop_grace_period: "3s"- volumes:- - "pgdata:/var/lib/postgresql/data"- environment:- POSTGRES_USER: ${DB_USERNAME:-postgres}- POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}- POSTGRES_DB: ${DB_DATABASE:-openproject}- networks:- - network-- cache:- image: memcached- <<: *restart_policy- networks:- - network-backend:build:<<: *build@@ -96,6 +77,25 @@ services:depends_on:- backend+ db:+ image: postgres:10+ <<: *restart_policy+ stop_grace_period: "3s"+ volumes:+ - "pgdata:/var/lib/postgresql/data"+ environment:+ POSTGRES_USER: ${DB_USERNAME:-postgres}+ POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}+ POSTGRES_DB: ${DB_DATABASE:-openproject}+ networks:+ - network++ cache:+ image: memcached+ <<: *restart_policy+ networks:+ - network+######### Testing stuff below ############db-test:diff --git a/docs/api/apiv3/endpoints/principals.apib b/docs/api/apiv3/endpoints/principals.apibindex 49efd6a705d..23bf1c1cb84 100644--- a/docs/api/apiv3/endpoints/principals.apib+++ b/docs/api/apiv3/endpoints/principals.apib@@ -147,6 +147,8 @@ List all principals. The client can choose to filter the principals similar to hCurrently supported filters are:+ type: filters principals by their type (*User*, *Group*, *PlaceholderUser*).+ member: filters principals by the projects they are members in.+ + name: filters principals by the user or group name.+ + status: filters principals by their status number (active = *1*, registered = *2*, locked = *3*, invited = *4*)+ Response 200 (application/hal+json)diff --git a/frontend/src/app/angular4-modules.ts b/frontend/src/app/angular4-modules.tsindex a6a74745179..e4aa7c0b125 100644--- a/frontend/src/app/angular4-modules.ts+++ b/frontend/src/app/angular4-modules.ts@@ -34,8 +34,6 @@ import {OpContextMenuTrigger} from 'core-components/op-context-menu/handlers/op-import {States} from 'core-components/states.service';import {PaginationService} from 'core-components/table-pagination/pagination-service';import {MainMenuResizerComponent} from 'core-components/resizer/main-menu-resizer.component';-import {ExternalQueryConfigurationService} from 'core-components/wp-table/external-configuration/external-query-configuration.service';-import {ExternalRelationQueryConfigurationService} from 'core-components/wp-table/external-configuration/external-relation-query-configuration.service';import {ConfirmDialogModal} from "core-components/modals/confirm-dialog/confirm-dialog.modal";import {ConfirmDialogService} from "core-components/modals/confirm-dialog/confirm-dialog.service";import {DynamicContentModal} from "core-components/modals/modal-wrapper/dynamic-content.modal";@@ -76,7 +74,10 @@ import {globalDynamicComponents} from "core-app/global-dynamic-components.const"import {OpenprojectMembersModule} from "core-app/modules/members/members.module";import {OpenprojectEnterpriseModule} from "core-components/enterprise/openproject-enterprise.module";import {OpenprojectAugmentingModule} from "core-app/modules/augmenting/openproject-augmenting.module";+import {OpenprojectInviteUserModalModule} from "core-app/modules/invite-user-modal/invite-user-modal.module";+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";import {RevitAddInSettingsButtonService} from "core-app/modules/bim/revit_add_in/revit-add-in-settings-button.service";+import {OpenprojectAutocompleterModule} from "core-app/modules/autocompleter/openproject-autocompleter.module";@NgModule({imports: [@@ -138,6 +139,15 @@ import {RevitAddInSettingsButtonService} from "core-app/modules/bim/revit_add_in// Augmenting ModuleOpenprojectAugmentingModule,++ // Modals+ OpenprojectModalModule,++ // Invite user modal+ OpenprojectInviteUserModalModule,++ // Autocompleters+ OpenprojectAutocompleterModule,],providers: [{ provide: States, useValue: new States() },diff --git a/frontend/src/app/components/datepicker/datepicker.modal.html b/frontend/src/app/components/datepicker/datepicker.modal.htmlindex 7bf8d8253c6..2a1f01e7260 100644--- a/frontend/src/app/components/datepicker/datepicker.modal.html+++ b/frontend/src/app/components/datepicker/datepicker.modal.html@@ -1,146 +1,145 @@-<div class="op-modal--portal -transparent">- <div #modalContainer- class="op-modal--modal-container datepicker-modal loading-indicator--location"- [attr.id]="htmlId"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-body">- <form class="form -vertical">- <div class="datepicker-modal--dates-container">- <ng-container *ngIf="singleDate">- <div class="form--field">- <label class="form--label"- [textContent]="text.date">- </label>- <div class="form--field-container">- <div class="form--text-field-container -xslim">- <input type="text"- name="date"- class="form--date-field"- [ngClass]="{'-current' : datepickerHelper.isStateOfCurrentActivatedField('date')}"- [ngModel]="dates.date"- (ngModelChange)="updateDate('date', $event)"- (click)="datepickerHelper.setCurrentActivatedField('date')">- </div>- <a class="form--field-inline-action"- [title]="text.clear"- (click)="clear('date')">- <span class="icon2 icon-small icon-cancel"></span>- </a>- </div>- <div class="form--field-extra-actions">- <a (click)="setToday('date')"- [textContent]="text.today">- </a>- </div>+<form+ class="op-modal datepicker-modal loading-indicator--location"+ [attr.id]="htmlId"+ #modalContainer+ data-indicator-name="modal"+ (submit)="save($event)"+>+ <div class="op-modal--body form -vertical">+ <div class="datepicker-modal--dates-container">+ <ng-container *ngIf="singleDate">+ <div class="form--field">+ <label class="form--label"+ [textContent]="text.date">+ </label>+ <div class="form--field-container">+ <div class="form--text-field-container -xslim">+ <input type="text"+ name="date"+ class="form--date-field"+ [ngClass]="{'-current' : datepickerHelper.isStateOfCurrentActivatedField('date')}"+ [ngModel]="dates.date"+ (ngModelChange)="updateDate('date', $event)"+ (click)="datepickerHelper.setCurrentActivatedField('date')"></div>- </ng-container>+ <a class="form--field-inline-action"+ [title]="text.clear"+ (click)="clear('date')">+ <span class="icon2 icon-small icon-cancel"></span>+ </a>+ </div>+ <div class="form--field-extra-actions">+ <a (click)="setToday('date')"+ [textContent]="text.today">+ </a>+ </div>+ </div>+ </ng-container>- <ng-container *ngIf="!singleDate">- <div class="form--field">- <label class="form--label"- [textContent]="text.startDate">- </label>- <div class="form--field-container">- <div class="form--text-field-container -xslim">- <input type="text"- name="startDate"- class="form--date-field"- [ngClass]="{'-current' : datepickerHelper.isStateOfCurrentActivatedField('start')}"- [ngModel]="dates.start"- (ngModelChange)="updateDate('start', $event)"- [disabled]="!isSchedulable"- (click)="setCurrentActivatedField('start')">- </div>- <a class="form--field-inline-action"- *ngIf="isSchedulable"- [title]="text.clear"- (click)="clear('start')">- <span class="icon2 icon-small icon-cancel"></span>- </a>- </div>- <div class="form--field-extra-actions">- <a *ngIf="showTodayLink('start')"- (click)="setToday('start')"- [textContent]="text.today">- </a>- </div>- </div>- <div class="form--field">- <label class="form--label"- [textContent]="text.endDate">- </label>- <div class="form--field-container">- <div class="form--text-field-container -xslim">- <input type="text"- name="endDate"- class="form--date-field"- [ngClass]="{'-current' : datepickerHelper.isStateOfCurrentActivatedField('end')}"- [ngModel]="dates.end"- (ngModelChange)="updateDate('end', $event)"- [disabled]="!isSchedulable"- (click)="setCurrentActivatedField('end')">- </div>- <a class="form--field-inline-action"- *ngIf="isSchedulable"- [title]="text.clear"- (click)="clear('end')">- <span class="icon2 icon-small icon-cancel"></span>- </a>- </div>- <div class="form--field-extra-actions">- <a *ngIf="showTodayLink('end')"- (click)="setToday('end')"- [textContent]="text.today">- </a>- </div>- </div>- </ng-container>- <div class="form--field datepicker-modal--scheduling-action-container">- <div class="form--field-container">- <label class="form--label-with-check-box">- <div class="form--check-box-container">- <input type="checkbox"- name="scheduling"- class="form--check-box datepicker-modal--scheduling-action"- [ngModel]="scheduleManually"- (ngModelChange)="changeSchedulingMode()">- </div>- {{ text.manualScheduling }}- </label>+ <ng-container *ngIf="!singleDate">+ <div class="form--field">+ <label class="form--label"+ [textContent]="text.startDate">+ </label>+ <div class="form--field-container">+ <div class="form--text-field-container -xslim">+ <input type="text"+ name="startDate"+ class="form--date-field"+ [ngClass]="{'-current' : datepickerHelper.isStateOfCurrentActivatedField('start')}"+ [ngModel]="dates.start"+ (ngModelChange)="updateDate('start', $event)"+ [disabled]="!isSchedulable"+ (click)="setCurrentActivatedField('start')"></div>+ <a class="form--field-inline-action"+ *ngIf="isSchedulable"+ [title]="text.clear"+ (click)="clear('start')">+ <span class="icon2 icon-small icon-cancel"></span>+ </a>+ </div>+ <div class="form--field-extra-actions">+ <a *ngIf="showTodayLink('start')"+ (click)="setToday('start')"+ [textContent]="text.today">+ </a></div></div>- </form>-- <ng-container *ngIf="!isSchedulable">- <div class="notification-box -info">- <div class="notification-box--content">- <ng-container *ngIf="isParent">- <p [textContent]="text.isParent"></p>- </ng-container>- <ng-container *ngIf="isSwitchedFromManualToAutomatic && !isParent">- <p [textContent]="text.isSwitchedFromManualToAutomatic"></p>- </ng-container>+ <div class="form--field">+ <label class="form--label"+ [textContent]="text.endDate">+ </label>+ <div class="form--field-container">+ <div class="form--text-field-container -xslim">+ <input type="text"+ name="endDate"+ class="form--date-field"+ [ngClass]="{'-current' : datepickerHelper.isStateOfCurrentActivatedField('end')}"+ [ngModel]="dates.end"+ (ngModelChange)="updateDate('end', $event)"+ [disabled]="!isSchedulable"+ (click)="setCurrentActivatedField('end')">+ </div>+ <a class="form--field-inline-action"+ *ngIf="isSchedulable"+ [title]="text.clear"+ (click)="clear('end')">+ <span class="icon2 icon-small icon-cancel"></span>+ </a>+ </div>+ <div class="form--field-extra-actions">+ <a *ngIf="showTodayLink('end')"+ (click)="setToday('end')"+ [textContent]="text.today">+ </a></div></div></ng-container>- <ng-container *ngIf="isSchedulable">- <input id="flatpickr-input"- hidden>- </ng-container>+ <div class="form--field datepicker-modal--scheduling-action-container">+ <div class="form--field-container">+ <label class="form--label-with-check-box">+ <div class="form--check-box-container">+ <input type="checkbox"+ name="scheduling"+ class="form--check-box datepicker-modal--scheduling-action"+ [ngModel]="scheduleManually"+ (ngModelChange)="changeSchedulingMode()">+ </div>+ {{ text.manualScheduling }}+ </label>+ </div>+ </div>+ </div>+ </div>- <div class="datepicker-modal--actions-container">- <button (click)="cancel()"- class="datepicker-modal--action button"- [textContent]="text.cancel">- </button>- <button (click)="save()"- [attr.disabled]="!this.isSavable || undefined"- class="datepicker-modal--action button -highlight"- [textContent]="text.save">- </button>+ <ng-container *ngIf="!isSchedulable">+ <div class="notification-box -info">+ <div class="notification-box--content">+ <ng-container *ngIf="isParent">+ <p [textContent]="text.isParent"></p>+ </ng-container>+ <ng-container *ngIf="isSwitchedFromManualToAutomatic && !isParent">+ <p [textContent]="text.isSwitchedFromManualToAutomatic"></p>+ </ng-container></div></div>+ </ng-container>+ <ng-container *ngIf="isSchedulable">+ <input id="flatpickr-input"+ hidden>+ </ng-container>++ <div class="op-modal--footer">+ <button+ (click)="cancel()"+ class="datepicker-modal--action button"+ [textContent]="text.cancel"+ ></button>+ <button+ [attr.disabled]="!this.isSavable || undefined"+ class="datepicker-modal--action button -highlight"+ [textContent]="text.save"+ ></button></div>-</div>+</form>diff --git a/frontend/src/app/components/datepicker/datepicker.modal.ts b/frontend/src/app/components/datepicker/datepicker.modal.tsindex bc04ef63e3f..db2f161787f 100644--- a/frontend/src/app/components/datepicker/datepicker.modal.ts+++ b/frontend/src/app/components/datepicker/datepicker.modal.ts@@ -37,11 +37,11 @@ import {Injector, ViewChild,ViewEncapsulation} from "@angular/core";-import {OpModalComponent} from "core-components/op-modals/op-modal.component";import {InjectField} from "core-app/helpers/angular/inject-field.decorator";import {I18nService} from "core-app/modules/common/i18n/i18n.service";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {TimezoneService} from "core-components/datetime/timezone.service";import {DatePicker} from "core-app/modules/common/op-date-picker/datepicker";import {HalResourceEditingService} from "core-app/modules/fields/edit/services/hal-resource-editing.service";@@ -139,7 +139,8 @@ export class DatePickerModal extends OpModalComponent implements AfterViewInit {}}- save():void {+ save($event:Event):void {+ $event.preventDefault();if (!this.isSavable) {return;}diff --git a/frontend/src/app/components/enterprise/enterprise-base.component.ts b/frontend/src/app/components/enterprise/enterprise-base.component.tsindex 4b1ce2fde04..a2fc03a381d 100644--- a/frontend/src/app/components/enterprise/enterprise-base.component.ts+++ b/frontend/src/app/components/enterprise/enterprise-base.component.ts@@ -29,7 +29,7 @@import {Component, Injector} from "@angular/core";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {EnterpriseTrialModal} from "core-components/enterprise/enterprise-modal/enterprise-trial.modal";-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {EnterpriseTrialService} from "core-components/enterprise/enterprise-trial.service";export const enterpriseBaseSelector = 'enterprise-base';diff --git a/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.html b/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.htmlindex 91cfa6c4c16..a9603341bd2 100644--- a/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.html+++ b/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.html@@ -1,73 +1,62 @@-<div class="op-modal--portal">- <div class="op-modal--modal-container"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <h3 [textContent]="headerText()"></h3>- <a *ngIf="showClose" class="op-modal--modal-close-button">- <i class="icon-close" (click)="closeModal($event)" [attr.title]="text.close_popup">- </i>- </a>- </div>+<div class="op-modal">+ <op-modal-header (close)="closeMe($event)">{{headerText()}}</op-modal-header>- <div [ngSwitch]="openWindow()" class="op-modal--modal-body">- <!-- first modal window -->- <div *ngSwitchCase="1">- <enterprise-trial-form></enterprise-trial-form>- </div>- <!-- second modal window -->- <div *ngSwitchCase="2">- <enterprise-trial-waiting></enterprise-trial-waiting>- </div>- <!-- third modal window -->- <div *ngSwitchCase="3">- <div class="onboarding--video-block">- <div class="onboarding--video-text">- <span>{{ text.quick_overview }}</span>- </div>- <div class="onboarding--video iframe-target-wrapper">- <iframe frameborder="0"- height="400"- width="100%"- [src]="trustedEEVideoURL"- allowfullscreen>- </iframe>- </div>+ <div [ngSwitch]="openWindow()" class="op-modal--modal-body">+ <!-- first modal window -->+ <div *ngSwitchCase="1">+ <enterprise-trial-form></enterprise-trial-form>+ </div>+ <!-- second modal window -->+ <div *ngSwitchCase="2">+ <enterprise-trial-waiting></enterprise-trial-waiting>+ </div>+ <!-- third modal window -->+ <div *ngSwitchCase="3">+ <div class="onboarding--video-block">+ <div class="onboarding--video-text">+ <span>{{ text.quick_overview }}</span>+ </div>+ <div class="onboarding--video iframe-target-wrapper">+ <iframe frameborder="0"+ height="400"+ width="100%"+ [src]="trustedEEVideoURL"+ allowfullscreen>+ </iframe></div></div></div>+ </div>- <div class="op-modal--modal-footer">- <div *ngIf="!eeTrialService.status || eeTrialService.cancelled; else mailSubmitted">- <button class="confirm-form-submit--continue button -highlight"- (click)="onSubmit()"- [disabled]="!trialForm || trialForm.invalid"- [textContent]="text.button_submit"- [attr.title]="text.button_submit"- [hidden]="eeTrialService.mailSubmitted && !eeTrialService.cancelled">- </button>- <button class="confirm-form-submit--cancel button"- (click)="closeModal($event)"- [textContent]="text.button_cancel"- [attr.title]="text.button_cancel">- </button>- </div>- <ng-template #mailSubmitted>- <button class="confirm-form-submit--continue button -highlight"- (click)="startEnterpriseTrial()"- [textContent]="text.button_continue"- [attr.title]="text.button_continue"- [disabled]="!eeTrialService.confirmed"- [hidden]="eeTrialService.trialStarted">- </button>- <button *ngIf="eeTrialService.trialStarted"- class="confirm-form-submit--continue button -highlight"- (click)="closeModal($event)"- [textContent]="text.button_continue"- [attr.title]="text.button_continue">- </button>- </ng-template>+ <div class="op-modal--footer">+ <div *ngIf="!eeTrialService.status || eeTrialService.cancelled; else mailSubmitted">+ <button class="confirm-form-submit--continue button -highlight"+ (click)="onSubmit()"+ [disabled]="!trialForm || trialForm.invalid"+ [textContent]="text.button_submit"+ [attr.title]="text.button_submit"+ [hidden]="eeTrialService.mailSubmitted && !eeTrialService.cancelled">+ </button>+ <button class="confirm-form-submit--cancel button"+ (click)="closeModal($event)"+ [textContent]="text.button_cancel"+ [attr.title]="text.button_cancel">+ </button></div>-+ <ng-template #mailSubmitted>+ <button class="confirm-form-submit--continue button -highlight"+ (click)="startEnterpriseTrial()"+ [textContent]="text.button_continue"+ [attr.title]="text.button_continue"+ [disabled]="!eeTrialService.confirmed"+ [hidden]="eeTrialService.trialStarted">+ </button>+ <button *ngIf="eeTrialService.trialStarted"+ class="confirm-form-submit--continue button -highlight"+ (click)="closeModal($event)"+ [textContent]="text.button_continue"+ [attr.title]="text.button_continue">+ </button>+ </ng-template></div></div>\ No newline at end of filediff --git a/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.ts b/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.tsindex 274e4f11075..a5c2a47fab6 100644--- a/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.ts+++ b/frontend/src/app/components/enterprise/enterprise-modal/enterprise-trial.modal.ts@@ -29,9 +29,9 @@import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, Inject, Input, ViewChild} from "@angular/core";import {DomSanitizer, SafeResourceUrl} from "@angular/platform-browser";import {FormControl, FormGroup} from "@angular/forms";-import {OpModalComponent} from "app/components/op-modals/op-modal.component";-import {OpModalLocalsToken} from "app/components/op-modals/op-modal.service";-import {OpModalLocalsMap} from "app/components/op-modals/op-modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";import {I18nService} from "app/modules/common/i18n/i18n.service";import {EETrialFormComponent} from "core-components/enterprise/enterprise-modal/enterprise-trial-form/ee-trial-form.component";import {EnterpriseTrialService} from "core-components/enterprise/enterprise-trial.service";diff --git a/frontend/src/app/components/enterprise/openproject-enterprise.module.ts b/frontend/src/app/components/enterprise/openproject-enterprise.module.tsindex 3ea530090e5..bb3a2ac2fba 100644--- a/frontend/src/app/components/enterprise/openproject-enterprise.module.ts+++ b/frontend/src/app/components/enterprise/openproject-enterprise.module.ts@@ -28,6 +28,7 @@import {NgModule} from '@angular/core';import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module";+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";import {EnterpriseTrialService} from "core-components/enterprise/enterprise-trial.service";import {EnterpriseBaseComponent} from "core-components/enterprise/enterprise-base.component";import {EnterpriseTrialModal} from "core-components/enterprise/enterprise-modal/enterprise-trial.modal";@@ -40,8 +41,9 @@ import {FormsModule, ReactiveFormsModule} from "@angular/forms";@NgModule({imports: [OpenprojectCommonModule,+ OpenprojectModalModule,FormsModule,- ReactiveFormsModule+ ReactiveFormsModule,],providers: [EnterpriseTrialServicediff --git a/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.modal.html b/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.modal.htmlindex ddb87a346f1..2e36faeca35 100644--- a/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.modal.html+++ b/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.modal.html@@ -1,43 +1,30 @@-<div class="op-modal--portal confirm-form-submit--modal ngdialog-theme-openproject">- <div class="op-modal--modal-container confirm-dialog--modal loading-indicator--location"- [ngClass]="{'-highlight -danger-zone' : dangerHighlighting }"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <a class="op-modal--modal-close-button" *ngIf="showClose">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.close_popup">- </i>- </a>- <h3 class="icon-context icon-attention" [textContent]="text.title"></h3>- </div>+<div+ class="op-modal confirm-form-submit--modal loading-indicator--location"+ [ngClass]="{'-highlight -danger-zone' : dangerHighlighting }"+ data-indicator-name="modal"+>+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <div class="ngdialog-body op-modal--modal-body">- <p>- <span [textContent]="text.text"></span>+ <div class="op-modal--modal-body">+ <p>+ <span [textContent]="text.text"></span>+ <br/>+ <span *ngFor="let data of passedData"><br/>- <span *ngFor="let data of passedData">- <br/>- <strong>{{data}}</strong>- </span>- </p>- </div>-- <div class="op-modal--modal-footer">- <button class="confirm-form-submit--continue button"- [ngClass]="dangerHighlighting ? '-danger': '-highlight'"- (click)="confirmAndClose($event)"- [textContent]="text.button_continue"- [attr.title]="text.button_continue">- </button>- <button class="confirm-form-submit--cancel button"- (click)="closeMe($event)"- [textContent]="text.button_cancel"- [attr.title]="text.button_cancel">- </button>+ <strong>{{data}}</strong>+ </span>+ </p>+ </div>- </div>+ <div class="op-modal--footer">+ <button class="confirm-form-submit--continue button"+ [ngClass]="dangerHighlighting ? '-danger': '-highlight'"+ (click)="confirmAndClose($event)"+ [textContent]="text.button_continue"+ ></button>+ <button class="confirm-form-submit--cancel button"+ (click)="closeMe($event)"+ [textContent]="text.button_cancel"+ ></button></div></div>diff --git a/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.modal.ts b/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.modal.tsindex 9e4f3076a97..36a1f446bd0 100644--- a/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.modal.ts+++ b/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.modal.ts@@ -26,10 +26,10 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpModalComponent} from "core-components/op-modals/op-modal.component";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {ChangeDetectorRef, Component, ElementRef, Inject} from "@angular/core";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";import {I18nService} from "core-app/modules/common/i18n/i18n.service";export interface ConfirmDialogOptions {diff --git a/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.service.ts b/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.service.tsindex 072e8a0b53f..d0544adbf38 100644--- a/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.service.ts+++ b/frontend/src/app/components/modals/confirm-dialog/confirm-dialog.service.ts@@ -27,7 +27,7 @@//++import {ConfirmDialogModal, ConfirmDialogOptions} from "core-components/modals/confirm-dialog/confirm-dialog.modal";-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {Injectable, Injector} from "@angular/core";@Injectable()diff --git a/frontend/src/app/components/modals/editor/editor-macros.service.ts b/frontend/src/app/components/modals/editor/editor-macros.service.tsindex 33bc4545402..3d1c79b1565 100644--- a/frontend/src/app/components/modals/editor/editor-macros.service.ts+++ b/frontend/src/app/components/modals/editor/editor-macros.service.ts@@ -26,7 +26,7 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {Injectable, Injector} from "@angular/core";import {WpButtonMacroModal} from "core-components/modals/editor/macro-wp-button-modal/wp-button-macro.modal";import {WikiIncludePageMacroModal} from "core-components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal";diff --git a/frontend/src/app/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.html b/frontend/src/app/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.htmlindex c9e3b154415..687dfdb53c6 100644--- a/frontend/src/app/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.html+++ b/frontend/src/app/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.html@@ -1,76 +1,64 @@-<div class="op-modal--portal op-modal--macro-modal ngdialog-theme-openproject">- <div class="op-modal--modal-container" tabindex="1">- <div class="op-modal--modal-header">- <a class="op-modal--modal-close-button" *ngIf="showClose">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.close_popup">- </i>- </a>- <h3 class="icon-context icon-attention" [textContent]="text.title"></h3>- </div>+<form+ class="op-modal "+ (submit)="applyAndClose($event)"+>+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <div class="ngdialog-body op-modal--modal-body">- <form class="form -vertical" (submit)="applyAndClose($event)">- <fieldset class="form--fieldset">- <legend [textContent]="text.page"></legend>- <div class="form--field">- <label- for="selected-page"- [textContent]="text.page"- class="form--label hidden-for-sighted">- </label>- <div class="form--field-container">- <div class="form--select-container">- <input- #selectedPageInput- tabindex="2"- type="text"- id="selected-page"- name="selected-page"- [value]="selectedPage"- (change)="selectedPage = $event.target.value"- class="form--select"- placeholder="my-project:my-page" />- </div>- </div>+ <div class="op-modal--body form">+ <fieldset class="form--fieldset">+ <legend [textContent]="text.page"></legend>+ <div class="form--field">+ <label+ for="selected-page"+ [textContent]="text.page"+ class="form--label hidden-for-sighted">+ </label>+ <div class="form--field-container">+ <div class="form--select-container">+ <input+ #selectedPageInput+ tabindex="2"+ type="text"+ id="selected-page"+ name="selected-page"+ [value]="selectedPage"+ (change)="selectedPage = $event.target.value"+ class="form--select"+ placeholder="my-project:my-page" /></div>- <div class="form--field">- <div class="form--field-container">- <label class="form--label-with-check-box">- <div class="form--check-box-container">- <input- #parentIncludedInput- tabindex="3"- type="checkbox"- id="include-parent"- name="include-parent"- [ngModel]="selectedIncludeParent"- (ngModelChange)="updateIncludeParent($event)"- class="form--check-box" />- </div>- {{ text.include_parent }}- </label>+ </div>+ </div>+ <div class="form--field">+ <div class="form--field-container">+ <label class="form--label-with-check-box">+ <div class="form--check-box-container">+ <input+ #parentIncludedInput+ tabindex="3"+ type="checkbox"+ id="include-parent"+ name="include-parent"+ [ngModel]="selectedIncludeParent"+ (ngModelChange)="updateIncludeParent($event)"+ class="form--check-box" /></div>- </div>- <p [textContent]="text.hint"></p>- </fieldset>- </form>- </div>- <div class="op-modal--modal-footer">- <button class="op-modal--cancel-button button"- (click)="closeMe($event)"- tabindex="4"- [textContent]="text.button_cancel"- [attr.title]="text.button_cancel">- </button>- <button class="op-modal--submit-button button -highlight"- (click)="applyAndClose($event)"- tabindex="3"- [textContent]="text.button_save"- [attr.title]="text.button_save">- </button>- </div>+ {{ text.include_parent }}+ </label>+ </div>+ </div>+ <p [textContent]="text.hint"></p>+ </fieldset>+ </div>+ <div class="op-modal--footer">+ <button class="op-modal--cancel-button button"+ (click)="closeMe($event)"+ type="button"+ tabindex="4"+ [textContent]="text.button_cancel"+ ></button>+ <button class="op-modal--submit-button button -highlight"+ tabindex="3"+ [textContent]="text.button_save"+ ></button></div>-</div>+</form>diff --git a/frontend/src/app/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.ts b/frontend/src/app/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.tsindex 2ccce2f972a..1e2b4f987e1 100644--- a/frontend/src/app/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.ts+++ b/frontend/src/app/components/modals/editor/macro-child-pages-modal/child-pages-macro.modal.ts@@ -26,10 +26,10 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpModalComponent} from "core-components/op-modals/op-modal.component";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, Inject, ViewChild} from "@angular/core";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";import {I18nService} from "core-app/modules/common/i18n/i18n.service";@Component({diff --git a/frontend/src/app/components/modals/editor/macro-code-block-modal/code-block-macro.modal.html b/frontend/src/app/components/modals/editor/macro-code-block-modal/code-block-macro.modal.htmlindex 004c7612309..c9cd6de7f09 100644--- a/frontend/src/app/components/modals/editor/macro-code-block-modal/code-block-macro.modal.html+++ b/frontend/src/app/components/modals/editor/macro-code-block-modal/code-block-macro.modal.html@@ -1,59 +1,48 @@-<div class="op-modal--portal op-modal--macro-modal ngdialog-theme-openproject">- <div class="op-modal--modal-container -wide" tabindex="1">- <div class="op-modal--modal-header">- <a class="op-modal--modal-close-button" *ngIf="showClose">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.close_popup">- </i>- </a>- <h3 class="icon-context icon-attention" [textContent]="text.title"></h3>- </div>+<form+ class="op-modal "+ (submit)="applyAndClose($event)"+>+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <div class="ngdialog-body op-modal--modal-body">- <form class="form -vertical">- <textarea name="codemirror-element"- id="codemirror-element"- [ngModel]="content"- #codeMirrorPane></textarea>- <hr/>- <div class="form--field">- <label- for="selected-language"- [textContent]="text.language"- class="form--label hidden-for-sighted">- </label>- <div class="form--field-container">- <div class="form--select-container">- <input- #selectedLanguage- tabindex="2"- type="text"- id="selected-language"- name="selected-language"- [ngModel]="language"- (ngModelChange)="updateLanguage($event)"- class="form--select" />- </div>- </div>- <p [textContent]="text.language_hint"></p>+ <div class="op-modal--body">+ <textarea name="codemirror-element"+ id="codemirror-element"+ [ngModel]="content"+ #codeMirrorPane></textarea>+ <hr/>+ <div class="form--field">+ <label+ for="selected-language"+ [textContent]="text.language"+ class="form--label hidden-for-sighted">+ </label>+ <div class="form--field-container">+ <div class="form--select-container">+ <input+ #selectedLanguage+ tabindex="2"+ type="text"+ id="selected-language"+ name="selected-language"+ [ngModel]="language"+ (ngModelChange)="updateLanguage($event)"+ class="form--select" /></div>- </form>- </div>- <div class="op-modal--modal-footer">- <button class="op-modal--cancel-button button"- (click)="closeMe($event)"- tabindex="4"- [textContent]="text.button_cancel"- [attr.title]="text.button_cancel">- </button>- <button class="op-modal--submit-button button -highlight"- (click)="applyAndClose($event)"- tabindex="3"- [textContent]="text.button_save"- [attr.title]="text.button_save">- </button>+ </div>+ <p [textContent]="text.language_hint"></p></div></div>-</div>++ <div class="op-modal--footer">+ <button class="op-modal--cancel-button button"+ (click)="closeMe($event)"+ tabindex="4"+ type="button"+ [textContent]="text.button_cancel"+ ></button>+ <button class="op-modal--submit-button button -highlight"+ tabindex="3"+ [textContent]="text.button_save"+ ></button>+ </div>+</form>diff --git a/frontend/src/app/components/modals/editor/macro-code-block-modal/code-block-macro.modal.ts b/frontend/src/app/components/modals/editor/macro-code-block-modal/code-block-macro.modal.tsindex 383f82e0c31..e29b0a1237c 100644--- a/frontend/src/app/components/modals/editor/macro-code-block-modal/code-block-macro.modal.ts+++ b/frontend/src/app/components/modals/editor/macro-code-block-modal/code-block-macro.modal.ts@@ -26,10 +26,10 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpModalComponent} from "core-components/op-modals/op-modal.component";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, Inject, ViewChild} from "@angular/core";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {I18nService} from "core-app/modules/common/i18n/i18n.service";@Component({diff --git a/frontend/src/app/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.html b/frontend/src/app/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.htmlindex 45576075d7e..1b8ef045f3e 100644--- a/frontend/src/app/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.html+++ b/frontend/src/app/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.html@@ -1,58 +1,48 @@-<div class="op-modal--portal op-modal--macro-modal ngdialog-theme-openproject">- <div class="op-modal--modal-container" tabindex="1">- <div class="op-modal--modal-header">- <a class="op-modal--modal-close-button" *ngIf="showClose">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.close_popup">- </i>- </a>- <h3 class="icon-context icon-attention" [textContent]="text.title"></h3>- </div>+<form+ class="op-modal"+ (submit)="applyAndClose($event)"+>+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <div class="ngdialog-body op-modal--modal-body">- <form class="form -vertical" (submit)="applyAndClose($event)">- <fieldset class="form--fieldset">- <legend [textContent]="text.page"></legend>- <div class="form--field">- <label- for="selected-page"- [textContent]="text.page"- class="form--label hidden-for-sighted">- </label>- <div class="form--field-container">- <div class="form--select-container">- <input- #selectedPageInput- tabindex="2"- type="text"- id="selected-page"- name="selected-page"- [value]="selectedPage"- (change)="selectedPage = $event.target.value"- class="form--select" />- </div>- </div>- <p [textContent]="text.hint"></p>- <p><kbd>project-identifier:my-wiki-page</kbd></p>+ <div class="op-modal--body">+ <fieldset class="form--fieldset">+ <legend [textContent]="text.page"></legend>+ <div class="form--field">+ <label+ for="selected-page"+ [textContent]="text.page"+ class="form--label hidden-for-sighted">+ </label>+ <div class="form--field-container">+ <div class="form--select-container">+ <input+ #selectedPageInput+ tabindex="2"+ type="text"+ id="selected-page"+ name="selected-page"+ [value]="selectedPage"+ (change)="selectedPage = $event.target.value"+ class="form--select" /></div>- </fieldset>- </form>- </div>- <div class="op-modal--modal-footer">- <button class="op-modal--cancel-button button"- (click)="closeMe($event)"- tabindex="4"- [textContent]="text.button_cancel"- [attr.title]="text.button_cancel">- </button>- <button class="op-modal--submit-button button -highlight"- (click)="applyAndClose($event)"- tabindex="3"- [textContent]="text.button_save"- [attr.title]="text.button_save">- </button>- </div>+ </div>+ <p [textContent]="text.hint"></p>+ <p><kbd>project-identifier:my-wiki-page</kbd></p>+ </div>+ </fieldset>+ </div>+ <div class="op-modal--footer">+ <button class="op-modal--cancel-button button"+ (click)="closeMe($event)"+ tabindex="4"+ [textContent]="text.button_cancel"+ [attr.title]="text.button_cancel">+ </button>+ <button class="op-modal--submit-button button -highlight"+ (click)="applyAndClose($event)"+ tabindex="3"+ [textContent]="text.button_save"+ [attr.title]="text.button_save">+ </button></div>-</div>+</form>diff --git a/frontend/src/app/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.ts b/frontend/src/app/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.tsindex 8103415d0b9..5d5cdd34294 100644--- a/frontend/src/app/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.ts+++ b/frontend/src/app/components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal.ts@@ -26,10 +26,10 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpModalComponent} from "core-components/op-modals/op-modal.component";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, Inject, ViewChild} from "@angular/core";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";import {I18nService} from "core-app/modules/common/i18n/i18n.service";@Component({diff --git a/frontend/src/app/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.html b/frontend/src/app/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.htmlindex 5f7403789df..f284f7e974d 100644--- a/frontend/src/app/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.html+++ b/frontend/src/app/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.html@@ -1,81 +1,69 @@-<div class="op-modal--portal op-modal--macro-modal ngdialog-theme-openproject">- <div class="op-modal--modal-container loading-indicator--location"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <a class="op-modal--modal-close-button" *ngIf="showClose">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.close_popup">- </i>- </a>- <h3 class="icon-context icon-attention" [textContent]="text.title"></h3>- </div>+<form+ class="op-modal loading-indicator--location"+ (submit)="applyAndClose($event)"+ data-indicator-name="modal"+>+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <div class="ngdialog-body op-modal--modal-body">- <form class="form -vertical" (submit)="applyAndClose($event)">- <fieldset class="form--fieldset">- <legend [textContent]="text.selected_type"></legend>- <div class="form--field">- <label- for="selected-type"- [textContent]="text.selected_type"- class="form--label hidden-for-sighted">- </label>- <div class="form--field-container">- <div class="form--select-container">- <select- #typeSelect- id="selected-type"- tabindex="1"- name="selected-type"- (change)="selectedType = $event.target.value"- class="form--select">- <option [textContent]="text.none"- [selected]="!selectedType"- [value]=""></option>- <option *ngFor="let type of availableTypes"- [textContent]="type.name"- [selected]="selectedType === type.name"- [value]="type.name"></option>- </select>- </div>- </div>+ <div class="op-modal--modal-body form">+ <fieldset class="form--fieldset">+ <legend [textContent]="text.selected_type"></legend>+ <div class="form--field">+ <label+ for="selected-type"+ [textContent]="text.selected_type"+ class="form--label hidden-for-sighted">+ </label>+ <div class="form--field-container">+ <div class="form--select-container">+ <select+ #typeSelect+ id="selected-type"+ tabindex="1"+ name="selected-type"+ (change)="selectedType = $event.target.value"+ class="form--select">+ <option [textContent]="text.none"+ [selected]="!selectedType"+ [value]=""></option>+ <option *ngFor="let type of availableTypes"+ [textContent]="type.name"+ [selected]="selectedType === type.name"+ [value]="type.name"></option>+ </select></div>- </fieldset>+ </div>+ </div>+ </fieldset>- <div class="form--field -wide-label">- <div class="form--field-container -vertical">- <label class="form--label-with-check-box">- <div class="form--check-box-container">- <input type="checkbox"- tabindex="2"- id="wp_button_macro_style"- (change)="buttonStyle = $event.target.checked"- [checked]="buttonStyle"- name="button_style" />- </div>- {{ text.button_style }}- </label>+ <div class="form--field -wide-label">+ <div class="form--field-container -vertical">+ <label class="form--label-with-check-box">+ <div class="form--check-box-container">+ <input type="checkbox"+ tabindex="2"+ id="wp_button_macro_style"+ (change)="buttonStyle = $event.target.checked"+ [checked]="buttonStyle"+ name="button_style" /></div>- </div>- <p [textContent]="text.button_style_hint"></p>- </form>- </div>- <div class="op-modal--modal-footer">- <button class="op-modal--cancel-button button"- (click)="closeMe($event)"- tabindex="4"- [textContent]="text.button_cancel"- [attr.title]="text.button_cancel">- </button>- <button class="op-modal--submit-button button -highlight"- (click)="applyAndClose($event)"- tabindex="3"- [textContent]="text.button_save"- [attr.title]="text.button_save">- </button>+ {{ text.button_style }}+ </label>+ </div></div>+ <p [textContent]="text.button_style_hint"></p>+ </div>++ <div class="op-modal--footer">+ <button class="op-modal--cancel-button button"+ (click)="closeMe($event)"+ tabindex="4"+ type="button"+ [textContent]="text.button_cancel"+ ></button>+ <button class="op-modal--submit-button button -highlight"+ tabindex="3"+ [textContent]="text.button_save"+ ></button></div>-</div>+</form>diff --git a/frontend/src/app/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.ts b/frontend/src/app/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.tsindex 8cf4de3aa28..81ad09691d6 100644--- a/frontend/src/app/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.ts+++ b/frontend/src/app/components/modals/editor/macro-wp-button-modal/wp-button-macro.modal.ts@@ -26,8 +26,6 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpModalComponent} from "core-components/op-modals/op-modal.component";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {AfterViewInit,ChangeDetectorRef,@@ -36,7 +34,9 @@ import {Inject,ViewChild} from "@angular/core";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {TypeResource} from "core-app/modules/hal/resources/type-resource";import {CurrentProjectService} from "core-components/projects/current-project.service";diff --git a/frontend/src/app/components/modals/export-modal/wp-table-export.modal.html b/frontend/src/app/components/modals/export-modal/wp-table-export.modal.htmlindex a0df58e1a73..f6beb3d1360 100644--- a/frontend/src/app/components/modals/export-modal/wp-table-export.modal.html+++ b/frontend/src/app/components/modals/export-modal/wp-table-export.modal.html@@ -1,25 +1,20 @@-<div class="op-modal--portal ">- <div class="op-modal--modal-container wp-table--configuration-modal"- tabindex="0">- <div class="op-modal--modal-header">- <h3 [textContent]="text.title"></h3>+<div class="op-modal op-modal_wide wp-table--configuration-modal">+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <a class="op-modal--modal-close-button">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.closePopup">- </i>- </a>- </div>-- <ul *ngIf="exportOptions" class="export-options" [ngClass]="{'-hidden': isLoading}">- <li *ngFor="let option of exportOptions">- <a [attr.href]="option.url"- (click)="triggerByLink(option.url, $event)"- id="export-{{ option.identifier }}">+ <div class="op-modal--body">+ <ul *ngIf="exportOptions" class="op-export-options" [ngClass]="{'-hidden': isLoading}">+ <li+ *ngFor="let option of exportOptions"+ class="op-export-options--option"+ >+ <a+ [attr.href]="option.url"+ class="op-export-options--option-link"+ (click)="triggerByLink(option.url, $event)"+ id="export-{{ option.identifier }}"+ ><op-icon icon-classes="icon-export-{{ option.identifier }} icon-big"></op-icon>- <span class="export-label" [textContent]="option.label"></span>+ <span class="op-export-options--option-label" [textContent]="option.label"></span></a></li></ul>diff --git a/frontend/src/app/components/modals/export-modal/wp-table-export.modal.ts b/frontend/src/app/components/modals/export-modal/wp-table-export.modal.tsindex 0df2460b2a1..90a044fec06 100644--- a/frontend/src/app/components/modals/export-modal/wp-table-export.modal.ts+++ b/frontend/src/app/components/modals/export-modal/wp-table-export.modal.ts@@ -1,12 +1,12 @@import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Inject, OnInit} from '@angular/core';-import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';+import {OpModalLocalsMap} from 'core-app/modules/modal/modal.types';+import {OpModalComponent} from 'core-app/modules/modal/modal.component';+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {WorkPackageViewColumnsService} from 'core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-columns.service';-import {OpModalComponent} from 'core-components/op-modals/op-modal.component';import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isolated-query-space";import {WorkPackageCollectionResource} from "core-app/modules/hal/resources/wp-collection-resource";import {HalLink} from "core-app/modules/hal/hal-link/hal-link";import {I18nService} from "core-app/modules/common/i18n/i18n.service";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import * as URI from 'urijs';import {HttpClient, HttpErrorResponse} from '@angular/common/http';import {LoadingIndicatorService} from "core-app/modules/common/loading-indicator/loading-indicator.service";diff --git a/frontend/src/app/components/modals/modal-wrapper/dynamic-content.modal.html b/frontend/src/app/components/modals/modal-wrapper/dynamic-content.modal.htmlindex 386ad9d38ea..8ff25011a30 100644--- a/frontend/src/app/components/modals/modal-wrapper/dynamic-content.modal.html+++ b/frontend/src/app/components/modals/modal-wrapper/dynamic-content.modal.html@@ -1,6 +1,4 @@-<div class="op-modal--portal ">- <div class="op-modal--modal-container dynamic-content-modal--wrapper loading-indicator--location"- data-indicator-name="modal"- tabindex="0">- </div>-</div>+<div+ class="op-modal dynamic-content-modal--wrapper loading-indicator--location"+ data-indicator-name="modal"+></div>diff --git a/frontend/src/app/components/modals/modal-wrapper/dynamic-content.modal.ts b/frontend/src/app/components/modals/modal-wrapper/dynamic-content.modal.tsindex 2a037ec6b0a..69ee38e4a74 100644--- a/frontend/src/app/components/modals/modal-wrapper/dynamic-content.modal.ts+++ b/frontend/src/app/components/modals/modal-wrapper/dynamic-content.modal.ts@@ -27,9 +27,9 @@//++import {ChangeDetectorRef, Component, ElementRef, Inject, OnDestroy, OnInit} from "@angular/core";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";-import {OpModalComponent} from "core-components/op-modals/op-modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";import {I18nService} from "core-app/modules/common/i18n/i18n.service";@Component({@@ -60,9 +60,11 @@ export class DynamicContentModal extends OpModalComponent implements OnInit, OnD.append(this.locals.modalBody);// Register click listeners+ // This registers both on the close button in the modal header, as well as on any+ // other elements you have added the dynamic-content-modal--close-button class.jQuery(document.body).on('click.opdynamicmodal',- '.dynamic-content-modal--close-button',+ '.op-modal--close-button, [dynamic-content-modal-close-button]',(evt:JQuery.TriggeredEvent) => {this.closeMe(evt);});diff --git a/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.html b/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.htmlindex 151d1d46f82..187542734c6 100644--- a/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.html+++ b/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.html@@ -1,6 +1,6 @@<div class="preview-modal--container" wp-isolated-query-space *ngIf="workPackage">- <wp-single-card [workPackage]="workPackage"- orientation="horizontal"- (stateLinkClicked)="openStateLink($event)">- </wp-single-card>+ <wp-single-card [workPackage]="workPackage"+ orientation="horizontal"+ (stateLinkClicked)="openStateLink($event)">+ </wp-single-card></div>diff --git a/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.ts b/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.tsindex eaed8f2780d..fe301a8d55d 100644--- a/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.ts+++ b/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.ts@@ -27,9 +27,9 @@//++import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Inject, OnInit} from "@angular/core";-import {OpModalComponent} from "core-components/op-modals/op-modal.component";-import {OpModalLocalsToken, OpModalService} from "core-components/op-modals/op-modal.service";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken, OpModalService} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {WorkPackageResource} from "core-app/modules/hal/resources/work-package-resource";import {HalResource} from "core-app/modules/hal/resources/hal-resource";diff --git a/frontend/src/app/components/modals/request-for-confirmation/password-confirmation.modal.html b/frontend/src/app/components/modals/request-for-confirmation/password-confirmation.modal.htmlindex 063b51be1ad..28a5b172e1a 100644--- a/frontend/src/app/components/modals/request-for-confirmation/password-confirmation.modal.html+++ b/frontend/src/app/components/modals/request-for-confirmation/password-confirmation.modal.html@@ -1,42 +1,36 @@-<div class="op-modal--portal confirm-form-submit--modal ngdialog-theme-openproject">- <div class="op-modal--modal-container password-confirm-dialog--modal loading-indicator--location"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <h3 class="icon-context icon-locked" [textContent]="text.title"></h3>- </div>+<form+ class="op-modal confirm-form-submit--modal password-confirm-dialog--modal loading-indicator--location"+ data-indicator-name="modal"+ (submit)="confirmAndClose($event)"+>+ <op-modal-header (close)="closeMe($event)">{{text.save_as}}</op-modal-header>- <div class="op-modal--modal-body">- <form class="request-for-confirmation--form form -vertical" (submit)="confirmAndClose($event)">- <div class="form--field -required">- <label class="form--label"- for="request_for_confirmation_password"- [attr.aria-label]="text.field_description"- [textContent]="text.password">- </label>- <div class="form--field-container">- <div class="form--text-field-container">- <input type="password"- #passwordConfirmationField- [(ngModel)]="password_confirmation"- id="request_for_confirmation_password"- name="request_for_confirmation_password"- class="form--text-field">- </div>- </div>- <div class="form--field-instructions" [textContent]="text.field_description"></div>+ <div class="op-modal--body request-for-confirmation--form form">+ <div class="form--field -required">+ <label class="form--label"+ for="request_for_confirmation_password"+ [attr.aria-label]="text.field_description"+ [textContent]="text.password">+ </label>+ <div class="form--field-container">+ <div class="form--text-field-container">+ <input type="password"+ #passwordConfirmationField+ [(ngModel)]="password_confirmation"+ id="request_for_confirmation_password"+ name="request_for_confirmation_password"+ class="form--text-field"></div>- </form>+ </div>+ <div class="form--field-instructions" [textContent]="text.field_description"></div></div>+ </div>- <div class="op-modal--modal-footer">- <button class="confirm-form-submit--continue button"- (click)="confirmAndClose($event)"- [attr.title]="text.confirm_button"- [textContent]="text.confirm_button"- [disabled]="!passwordValuePresent()">- [attr.title]="text.button_cancel">- </button>- </div>+ <div class="op-modal--footer">+ <button+ class="confirm-form-submit--continue button"+ [textContent]="text.confirm_button"+ [disabled]="!passwordValuePresent()">+ ></button></div>-</div>+</form>diff --git a/frontend/src/app/components/modals/save-modal/save-query.modal.html b/frontend/src/app/components/modals/save-modal/save-query.modal.htmlindex 5ced5d26dd9..88549774efa 100644--- a/frontend/src/app/components/modals/save-modal/save-query.modal.html+++ b/frontend/src/app/components/modals/save-modal/save-query.modal.html@@ -1,57 +1,50 @@-<div class="op-modal--portal ">- <div class="op-modal--modal-container wp-table--configuration-modal loading-indicator--location"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <h3 [textContent]="text.save_as"></h3>+<form+ class="op-modal wp-table--configuration-modal loading-indicator--location"+ data-indicator-name="modal"+ name="modalSaveForm"+>+ <op-modal-header (close)="closeMe($event)">{{text.save_as}}</op-modal-header>- <a class="op-modal--modal-close-button">- <i- class="icon-close"- (accessibleClick)="closeMe($event)"- [attr.title]="text.close_popup">- </i>- </a>- </div>-- <form name="modalSaveForm" class="form">- <div class="form--field -required">- <label class="form--label" for="save-query-name" [textContent]="text.label_name"></label>- <div class="form--field-container">- <div class="form--text-field-container">- <input- class="form--text-field"- type="text"- name="save-query-name"- id="save-query-name"- #queryNameField- [(ngModel)]="queryName"- required/>- </div>+ <div+ name="modalSaveForm"+ class="op-modal--body form"+ >+ <div class="form--field -required">+ <label class="form--label" for="save-query-name" [textContent]="text.label_name"></label>+ <div class="form--field-container">+ <div class="form--text-field-container">+ <input+ class="form--text-field"+ type="text"+ name="save-query-name"+ id="save-query-name"+ #queryNameField+ [(ngModel)]="queryName"+ required/></div></div>+ </div>- <section class="form--section">- <h3 [textContent]="text.label_visibility_settings"></h3>- <query-sharing-form- [isSave]="true"- (onChange)="setValues($event)"- [isStarred]="isStarred"- [isPublic]="isPublic">- </query-sharing-form>- </section>+ <section class="form--section">+ <h3 [textContent]="text.label_visibility_settings"></h3>+ <query-sharing-form+ [isSave]="true"+ (onChange)="setValues($event)"+ [isStarred]="isStarred"+ [isPublic]="isPublic">+ </query-sharing-form>+ </section>+ </div>- <div class="form--space">- <button class="button -highlight -with-icon icon-checkmark"- (click)="saveQueryAs($event)"- [textContent]="text.button_save"- [disabled]="isBusy || !queryName">- </button>- <button class="button -with-icon icon-cancel"- [textContent]="text.button_cancel"- (click)="closeMe($event)">- </button>- </div>- </form>+ <div class="op-modal--footer">+ <button class="button -highlight -with-icon icon-checkmark"+ (click)="saveQueryAs($event)"+ [textContent]="text.button_save"+ [disabled]="isBusy || !queryName">+ </button>+ <button class="button -with-icon icon-cancel"+ [textContent]="text.button_cancel"+ (click)="closeMe($event)">+ </button></div>-</div>+</form>diff --git a/frontend/src/app/components/modals/save-modal/save-query.modal.ts b/frontend/src/app/components/modals/save-modal/save-query.modal.tsindex 45931962ab1..682a6e422d9 100644--- a/frontend/src/app/components/modals/save-modal/save-query.modal.ts+++ b/frontend/src/app/components/modals/save-modal/save-query.modal.ts@@ -26,18 +26,18 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {States} from '../../states.service';+import {ChangeDetectorRef, Component, ElementRef, Inject, ViewChild} from "@angular/core";import {HalResourceNotificationService} from "core-app/modules/hal/services/hal-resource-notification.service";import {QueryResource} from 'core-app/modules/hal/resources/query-resource';import {NotificationsService} from "core-app/modules/common/notifications/notifications.service";-import {OpModalComponent} from "core-components/op-modals/op-modal.component";-import {ChangeDetectorRef, Component, ElementRef, Inject, ViewChild} from "@angular/core";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";import {QuerySharingChange} from "core-components/modals/share-modal/query-sharing-form.component";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isolated-query-space";import {WorkPackagesListService} from "core-components/wp-list/wp-list.service";+import {States} from '../../states.service';@Component({templateUrl: './save-query.modal.html'diff --git a/frontend/src/app/components/modals/share-modal/query-sharing.modal.html b/frontend/src/app/components/modals/share-modal/query-sharing.modal.htmlindex 60cd42f99bf..2047c31091b 100644--- a/frontend/src/app/components/modals/share-modal/query-sharing.modal.html+++ b/frontend/src/app/components/modals/share-modal/query-sharing.modal.html@@ -1,36 +1,26 @@-<div class="op-modal--portal ">- <div class="op-modal--modal-container wp-table--configuration-modal loading-indicator--location"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <h3 [textContent]="text.label_visibility_settings"></h3>+<div+ class="op-modal wp-table--configuration-modal loading-indicator--location"+ data-indicator-name="modal"+>+ <op-modal-header (close)="closeMe($event)">{{text.label_visibility_settings}}</op-modal-header>- <a class="op-modal--modal-close-button">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.close_popup">- </i>- </a>- </div>+ <query-sharing-form+ class="op-modal--body"+ [isSave]="false"+ (onChange)="setValues($event)"+ [isStarred]="isStarred"+ [isPublic]="isPublic">+ </query-sharing-form>- <query-sharing-form- [isSave]="false"- (onChange)="setValues($event)"- [isStarred]="isStarred"- [isPublic]="isPublic">- </query-sharing-form>-- <div class="form--space">- <button class="button -highlight -with-icon icon-checkmark"- (click)="saveQuery($event)"- [textContent]="text.button_save">- </button>- <button class="button -with-icon icon-cancel"- [textContent]="text.button_cancel"- [disabled]="isBusy"- (click)="closeMe($event)">- </button>- </div>+ <div class="op-modal--footer">+ <button class="button -highlight -with-icon icon-checkmark"+ (click)="saveQuery($event)"+ [textContent]="text.button_save">+ </button>+ <button class="button -with-icon icon-cancel"+ [textContent]="text.button_cancel"+ [disabled]="isBusy"+ (click)="closeMe($event)">+ </button></div></div>diff --git a/frontend/src/app/components/modals/share-modal/query-sharing.modal.ts b/frontend/src/app/components/modals/share-modal/query-sharing.modal.tsindex 01577485032..0049de3a5bd 100644--- a/frontend/src/app/components/modals/share-modal/query-sharing.modal.ts+++ b/frontend/src/app/components/modals/share-modal/query-sharing.modal.ts@@ -31,10 +31,10 @@ import {States} from '../../states.service';import {HalResourceNotificationService} from "core-app/modules/hal/services/hal-resource-notification.service";import {QueryResource} from 'core-app/modules/hal/resources/query-resource';import {NotificationsService} from "core-app/modules/common/notifications/notifications.service";-import {OpModalComponent} from "core-components/op-modals/op-modal.component";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";import {ChangeDetectorRef, Component, ElementRef, Inject, OnInit} from "@angular/core";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";import {QuerySharingChange} from "core-components/modals/share-modal/query-sharing-form.component";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isolated-query-space";diff --git a/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.html b/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.htmlindex 1a076e2cc91..13d4568bc1b 100644--- a/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.html+++ b/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.html@@ -1,86 +1,77 @@-<div class="op-modal--portal">- <div id="wp_destroy_modal"- class="op-modal--modal-container wp-table--configuration-modal loading-indicator--location -highlight -danger-zone"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <a class="op-modal--modal-close-button">- <i class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.close">- </i>- </a>- <h3 class="icon-context icon-attention" [textContent]="text.title"></h3>- </div>+<div+ class="op-modal wp-table--configuration-modal -danger-zone loading-indicator--location"+ data-indicator-name="modal"+ id="wp_destroy_modal"+>+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <div class="op-modal--modal-body">- <ng-container *ngIf="singleWorkPackage">- <p>- <span [textContent]="text.text"></span>- <br/>- <strong>- {{ singleWorkPackage.type.name }}- #{{ singleWorkPackage.id }}- {{ singleWorkPackage.subject }}- </strong>- </p>- <div *ngIf="singleWorkPackageChildren && singleWorkPackageChildren.length > 0">- <p class="danger-zone--warning">- <span class="icon-context icon-error"></span>- <strong [textContent]="text.warning"></strong>:- <span [textContent]="text.hasChildren(singleWorkPackage)"></span>- </p>- <ul>- <li *ngFor="let child of singleWorkPackageChildren">- #<span [textContent]="child.id"></span>- <span [textContent]="child.subject || ''"></span>- </li>- </ul>- <p>- <span [textContent]="text.deletesChildren"></span>- </p>- </div>- </ng-container>- <ng-container *ngIf="workPackages.length > 1">+ <div class="op-modal--body">+ <ng-container *ngIf="singleWorkPackage">+ <p>+ <span [textContent]="text.text"></span>+ <br/>+ <strong>+ {{ singleWorkPackage.type.name }}+ #{{ singleWorkPackage.id }}+ {{ singleWorkPackage.subject }}+ </strong>+ </p>+ <div *ngIf="singleWorkPackageChildren && singleWorkPackageChildren.length > 0"><p class="danger-zone--warning"><span class="icon-context icon-error"></span>- <strong [textContent]="text.text"></strong>+ <strong [textContent]="text.warning"></strong>:+ <span [textContent]="text.hasChildren(singleWorkPackage)"></span></p><ul>- <li *ngFor="let wp of workPackages">- #<span [textContent]="wp.id"></span>- &ngsp;- <span [textContent]="wp.subject"></span>- <strong *ngIf="children(wp).length > 0">- (+ {{ text.childCount(wp) }})- </strong>+ <li *ngFor="let child of singleWorkPackageChildren">+ #<span [textContent]="child.id"></span>+ <span [textContent]="child.subject || ''"></span></li></ul>- </ng-container>- <div *ngIf="mustConfirmChildren">- <label class="form--label-with-check-box">- <div class="form--check-box-container">- <input type="checkbox"- name="confirm-children-deletion"- id="confirm-children-deletion"- [(ngModel)]="childrenDeletionConfirmed"- class="form--check-box" />- </div>- {{ text.label_confirm_children_deletion }}- </label>+ <p>+ <span [textContent]="text.deletesChildren"></span>+ </p></div>+ </ng-container>+ <ng-container *ngIf="workPackages.length > 1">+ <p class="danger-zone--warning">+ <span class="icon-context icon-error"></span>+ <strong [textContent]="text.text"></strong>+ </p>+ <ul>+ <li *ngFor="let wp of workPackages">+ #<span [textContent]="wp.id"></span>+ &ngsp;+ <span [textContent]="wp.subject"></span>+ <strong *ngIf="children(wp).length > 0">+ (+ {{ text.childCount(wp) }})+ </strong>+ </li>+ </ul>+ </ng-container>+ <div *ngIf="mustConfirmChildren">+ <label class="form--label-with-check-box">+ <div class="form--check-box-container">+ <input type="checkbox"+ name="confirm-children-deletion"+ id="confirm-children-deletion"+ [(ngModel)]="childrenDeletionConfirmed"+ class="form--check-box" />+ </div>+ {{ text.label_confirm_children_deletion }}+ </label></div>+ </div>- <div class="op-modal--modal-footer">- <button class="button -danger"- [textContent]="text.confirm"- [attr.disabled]="busy || blockedDueToUnconfirmedChildren || undefined"- (click)="confirmDeletion($event)">- </button>- <button class="button"- [textContent]="text.cancel"- (click)="closeMe($event)">- </button>- </div>+ <div class="op-modal--footer">+ <button class="button -danger"+ [textContent]="text.confirm"+ [attr.disabled]="busy || blockedDueToUnconfirmedChildren || undefined"+ (click)="confirmDeletion($event)">+ </button>+ <button class="button"+ [textContent]="text.cancel"+ (click)="closeMe($event)">+ </button></div></div>diff --git a/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.ts b/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.tsindex ebf1822c9da..4e2e257c09c 100644--- a/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.ts+++ b/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.ts@@ -28,10 +28,10 @@import {WorkPackagesListService} from '../../wp-list/wp-list.service';import {States} from '../../states.service';-import {OpModalComponent} from "core-components/op-modals/op-modal.component";import {ChangeDetectorRef, Component, ElementRef, Inject, OnInit} from "@angular/core";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";import {WorkPackageResource} from 'core-app/modules/hal/resources/work-package-resource';import {WorkPackageViewFocusService} from 'core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-focus.service';import {StateService} from '@uirouter/core';diff --git a/frontend/src/app/components/op-context-menu/handlers/op-columns-context-menu.directive.ts b/frontend/src/app/components/op-context-menu/handlers/op-columns-context-menu.directive.tsindex fe7ccb4728d..c3bad3d318e 100644--- a/frontend/src/app/components/op-context-menu/handlers/op-columns-context-menu.directive.ts+++ b/frontend/src/app/components/op-context-menu/handlers/op-columns-context-menu.directive.ts@@ -31,7 +31,7 @@ import {I18nService} from 'core-app/modules/common/i18n/i18n.service';import {OpContextMenuTrigger} from 'core-components/op-context-menu/handlers/op-context-menu-trigger.directive';import {OPContextMenuService} from 'core-components/op-context-menu/op-context-menu.service';-import {OpModalService} from 'core-components/op-modals/op-modal.service';+import {OpModalService} from 'core-app/modules/modal/modal.service';import {WorkPackageViewColumnsService} from 'core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-columns.service';import {WorkPackageViewGroupByService} from 'core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-group-by.service';import {WorkPackageViewHierarchiesService} from 'core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-hierarchy.service';diff --git a/frontend/src/app/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts b/frontend/src/app/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.tsindex 97c8806a65a..7e911a5f944 100644--- a/frontend/src/app/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts+++ b/frontend/src/app/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts@@ -35,7 +35,7 @@ import {States} from 'core-components/states.service';import {WorkPackagesListService} from 'core-components/wp-list/wp-list.service';import {QueryFormResource} from 'core-app/modules/hal/resources/query-form-resource';import {QueryResource} from 'core-app/modules/hal/resources/query-resource';-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {WpTableExportModal} from "core-components/modals/export-modal/wp-table-export.modal";import {SaveQueryModal} from "core-components/modals/save-modal/save-query.modal";import {QuerySharingModal} from "core-components/modals/share-modal/query-sharing.modal";diff --git a/frontend/src/app/components/op-context-menu/icon-triggered-context-menu/icon-triggered-context-menu.component.ts b/frontend/src/app/components/op-context-menu/icon-triggered-context-menu/icon-triggered-context-menu.component.tsindex b5c0aa5659f..1b1428a4e50 100644--- a/frontend/src/app/components/op-context-menu/icon-triggered-context-menu/icon-triggered-context-menu.component.ts+++ b/frontend/src/app/components/op-context-menu/icon-triggered-context-menu/icon-triggered-context-menu.component.ts@@ -30,7 +30,7 @@ import {ChangeDetectorRef, Component, ElementRef, Injector, Input} from '@angulaimport {I18nService} from 'core-app/modules/common/i18n/i18n.service';import {OpContextMenuTrigger} from 'core-components/op-context-menu/handlers/op-context-menu-trigger.directive';import {OPContextMenuService} from 'core-components/op-context-menu/op-context-menu.service';-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {OpContextMenuItem} from "core-components/op-context-menu/op-context-menu.types";@Component({diff --git a/frontend/src/app/components/op-context-menu/wp-context-menu/wp-single-context-menu.ts b/frontend/src/app/components/op-context-menu/wp-context-menu/wp-single-context-menu.tsindex 9e878525398..2c02570b776 100644--- a/frontend/src/app/components/op-context-menu/wp-context-menu/wp-single-context-menu.ts+++ b/frontend/src/app/components/op-context-menu/wp-context-menu/wp-single-context-menu.ts@@ -10,7 +10,7 @@ import {OpContextMenuTrigger} from 'core-components/op-context-menu/handlers/op-import {OPContextMenuService} from 'core-components/op-context-menu/op-context-menu.service';import {OpContextMenuItem} from 'core-components/op-context-menu/op-context-menu.types';import {PERMITTED_CONTEXT_MENU_ACTIONS} from 'core-components/op-context-menu/wp-context-menu/wp-static-context-menu-actions';-import {OpModalService} from 'core-components/op-modals/op-modal.service';+import {OpModalService} from 'core-app/modules/modal/modal.service';import {WorkPackageAuthorization} from 'core-components/work-packages/work-package-authorization.service';import {WorkPackageAction} from 'core-components/wp-table/context-menu-helper/wp-context-menu-helper.service';import {InjectField} from "core-app/helpers/angular/inject-field.decorator";diff --git a/frontend/src/app/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts b/frontend/src/app/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.tsindex 984be73ef8f..eb3f64ca780 100644--- a/frontend/src/app/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts+++ b/frontend/src/app/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts@@ -11,7 +11,7 @@ import {OpContextMenuHandler} from "core-components/op-context-menu/op-context-mimport {OPContextMenuService} from "core-components/op-context-menu/op-context-menu.service";import {OpContextMenuItem, OpContextMenuLocalsMap} from "core-components/op-context-menu/op-context-menu.types";import {PERMITTED_CONTEXT_MENU_ACTIONS} from "core-components/op-context-menu/wp-context-menu/wp-static-context-menu-actions";-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {WpDestroyModal} from "core-components/modals/wp-destroy-modal/wp-destroy.modal";import {StateService} from "@uirouter/core";import {InjectField} from "core-app/helpers/angular/inject-field.decorator";diff --git a/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.ts b/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.tsindex 42f49bab8f7..409b72993fb 100644--- a/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.ts+++ b/frontend/src/app/components/projects/project-menu-autocomplete/project-menu-autocomplete.component.ts@@ -30,7 +30,7 @@ import {PathHelperService} from 'core-app/modules/common/path-helper/path-helperimport {IAutocompleteItem,ILazyAutocompleterBridge-} from 'core-app/modules/common/autocomplete/lazyloaded/lazyloaded-autocompleter';+} from 'core-app/modules/autocompleter/lazyloaded/lazyloaded-autocompleter';import {keyCodes} from 'core-app/modules/common/keyCodes.enum';import {LinkHandling} from 'core-app/modules/common/link-handling/link-handling';import {I18nService} from "core-app/modules/common/i18n/i18n.service";diff --git a/frontend/src/app/components/states.service.ts b/frontend/src/app/components/states.service.tsindex d379e498c53..7b56ba7a79e 100644--- a/frontend/src/app/components/states.service.ts+++ b/frontend/src/app/components/states.service.ts@@ -1,7 +1,9 @@import {ProjectResource} from 'core-app/modules/hal/resources/project-resource';import {SchemaResource} from 'core-app/modules/hal/resources/schema-resource';import {TypeResource} from 'core-app/modules/hal/resources/type-resource';+import {RoleResource} from 'core-app/modules/hal/resources/role-resource';import {UserResource} from 'core-app/modules/hal/resources/user-resource';+import {PlaceholderUserResource} from 'core-app/modules/hal/resources/placeholder-user-resource';import {WorkPackageResource} from 'core-app/modules/hal/resources/work-package-resource';import {input, InputState, multiInput, MultiInputState, StatesGroup} from 'reactivestates';import {QueryColumn} from './wp-query/query-column';@@ -46,6 +48,13 @@ export class States extends StatesGroup {/* /api/v3/users */users = multiInput<UserResource>();+ /* /api/v3/placeholder_users */+ placeholderUsers = multiInput<PlaceholderUserResource>();++ /* /api/v3/roles */+ roles = multiInput<RoleResource>();++// Work Package query statesqueries = new QueryAvailableDataStates();diff --git a/frontend/src/app/components/wp-table/config-menu/config-menu.component.ts b/frontend/src/app/components/wp-table/config-menu/config-menu.component.tsindex 8079db3a1e8..0b84cc06ad3 100644--- a/frontend/src/app/components/wp-table/config-menu/config-menu.component.ts+++ b/frontend/src/app/components/wp-table/config-menu/config-menu.component.ts@@ -1,6 +1,6 @@import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {Component, OnInit, Injector} from '@angular/core';-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {OPContextMenuService} from "core-components/op-context-menu/op-context-menu.service";import {WpTableConfigurationModalComponent} from "core-components/wp-table/configuration-modal/wp-table-configuration.modal";diff --git a/frontend/src/app/components/wp-table/configuration-modal/wp-table-configuration.modal.html b/frontend/src/app/components/wp-table/configuration-modal/wp-table-configuration.modal.htmlindex 50515bcfd80..c16cac040fe 100644--- a/frontend/src/app/components/wp-table/configuration-modal/wp-table-configuration.modal.html+++ b/frontend/src/app/components/wp-table/configuration-modal/wp-table-configuration.modal.html@@ -1,18 +1,10 @@-<div class="op-modal--portal ">- <div class="op-modal--modal-container -wide wp-table--configuration-modal loading-indicator--location"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <h3 [textContent]="text.title"></h3>+<div+ class="op-modal op-modal_wide wp-table--configuration-modal loading-indicator--location"+ data-indicator-name="modal"+>+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <a class="op-modal--modal-close-button">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.closePopup">- </i>- </a>- </div>+ <div class="op-modal--body"><ng-container *ngIf="!!prependModalComponent"><ng-container *ngComponentOutlet="prependModalComponent; injector: injector"></ng-container>@@ -23,27 +15,28 @@<ul class="tabrow"><li *ngFor="let tab of availableTabs"[ngClass]="{ 'selected': currentTab && tab.name === currentTab.name, '-disabled': tab.disableBecause != null }">- <a class="tab-show"- role="button"- [ngClass]="{ 'selected': currentTab && tab.name === currentTab.name }"- [attr.title]="tab.disableBecause || tab.title"- [textContent]="tab.title"- (click)="switchTo(tab.name)"- href>- </a>+ <a+ class="tab-show"+ role="button"+ [ngClass]="{ 'selected': currentTab && tab.name === currentTab.name }"+ [attr.title]="tab.disableBecause || tab.title"+ [textContent]="tab.title"+ (click)="switchTo(tab.name)"+ href+ ></a></ul></div><div class="tab-content" #tabContentOutlet></div>- <div class="modal--form-actions">- <button class="button -highlight"- [textContent]="text.applyButton"- (click)="saveChanges()">- </button>- <button class="button"- [textContent]="text.cancelButton"- (click)="closeMe($event)">- </button>- </div>+ </div>+ <div class="op-modal--footer">+ <button class="button -highlight"+ [textContent]="text.applyButton"+ (click)="saveChanges()">+ </button>+ <button class="button"+ [textContent]="text.cancelButton"+ (click)="closeMe($event)">+ </button></div></div>diff --git a/frontend/src/app/components/wp-table/configuration-modal/wp-table-configuration.modal.ts b/frontend/src/app/components/wp-table/configuration-modal/wp-table-configuration.modal.tsindex ff6907f9fa4..b489a5a7a7e 100644--- a/frontend/src/app/components/wp-table/configuration-modal/wp-table-configuration.modal.ts+++ b/frontend/src/app/components/wp-table/configuration-modal/wp-table-configuration.modal.ts@@ -13,10 +13,8 @@ import {Optional,ViewChild} from '@angular/core';-import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';import {ConfigurationService} from 'core-app/modules/common/config/configuration.service';import {WorkPackageViewColumnsService} from 'core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-columns.service';-import {OpModalComponent} from 'core-components/op-modals/op-modal.component';import {WpTableConfigurationService} from 'core-components/wp-table/configuration-modal/wp-table-configuration.service';import {ActiveTabInterface,@@ -29,7 +27,9 @@ import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isoimport {QueryFormResource} from 'core-app/modules/hal/resources/query-form-resource';import {LoadingIndicatorService} from 'core-app/modules/common/loading-indicator/loading-indicator.service';import {I18nService} from "core-app/modules/common/i18n/i18n.service";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalComponent} from 'core-app/modules/modal/modal.component';+import {OpModalLocalsMap} from 'core-app/modules/modal/modal.types';import {ComponentType} from "@angular/cdk/portal";import {WorkPackageNotificationService} from "core-app/modules/work_packages/notifications/work-package-notification.service";import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";diff --git a/frontend/src/app/components/wp-table/embedded/wp-embedded-table.component.ts b/frontend/src/app/components/wp-table/embedded/wp-embedded-table.component.tsindex f6c270a7f9e..c385d99841e 100644--- a/frontend/src/app/components/wp-table/embedded/wp-embedded-table.component.ts+++ b/frontend/src/app/components/wp-table/embedded/wp-embedded-table.component.ts@@ -5,7 +5,7 @@ import {OpTableActionFactory} from 'core-components/wp-table/table-actions/tableimport {OpTableActionsService} from 'core-components/wp-table/table-actions/table-actions.service';import {QueryResource} from 'core-app/modules/hal/resources/query-resource';import {WpTableConfigurationModalComponent} from 'core-components/wp-table/configuration-modal/wp-table-configuration.modal';-import {OpModalService} from 'core-components/op-modals/op-modal.service';+import {OpModalService} from 'core-app/modules/modal/modal.service';import {WorkPackageEmbeddedBaseComponent} from "core-components/wp-table/embedded/wp-embedded-base.component";import {QueryFormResource} from "core-app/modules/hal/resources/query-form-resource";import {distinctUntilChanged, map, take, withLatestFrom} from "rxjs/operators";diff --git a/frontend/src/app/components/wp-table/table-pagination/wp-table-pagination.component.spec.ts b/frontend/src/app/components/wp-table/table-pagination/wp-table-pagination.component.spec.tsindex ad974de3624..3d2007b6e62 100644--- a/frontend/src/app/components/wp-table/table-pagination/wp-table-pagination.component.spec.ts+++ b/frontend/src/app/components/wp-table/table-pagination/wp-table-pagination.component.spec.ts@@ -39,9 +39,9 @@ import {HalResourceService} from 'core-app/modules/hal/services/hal-resource.serimport {PathHelperService} from 'core-app/modules/common/path-helper/path-helper.service';import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {OpenProject} from "core-app/globals/openproject";-import {OpIcon} from "core-app/modules/common/icon/op-icon";import {WorkPackageViewSortByService} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-sort-by.service";import {ConfigurationService} from "core-app/modules/common/config/configuration.service";+import {OpIconComponent} from "core-app/modules/common/icon/icon.component";function setupMocks(paginationService:PaginationService) {const options:IPaginationOptions = {@@ -80,7 +80,7 @@ describe('wpTablePagination Directive', () => {],declarations: [WorkPackageTablePaginationComponent,- OpIcon+ OpIconComponent],providers: [States,diff --git a/frontend/src/app/core/services/permissions/permissions.service.spec.ts b/frontend/src/app/core/services/permissions/permissions.service.spec.tsnew file mode 100644index 00000000000..b61fd5bc148--- /dev/null+++ b/frontend/src/app/core/services/permissions/permissions.service.spec.ts@@ -0,0 +1,17 @@+import { TestBed } from '@angular/core/testing';++import { PermissionsService } from './permissions.service';++// TODO: Test this service+/*describe('PermissionsService', () => {+ let service:PermissionsService;++ beforeEach(() => {+ TestBed.configureTestingModule({});+ service = TestBed.inject(PermissionsService);+ });++ it('should be created', () => {+ expect(service).toBeTruthy();+ });+});*/diff --git a/frontend/src/app/core/services/permissions/permissions.service.ts b/frontend/src/app/core/services/permissions/permissions.service.tsnew file mode 100644index 00000000000..6d8e657e79e--- /dev/null+++ b/frontend/src/app/core/services/permissions/permissions.service.ts@@ -0,0 +1,27 @@+import { Injectable } from '@angular/core';+import {APIV3Service} from 'core-app/modules/apiv3/api-v3.service';+import {Observable} from 'rxjs';+import {CurrentProjectService} from 'core-components/projects/current-project.service';+import {map} from 'rxjs/operators';+import {FilterOperator} from 'core-components/api/api-v3/api-v3-filter-builder';++@Injectable({+ providedIn: 'root',+})+export class PermissionsService {+ constructor(+ private apiV3Service:APIV3Service,+ private currentProjectService:CurrentProjectService,+ ) { }++ canInviteUsersToProject(projectId = this.currentProjectService.id!):Observable<boolean> {+ // TODO: Remove/Fix this typing issue+ const filters:[string, FilterOperator, string[]][] = [['id', '=', [projectId]]];++ return this.apiV3Service+ .memberships+ .available_projects+ .list({filters})+ .pipe(map(collection => !!collection.elements.length));+ }+}diff --git a/frontend/src/app/global-dynamic-components.const.ts b/frontend/src/app/global-dynamic-components.const.tsindex b05328993f4..a571639e659 100644--- a/frontend/src/app/global-dynamic-components.const.ts+++ b/frontend/src/app/global-dynamic-components.const.ts@@ -16,7 +16,7 @@ import {AttachmentsComponent, attachmentsSelector} from "core-app/modules/attachimport {UserAutocompleterComponent,usersAutocompleterSelector-} from "core-app/modules/common/autocomplete/user-autocompleter.component";+} from "core-app/modules/autocompleter/user-autocompleter/user-autocompleter.component";import {GlobalSearchWorkPackagesComponent,globalSearchWorkPackagesSelector@@ -66,7 +66,7 @@ import {import {AutocompleteSelectDecorationComponent,autocompleteSelectDecorationSelector-} from "core-app/modules/common/autocomplete/autocomplete-select-decoration.component";+} from "core-app/modules/autocompleter/autocomplete-select-decoration/autocomplete-select-decoration.component";import {ContentTabsComponent,contentTabsSelectordiff --git a/frontend/src/app/globals/global-listeners/preview-trigger.service.ts b/frontend/src/app/globals/global-listeners/preview-trigger.service.tsindex 09e44a4fc06..b9596f4a882 100644--- a/frontend/src/app/globals/global-listeners/preview-trigger.service.ts+++ b/frontend/src/app/globals/global-listeners/preview-trigger.service.ts@@ -28,7 +28,7 @@import {Injectable, Injector} from "@angular/core";-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {WpPreviewModal} from "core-components/modals/preview-modal/wp-preview-modal/wp-preview.modal";@Injectable({ providedIn: 'root' })@@ -51,11 +51,14 @@ export class PreviewTriggerService {return;}- this.previewModal = this.opModalService.show(WpPreviewModal, this.injector, { workPackageLink: href, event: e });+ this.previewModal = this.opModalService.show(+ WpPreviewModal,+ this.injector,+ { workPackageLink: href, event: e },+ true,+ );this.modalElement = this.previewModal.elementRef.nativeElement;this.previewModal.reposition(jQuery(this.modalElement), el);-- jQuery(this.modalElement).addClass('-no-width -no-height');});jQuery(document.body).on('mouseleave', '.preview-trigger', (e:JQuery.MouseLeaveEvent) => {diff --git a/frontend/src/app/globals/global-listeners/request-for-confirmation.ts b/frontend/src/app/globals/global-listeners/request-for-confirmation.tsindex e59f9b353c7..84ceb33777c 100644--- a/frontend/src/app/globals/global-listeners/request-for-confirmation.ts+++ b/frontend/src/app/globals/global-listeners/request-for-confirmation.ts@@ -26,7 +26,7 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {PasswordConfirmationModal} from "core-components/modals/request-for-confirmation/password-confirmation.modal";function registerListener(diff --git a/frontend/src/app/globals/onboarding/onboarding_tour_trigger.ts b/frontend/src/app/globals/onboarding/onboarding_tour_trigger.tsindex 8adcfc2115e..7084170c1f0 100644--- a/frontend/src/app/globals/onboarding/onboarding_tour_trigger.ts+++ b/frontend/src/app/globals/onboarding/onboarding_tour_trigger.ts@@ -22,7 +22,7 @@ export function detectOnboardingTour() {sessionStorage.setItem(onboardingTourStorageKey, 'readyToStart');// Start automatically when the language selection is closed- jQuery('.op-modal--modal-close-button').click(function () {+ jQuery('.op-modal--close-button').click(function () {tourCancelled = true;triggerTour('homescreen');});diff --git a/frontend/src/app/modules/apiv3/api-v3.service.ts b/frontend/src/app/modules/apiv3/api-v3.service.tsindex 6fdd524f881..44963805eba 100644--- a/frontend/src/app/modules/apiv3/api-v3.service.ts+++ b/frontend/src/app/modules/apiv3/api-v3.service.ts@@ -33,28 +33,30 @@ import {APIv3ResourcePath} from "core-app/modules/apiv3/paths/apiv3-resource";import {Constructor} from "@angular/cdk/table";+import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service";import {Apiv3GridsPaths} from "core-app/modules/apiv3/endpoints/grids/apiv3-grids-paths";import {Apiv3TimeEntriesPaths} from "core-app/modules/apiv3/endpoints/time-entries/apiv3-time-entries-paths";import {Apiv3MembershipsPaths} from "core-app/modules/apiv3/endpoints/memberships/apiv3-memberships-paths";import {Apiv3UsersPaths} from "core-app/modules/apiv3/endpoints/users/apiv3-users-paths";+import {Apiv3PlaceholderUsersPaths} from 'core-app/modules/apiv3/endpoints/placeholder-users/apiv3-placeholder-users-paths.ts';+import {Apiv3GroupsPaths} from 'core-app/modules/apiv3/endpoints/groups/apiv3-groups-paths.ts';import {APIv3TypesPaths} from "core-app/modules/apiv3/endpoints/types/apiv3-types-paths";import {APIv3QueriesPaths} from "core-app/modules/apiv3/endpoints/queries/apiv3-queries-paths";-import {APIv3ProjectsPaths} from "core-app/modules/apiv3/endpoints/projects/apiv3-projects-paths";-import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service";import {APIV3WorkPackagesPaths} from "core-app/modules/apiv3/endpoints/work_packages/api-v3-work-packages-paths";-import {HalResource} from "core-app/modules/hal/resources/hal-resource";import {APIv3ProjectPaths} from "core-app/modules/apiv3/endpoints/projects/apiv3-project-paths";-import {RootResource} from "core-app/modules/hal/resources/root-resource";+import {APIv3ProjectsPaths} from "core-app/modules/apiv3/endpoints/projects/apiv3-projects-paths";import {APIv3StatusesPaths} from "core-app/modules/apiv3/endpoints/statuses/apiv3-statuses-paths";+import {APIv3RolesPaths} from "core-app/modules/apiv3/endpoints/roles/apiv3-roles-paths";import {APIv3VersionsPaths} from "core-app/modules/apiv3/endpoints/versions/apiv3-versions-paths";import {Apiv3RelationsPaths} from "core-app/modules/apiv3/endpoints/relations/apiv3-relations-paths";import {Apiv3NewsPaths} from "core-app/modules/apiv3/endpoints/news/apiv3-news-paths";import {Apiv3HelpTextsPaths} from "core-app/modules/apiv3/endpoints/help_texts/apiv3-help-texts-paths";import {Apiv3ConfigurationPath} from "core-app/modules/apiv3/endpoints/configuration/apiv3-configuration-path";-import {ProjectResource} from "core-app/modules/hal/resources/project-resource";+import {Apiv3BoardsPaths} from "core-app/modules/apiv3/virtual/apiv3-boards-paths";+import {RootResource} from "core-app/modules/hal/resources/root-resource";+import {HalResource} from "core-app/modules/hal/resources/hal-resource";import * as ts from "typescript/lib/tsserverlibrary";import Project = ts.server.Project;-import {Apiv3BoardsPaths} from "core-app/modules/apiv3/virtual/apiv3-boards-paths";@Injectable({ providedIn: 'root' })export class APIV3Service {@@ -70,8 +72,8 @@ export class APIV3Service {// /api/v3/gridspublic readonly grids = this.apiV3CustomEndpoint(Apiv3GridsPaths);- // /api/v3/groups- public readonly groups = this.apiV3CollectionEndpoint('groups');+ // /api/v3/principals+ public readonly principals = this.apiV3CollectionEndpoint('principals');// /api/v3/rootpublic readonly root = this.apiV3SingularEndpoint<RootResource>('');@@ -113,7 +115,13 @@ export class APIV3Service {public readonly users = this.apiV3CustomEndpoint(Apiv3UsersPaths);// /api/v3/placeholderUsers- public readonly placeholder_users = this.apiV3CollectionEndpoint('placeholder_users')+ public readonly placeholder_users = this.apiV3CustomEndpoint(Apiv3PlaceholderUsersPaths)++ // /api/v3/groups+ public readonly groups = this.apiV3CustomEndpoint(Apiv3GroupsPaths)++ // /api/v3/roles+ public readonly roles = this.apiV3CustomEndpoint(APIv3RolesPaths);// /api/v3/help_textspublic readonly help_texts = this.apiV3CustomEndpoint(Apiv3HelpTextsPaths);diff --git a/frontend/src/app/modules/apiv3/endpoints/groups/apiv3-group-paths.ts b/frontend/src/app/modules/apiv3/endpoints/groups/apiv3-group-paths.tsnew file mode 100644index 00000000000..365be7d6fdf--- /dev/null+++ b/frontend/src/app/modules/apiv3/endpoints/groups/apiv3-group-paths.ts@@ -0,0 +1,54 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.+//++++import {APIv3GettableResource} from "core-app/modules/apiv3/paths/apiv3-resource";+import {GroupResource} from "core-app/modules/hal/resources/group-resource";+import {Observable} from "rxjs";++export class Apiv3GroupPaths extends APIv3GettableResource<GroupResource> {+ /**+ * Update a placeholder user resource or payload+ * @param resource+ */+ public patch(resource:GroupResource|{ name:string }):Observable<GroupResource> {+ return this+ .halResourceService+ .patch<GroupResource>(this.path, {+ name: resource.name,+ });+ }++ /**+ * Delete a placeholder user resource+ */+ public delete():Observable<unknown> {+ return this+ .halResourceService+ .delete(this.path);+ }+}diff --git a/frontend/src/app/modules/apiv3/endpoints/groups/apiv3-groups-paths.ts b/frontend/src/app/modules/apiv3/endpoints/groups/apiv3-groups-paths.tsnew file mode 100644index 00000000000..c10ab638b24--- /dev/null+++ b/frontend/src/app/modules/apiv3/endpoints/groups/apiv3-groups-paths.ts@@ -0,0 +1,72 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.+//++++import {APIv3ResourceCollection} from "core-app/modules/apiv3/paths/apiv3-resource";+import {Apiv3GroupPaths} from "core-app/modules/apiv3/endpoints/groups/apiv3-group-paths";+import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";+import {Observable} from "rxjs";+import {+ Apiv3ListParameters,+ Apiv3ListResourceInterface,+ listParamsString+} from "core-app/modules/apiv3/paths/apiv3-list-resource.interface";+import {CollectionResource} from "core-app/modules/hal/resources/collection-resource";+import {GroupResource} from 'core-app/modules/hal/resources/group-resource';++export class Apiv3GroupsPaths+ extends APIv3ResourceCollection<GroupResource, Apiv3GroupPaths>+ implements Apiv3ListResourceInterface<GroupResource> {+ constructor(protected apiRoot:APIV3Service,+ protected basePath:string) {+ super(apiRoot, basePath, 'groups', Apiv3GroupPaths);+ }++ /**+ * Load a list of placeholder users with a given list parameter filter+ * @param params+ */+ public list(params?:Apiv3ListParameters):Observable<CollectionResource<GroupResource>> {+ return this+ .halResourceService+ .get<CollectionResource<GroupResource>>(this.path + listParamsString(params));+ }++ /**+ * Create a new GroupResource+ *+ * @param resource+ */+ public post(resource:{ name:string }):Observable<GroupResource> {+ return this+ .halResourceService+ .post<GroupResource>(+ this.path,+ resource,+ );+ }+}diff --git a/frontend/src/app/modules/apiv3/endpoints/memberships/apiv3-memberships-paths.ts b/frontend/src/app/modules/apiv3/endpoints/memberships/apiv3-memberships-paths.tsindex 5089b70e050..b24fdf9c250 100644--- a/frontend/src/app/modules/apiv3/endpoints/memberships/apiv3-memberships-paths.ts+++ b/frontend/src/app/modules/apiv3/endpoints/memberships/apiv3-memberships-paths.ts@@ -27,9 +27,6 @@//++import {APIv3GettableResource, APIv3ResourceCollection} from "core-app/modules/apiv3/paths/apiv3-resource";-import {HalResource} from "core-app/modules/hal/resources/hal-resource";-import {ProjectResource} from "core-app/modules/hal/resources/project-resource";-import {CollectionResource} from "core-app/modules/hal/resources/collection-resource";import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";import {Apiv3AvailableProjectsPaths} from "core-app/modules/apiv3/endpoints/projects/apiv3-available-projects-paths";import {@@ -37,7 +34,15 @@ import {Apiv3ListResourceInterface, listParamsString} from "core-app/modules/apiv3/paths/apiv3-list-resource.interface";import {Observable} from "rxjs";+import {HalResource} from "core-app/modules/hal/resources/hal-resource";+import {CollectionResource} from "core-app/modules/hal/resources/collection-resource";import {MembershipResource} from "core-app/modules/hal/resources/membership-resource";+import {ProjectResource} from 'core-app/modules/hal/resources/project-resource';+import {UserResource} from "core-app/modules/hal/resources/user-resource";+import {GroupResource} from "core-app/modules/hal/resources/group-resource";+import {PlaceholderUserResource} from "core-app/modules/hal/resources/placeholder-user-resource";+import {RoleResource} from 'core-app/modules/hal/resources/role-resource';+export class Apiv3MembershipsPathsextends APIv3ResourceCollection<MembershipResource, APIv3GettableResource<MembershipResource>>@@ -60,4 +65,22 @@ export class Apiv3MembershipsPaths// /api/v3/memberships/available_projectsreadonly available_projects = this.subResource('available_projects', Apiv3AvailableProjectsPaths);++ /**+ * Create a new MembershipResource+ *+ * @param resource+ */+ public post(resource:{+ principal:UserResource|GroupResource|PlaceholderUserResource,+ project:ProjectResource,+ roles:RoleResource[],+ }):Observable<MembershipResource> {+ return this+ .halResourceService+ .post<MembershipResource>(+ this.path,+ resource,+ );+ }}diff --git a/frontend/src/app/modules/apiv3/endpoints/placeholder-users/apiv3-placeholder-user-paths.ts b/frontend/src/app/modules/apiv3/endpoints/placeholder-users/apiv3-placeholder-user-paths.tsnew file mode 100644index 00000000000..abe37e46a1a--- /dev/null+++ b/frontend/src/app/modules/apiv3/endpoints/placeholder-users/apiv3-placeholder-user-paths.ts@@ -0,0 +1,54 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.+//++++import {APIv3GettableResource} from "core-app/modules/apiv3/paths/apiv3-resource";+import {PlaceholderUserResource} from "core-app/modules/hal/resources/placeholder-user-resource";+import {Observable} from "rxjs";++export class Apiv3PlaceholderUserPaths extends APIv3GettableResource<PlaceholderUserResource> {+ /**+ * Update a placeholder user resource or payload+ * @param resource+ */+ public patch(resource:PlaceholderUserResource|{ name:string }):Observable<PlaceholderUserResource> {+ return this+ .halResourceService+ .patch<PlaceholderUserResource>(this.path, {+ name: resource.name+ });+ }++ /**+ * Delete a placeholder user resource+ */+ public delete():Observable<unknown> {+ return this+ .halResourceService+ .delete(this.path);+ }+}diff --git a/frontend/src/app/modules/apiv3/endpoints/placeholder-users/apiv3-placeholder-users-paths.ts b/frontend/src/app/modules/apiv3/endpoints/placeholder-users/apiv3-placeholder-users-paths.tsnew file mode 100644index 00000000000..187fcb14153--- /dev/null+++ b/frontend/src/app/modules/apiv3/endpoints/placeholder-users/apiv3-placeholder-users-paths.ts@@ -0,0 +1,72 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.+//++++import {APIv3ResourceCollection} from "core-app/modules/apiv3/paths/apiv3-resource";+import {Apiv3PlaceholderUserPaths} from "core-app/modules/apiv3/endpoints/placeholder-users/apiv3-placeholder-user-paths";+import {PlaceholderUserResource} from "core-app/modules/hal/resources/placeholder-user-resource";+import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";+import {Observable} from "rxjs";+import {+ Apiv3ListParameters,+ Apiv3ListResourceInterface,+ listParamsString+} from "core-app/modules/apiv3/paths/apiv3-list-resource.interface";+import {CollectionResource} from "core-app/modules/hal/resources/collection-resource";++export class Apiv3PlaceholderUsersPaths+ extends APIv3ResourceCollection<PlaceholderUserResource, Apiv3PlaceholderUserPaths>+ implements Apiv3ListResourceInterface<PlaceholderUserResource> {+ constructor(protected apiRoot:APIV3Service,+ protected basePath:string) {+ super(apiRoot, basePath, 'placeholder_users', Apiv3PlaceholderUserPaths);+ }++ /**+ * Load a list of placeholder users with a given list parameter filter+ * @param params+ */+ public list(params?:Apiv3ListParameters):Observable<CollectionResource<PlaceholderUserResource>> {+ return this+ .halResourceService+ .get<CollectionResource<PlaceholderUserResource>>(this.path + listParamsString(params));+ }++ /**+ * Create a new PlaceholderUserResource+ *+ * @param resource+ */+ public post(resource:{ name:string }):Observable<PlaceholderUserResource> {+ return this+ .halResourceService+ .post<PlaceholderUserResource>(+ this.path,+ resource,+ );+ }+}diff --git a/frontend/src/app/modules/apiv3/endpoints/roles/apiv3-role-paths.ts b/frontend/src/app/modules/apiv3/endpoints/roles/apiv3-role-paths.tsnew file mode 100644index 00000000000..f5a9898b306--- /dev/null+++ b/frontend/src/app/modules/apiv3/endpoints/roles/apiv3-role-paths.ts@@ -0,0 +1,38 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.+//++++import {RoleResource} from "core-app/modules/hal/resources/role-resource";+import {CachableAPIV3Resource} from "core-app/modules/apiv3/cache/cachable-apiv3-resource";+import {StateCacheService} from "core-app/modules/apiv3/cache/state-cache.service";++export class APIv3RolePaths extends CachableAPIV3Resource<RoleResource> {++ protected createCache():StateCacheService<RoleResource> {+ return new StateCacheService<RoleResource>(this.states.roles);+ }+}diff --git a/frontend/src/app/modules/apiv3/endpoints/roles/apiv3-roles-paths.ts b/frontend/src/app/modules/apiv3/endpoints/roles/apiv3-roles-paths.tsnew file mode 100644index 00000000000..6263eb2329d--- /dev/null+++ b/frontend/src/app/modules/apiv3/endpoints/roles/apiv3-roles-paths.ts@@ -0,0 +1,60 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.+//++++import {APIv3ResourceCollection, APIv3ResourcePath} from "core-app/modules/apiv3/paths/apiv3-resource";+import {Injector} from "@angular/core";+import {RoleResource} from "core-app/modules/hal/resources/role-resource";+import {APIv3RolePaths} from "core-app/modules/apiv3/endpoints/roles/apiv3-role-paths";+import {Observable} from "rxjs";+import {CollectionResource} from "core-app/modules/hal/resources/collection-resource";+import {tap} from "rxjs/operators";+import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";++export class APIv3RolesPaths extends APIv3ResourceCollection<RoleResource, APIv3RolePaths> {+ constructor(protected apiRoot:APIV3Service,+ protected basePath:string) {+ super(apiRoot, basePath, 'roles', APIv3RolePaths);+ }++ /**+ * Perform a request to the HalResourceService with the current path+ */+ public get():Observable<CollectionResource<RoleResource>> {+ return this+ .halResourceService+ .get<CollectionResource<RoleResource>>(this.path)+ .pipe(+ tap(collection => {+ collection.elements.forEach((resource, id) => {+ this.id(resource.id!).cache.updateValue(resource.id!, resource);+ });+ })+ );+ }++}diff --git a/frontend/src/app/modules/apiv3/endpoints/users/apiv3-users-paths.ts b/frontend/src/app/modules/apiv3/endpoints/users/apiv3-users-paths.tsindex 2bf2b48bfae..4cea29b5942 100644--- a/frontend/src/app/modules/apiv3/endpoints/users/apiv3-users-paths.ts+++ b/frontend/src/app/modules/apiv3/endpoints/users/apiv3-users-paths.ts@@ -28,6 +28,7 @@import {APIv3ResourceCollection} from "core-app/modules/apiv3/paths/apiv3-resource";import {APIv3UserPaths} from "core-app/modules/apiv3/endpoints/users/apiv3-user-paths";+import {Observable} from "rxjs";import {UserResource} from "core-app/modules/hal/resources/user-resource";import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";@@ -41,4 +42,30 @@ export class Apiv3UsersPaths extends APIv3ResourceCollection<UserResource, APIv3// /api/v3/users/mepublic readonly me = this.path + '/me';++ /**+ * Create a new UserResource+ *+ * @param resource+ */+ public post(resource:{+ // TODO: The typing here could be a lot better+ login?:string,+ firstName?:string,+ lastName?:string,+ email?:string,+ admin?:boolean,+ language?:string,+ password?:string,+ auth_source?:string,+ identity_url?:string,+ status:'invited'|'active',+ }):Observable<UserResource> {+ return this+ .halResourceService+ .post<UserResource>(+ this.path,+ resource,+ );+ }}diff --git a/frontend/src/app/modules/augmenting/openproject-augmenting.module.ts b/frontend/src/app/modules/augmenting/openproject-augmenting.module.tsindex 52853ba5fed..81d7f4b322e 100644--- a/frontend/src/app/modules/augmenting/openproject-augmenting.module.ts+++ b/frontend/src/app/modules/augmenting/openproject-augmenting.module.ts@@ -27,17 +27,16 @@//++import {NgModule} from '@angular/core';-import {ModalWrapperAugmentService} from "core-app/modules/augmenting/services/modal-wrapper.augment.service";+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";+import {OpModalWrapperAugmentService} from "core-app/modules/modal/modal-wrapper-augment.service";import {PathScriptAugmentService} from "core-app/modules/augmenting/services/path-script.augment.service";@NgModule({- providers: [- ModalWrapperAugmentService,- PathScriptAugmentService- ],+ imports: [ OpenprojectModalModule ],+ providers: [ PathScriptAugmentService ],})export class OpenprojectAugmentingModule {- constructor(modalWrapper:ModalWrapperAugmentService,+ constructor(modalWrapper:OpModalWrapperAugmentService,pathScript:PathScriptAugmentService) {// Setup augmenting servicesmodalWrapper.setupListener();diff --git a/frontend/src/app/modules/common/autocomplete/autocomplete-select-decoration.component.ts b/frontend/src/app/modules/autocompleter/autocomplete-select-decoration/autocomplete-select-decoration.component.tssimilarity index 100%rename from frontend/src/app/modules/common/autocomplete/autocomplete-select-decoration.component.tsrename to frontend/src/app/modules/autocompleter/autocomplete-select-decoration/autocomplete-select-decoration.component.tsdiff --git a/frontend/src/app/modules/common/autocomplete/create-autocompleter.component.html b/frontend/src/app/modules/autocompleter/create-autocompleter/create-autocompleter.component.htmlsimilarity index 84%rename from frontend/src/app/modules/common/autocomplete/create-autocompleter.component.htmlrename to frontend/src/app/modules/autocompleter/create-autocompleter/create-autocompleter.component.htmlindex a3592ac61f4..fc0a489d237 100644--- a/frontend/src/app/modules/common/autocomplete/create-autocompleter.component.html+++ b/frontend/src/app/modules/autocompleter/create-autocompleter/create-autocompleter.component.html@@ -21,7 +21,13 @@<ng-template ng-tag-tmp let-search="searchTerm"><b [textContent]="text.add_new_action"></b>: {{search}}</ng-template>+<ng-template ng-option-tmp let-item="item" let-search="searchTerm"><div [ngOptionHighlight]="search" class="ng-option-label ellipsis">{{ item.name }}</div></ng-template>++ <ng-template ng-footer-tmp *ngIf="showAddNewButton">+ <op-invite-user-button (invited)="onUserInvited($event)">+ </op-invite-user-button>+ </ng-template></ng-select>\ No newline at end of filediff --git a/frontend/src/app/modules/autocompleter/create-autocompleter/create-autocompleter.component.sass b/frontend/src/app/modules/autocompleter/create-autocompleter/create-autocompleter.component.sassnew file mode 100644index 00000000000..38c64c33cdc--- /dev/null+++ b/frontend/src/app/modules/autocompleter/create-autocompleter/create-autocompleter.component.sass@@ -0,0 +1,2 @@+.button.-tiny+ margin: 0\ No newline at end of filediff --git a/frontend/src/app/modules/common/autocomplete/create-autocompleter.component.ts b/frontend/src/app/modules/autocompleter/create-autocompleter/create-autocompleter.component.tssimilarity index 89%rename from frontend/src/app/modules/common/autocomplete/create-autocompleter.component.tsrename to frontend/src/app/modules/autocompleter/create-autocompleter/create-autocompleter.component.tsindex 000051ed1d6..61fc527d328 100644--- a/frontend/src/app/modules/common/autocomplete/create-autocompleter.component.ts+++ b/frontend/src/app/modules/autocompleter/create-autocompleter/create-autocompleter.component.ts@@ -26,7 +26,15 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {AfterViewInit, ChangeDetectorRef, Component, EventEmitter, Input, Output, ViewChild} from '@angular/core';+import {+ AfterViewInit,+ ChangeDetectorRef,+ Component,+ EventEmitter,+ Input,+ Output,+ ViewChild+} from '@angular/core';import {NgSelectComponent} from "@ng-select/ng-select";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {CurrentProjectService} from "core-components/projects/current-project.service";@@ -42,7 +50,8 @@ export interface CreateAutocompleterValueOption {@Component({templateUrl: './create-autocompleter.component.html',- selector: 'create-autocompleter'+ selector: 'create-autocompleter',+ styleUrls: ['./create-autocompleter.component.sass']})export class CreateAutocompleterComponent implements AfterViewInit {@Input() public availableValues:CreateAutocompleterValueOption[];@@ -55,15 +64,17 @@ export class CreateAutocompleterComponent implements AfterViewInit {@Input() public classes:string = '';@Input() public typeahead?:Subject<string>;@Input() public hideSelected:boolean = false;+ @Input() public showAddNewButton:boolean;@Output() public onChange = new EventEmitter<HalResource>();@Output() public onKeydown = new EventEmitter<JQuery.TriggeredEvent>();@Output() public onOpen = new EventEmitter<void>();@Output() public onClose = new EventEmitter<void>();@Output() public onAfterViewInit = new EventEmitter<this>();+ @Output() public onAddNew = new EventEmitter<this>();- @ViewChild('ngSelectComponent') public ngSelectComponent:NgSelectComponent;+ @ViewChild(NgSelectComponent) public ngSelectComponent:NgSelectComponent;public text:{ [key:string]:string } = {add_new_action: this.I18n.t('js.label_create'),@@ -76,8 +87,8 @@ export class CreateAutocompleterComponent implements AfterViewInit {constructor(readonly I18n:I18nService,readonly cdRef:ChangeDetectorRef,readonly currentProject:CurrentProjectService,- readonly pathHelper:PathHelperService) {- }+ readonly pathHelper:PathHelperService,+) { }ngAfterViewInit() {this.onAfterViewInit.emit(this);@@ -139,4 +150,8 @@ export class CreateAutocompleterComponent implements AfterViewInit {public focusInputField() {this.ngSelectComponent && this.ngSelectComponent.focus();}++ public onUserInvited(user:HalResource) {+ this.onChange.emit(user);+ }}diff --git a/frontend/src/app/modules/common/autocomplete/lazyloaded/lazyloaded-autocompleter.ts b/frontend/src/app/modules/autocompleter/lazyloaded/lazyloaded-autocompleter.tssimilarity index 100%rename from frontend/src/app/modules/common/autocomplete/lazyloaded/lazyloaded-autocompleter.tsrename to frontend/src/app/modules/autocompleter/lazyloaded/lazyloaded-autocompleter.tsdiff --git a/frontend/src/app/modules/autocompleter/openproject-autocompleter.module.ts b/frontend/src/app/modules/autocompleter/openproject-autocompleter.module.tsnew file mode 100644index 00000000000..c69d46a7495--- /dev/null+++ b/frontend/src/app/modules/autocompleter/openproject-autocompleter.module.ts@@ -0,0 +1,43 @@+import {NgModule} from "@angular/core";+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";+import {NgSelectModule} from "@ng-select/ng-select";+import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module";+import {CreateAutocompleterComponent} from "core-app/modules/autocompleter/create-autocompleter/create-autocompleter.component.ts";+import {DraggableAutocompleteComponent} from "core-app/modules/common/draggable-autocomplete/draggable-autocomplete.component";+import {DynamicModule} from "ng-dynamic-component";+import {ColorsAutocompleter} from "core-app/modules/common/colors/colors-autocompleter.component";+import {WorkPackageAutocompleterComponent} from "core-app/modules/autocompleter/work-package-autocompleter/wp-autocompleter.component";+import {TimeEntryWorkPackageAutocompleterComponent} from "core-app/modules/autocompleter/te-work-package-autocompleter/te-work-package-autocompleter.component";+import {AutocompleteSelectDecorationComponent} from "core-app/modules/autocompleter/autocomplete-select-decoration/autocomplete-select-decoration.component";+import {VersionAutocompleterComponent} from "core-app/modules/autocompleter/version-autocompleter/version-autocompleter.component";+import {UserAutocompleterComponent} from "core-app/modules/autocompleter/user-autocompleter/user-autocompleter.component";+import {CommonModule} from "@angular/common";+import {OpenprojectInviteUserModalModule} from "core-app/modules/invite-user-modal/invite-user-modal.module";+import {DragulaModule} from "ng2-dragula";++export const OPENPROJECT_AUTOCOMPLETE_COMPONENTS = [+ CreateAutocompleterComponent,+ VersionAutocompleterComponent,+ WorkPackageAutocompleterComponent,+ TimeEntryWorkPackageAutocompleterComponent,+ DraggableAutocompleteComponent,+ UserAutocompleterComponent,+ ColorsAutocompleter,+ AutocompleteSelectDecorationComponent,+];++@NgModule({+ imports: [+ CommonModule,+ OpenprojectCommonModule,+ OpenprojectModalModule,+ OpenprojectInviteUserModalModule,+ NgSelectModule,+ DragulaModule,++ DynamicModule.withComponents(OPENPROJECT_AUTOCOMPLETE_COMPONENTS)+ ],+ exports: OPENPROJECT_AUTOCOMPLETE_COMPONENTS,+ declarations: OPENPROJECT_AUTOCOMPLETE_COMPONENTS+})+export class OpenprojectAutocompleterModule { }diff --git a/frontend/src/app/modules/common/autocomplete/te-work-package-autocompleter.component.html b/frontend/src/app/modules/autocompleter/te-work-package-autocompleter/te-work-package-autocompleter.component.htmlsimilarity index 100%rename from frontend/src/app/modules/common/autocomplete/te-work-package-autocompleter.component.htmlrename to frontend/src/app/modules/autocompleter/te-work-package-autocompleter/te-work-package-autocompleter.component.htmldiff --git a/frontend/src/app/modules/common/autocomplete/te-work-package-autocompleter.component.sass b/frontend/src/app/modules/autocompleter/te-work-package-autocompleter/te-work-package-autocompleter.component.sasssimilarity index 100%rename from frontend/src/app/modules/common/autocomplete/te-work-package-autocompleter.component.sassrename to frontend/src/app/modules/autocompleter/te-work-package-autocompleter/te-work-package-autocompleter.component.sassdiff --git a/frontend/src/app/modules/common/autocomplete/te-work-package-autocompleter.component.ts b/frontend/src/app/modules/autocompleter/te-work-package-autocompleter/te-work-package-autocompleter.component.tssimilarity index 97%rename from frontend/src/app/modules/common/autocomplete/te-work-package-autocompleter.component.tsrename to frontend/src/app/modules/autocompleter/te-work-package-autocompleter/te-work-package-autocompleter.component.tsindex 7012e3c0f75..18a895d2610 100644--- a/frontend/src/app/modules/common/autocomplete/te-work-package-autocompleter.component.ts+++ b/frontend/src/app/modules/autocompleter/te-work-package-autocompleter/te-work-package-autocompleter.component.ts@@ -34,10 +34,10 @@ import {EventEmitter,ChangeDetectorRef,} from '@angular/core';-import {WorkPackageAutocompleterComponent} from "core-app/modules/common/autocomplete/wp-autocompleter.component";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {CurrentProjectService} from "core-components/projects/current-project.service";import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service";+import {WorkPackageAutocompleterComponent} from "core-app/modules/autocompleter/work-package-autocompleter/wp-autocompleter.component";export type TimeEntryWorkPackageAutocompleterMode = 'all'|'recent';diff --git a/frontend/src/app/modules/common/autocomplete/user-autocompleter.component.html b/frontend/src/app/modules/autocompleter/user-autocompleter/user-autocompleter.component.htmlsimilarity index 100%rename from frontend/src/app/modules/common/autocomplete/user-autocompleter.component.htmlrename to frontend/src/app/modules/autocompleter/user-autocompleter/user-autocompleter.component.htmldiff --git a/frontend/src/app/modules/common/autocomplete/user-autocompleter.component.ts b/frontend/src/app/modules/autocompleter/user-autocompleter/user-autocompleter.component.tssimilarity index 100%rename from frontend/src/app/modules/common/autocomplete/user-autocompleter.component.tsrename to frontend/src/app/modules/autocompleter/user-autocompleter/user-autocompleter.component.tsdiff --git a/frontend/src/app/modules/common/autocomplete/version-autocompleter.component.ts b/frontend/src/app/modules/autocompleter/version-autocompleter/version-autocompleter.component.tssimilarity index 94%rename from frontend/src/app/modules/common/autocomplete/version-autocompleter.component.tsrename to frontend/src/app/modules/autocompleter/version-autocompleter/version-autocompleter.component.tsindex f73df4ab901..d2b1ec924a9 100644--- a/frontend/src/app/modules/common/autocomplete/version-autocompleter.component.ts+++ b/frontend/src/app/modules/autocompleter/version-autocompleter/version-autocompleter.component.ts@@ -30,13 +30,13 @@ import {AfterViewInit, ChangeDetectorRef, Component, EventEmitter, Input, Outputimport {CurrentProjectService} from "core-components/projects/current-project.service";import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service";import {VersionResource} from "core-app/modules/hal/resources/version-resource";-import {CreateAutocompleterComponent} from "core-app/modules/common/autocomplete/create-autocompleter.component";+import {CreateAutocompleterComponent} from "core-app/modules/autocompleter/create-autocompleter/create-autocompleter.component.ts";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {HalResourceNotificationService} from "core-app/modules/hal/services/hal-resource-notification.service";import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";@Component({- templateUrl: './create-autocompleter.component.html',+ templateUrl: '../create-autocompleter/create-autocompleter.component.html',selector: 'version-autocompleter'})export class VersionAutocompleterComponent extends CreateAutocompleterComponent implements AfterViewInit {diff --git a/frontend/src/app/modules/common/autocomplete/wp-autocompleter.component.ts b/frontend/src/app/modules/autocompleter/work-package-autocompleter/wp-autocompleter.component.tssimilarity index 87%rename from frontend/src/app/modules/common/autocomplete/wp-autocompleter.component.tsrename to frontend/src/app/modules/autocompleter/work-package-autocompleter/wp-autocompleter.component.tsindex 5971edd5994..d868218e3c9 100644--- a/frontend/src/app/modules/common/autocomplete/wp-autocompleter.component.ts+++ b/frontend/src/app/modules/autocompleter/work-package-autocompleter/wp-autocompleter.component.ts@@ -30,10 +30,10 @@ import {AfterViewInit,Component,} from '@angular/core';-import {CreateAutocompleterComponent} from "core-app/modules/common/autocomplete/create-autocompleter.component";+import {CreateAutocompleterComponent} from "core-app/modules/autocompleter/create-autocompleter/create-autocompleter.component.ts";@Component({- templateUrl: './create-autocompleter.component.html',+ templateUrl: '../create-autocompleter/create-autocompleter.component.html',selector: 'wp-autocompleter'})export class WorkPackageAutocompleterComponent extends CreateAutocompleterComponent implements AfterViewInit {diff --git a/frontend/src/app/modules/bim/ifc_models/toolbar/import-export-bcf/bcf-export-button.component.ts b/frontend/src/app/modules/bim/ifc_models/toolbar/import-export-bcf/bcf-export-button.component.tsindex 2782caf7aee..2785266744f 100644--- a/frontend/src/app/modules/bim/ifc_models/toolbar/import-export-bcf/bcf-export-button.component.ts+++ b/frontend/src/app/modules/bim/ifc_models/toolbar/import-export-bcf/bcf-export-button.component.ts@@ -36,7 +36,7 @@ import {UrlParamsHelperService} from "core-components/wp-query/url-params-helperimport {StateService} from "@uirouter/core";import {UntilDestroyedMixin} from "core-app/helpers/angular/until-destroyed.mixin";import {WpTableExportModal} from "core-components/modals/export-modal/wp-table-export.modal";-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";@Component({template: `diff --git a/frontend/src/app/modules/boards/board/add-card-dropdown/add-card-dropdown-menu.directive.ts b/frontend/src/app/modules/boards/board/add-card-dropdown/add-card-dropdown-menu.directive.tsindex 1e0ac33ee5a..93ab32c10f1 100644--- a/frontend/src/app/modules/boards/board/add-card-dropdown/add-card-dropdown-menu.directive.ts+++ b/frontend/src/app/modules/boards/board/add-card-dropdown/add-card-dropdown-menu.directive.ts@@ -31,7 +31,7 @@ import {I18nService} from 'core-app/modules/common/i18n/i18n.service';import {AuthorisationService} from 'core-app/modules/common/model-auth/model-auth.service';import {OpContextMenuTrigger} from 'core-components/op-context-menu/handlers/op-context-menu-trigger.directive';import {OPContextMenuService} from 'core-components/op-context-menu/op-context-menu.service';-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isolated-query-space";import {WorkPackageInlineCreateService} from "core-components/wp-inline-create/wp-inline-create.service";import {BoardListComponent} from "core-app/modules/boards/board/board-list/board-list.component";diff --git a/frontend/src/app/modules/boards/board/add-list-modal/add-list-modal.component.ts b/frontend/src/app/modules/boards/board/add-list-modal/add-list-modal.component.tsindex 0e132014e43..aaa62f70e2c 100644--- a/frontend/src/app/modules/boards/board/add-list-modal/add-list-modal.component.ts+++ b/frontend/src/app/modules/boards/board/add-list-modal/add-list-modal.component.ts@@ -26,10 +26,10 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpModalComponent} from "core-components/op-modals/op-modal.component";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {ChangeDetectorRef, Component, ElementRef, Inject, OnInit} from "@angular/core";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {Board} from "core-app/modules/boards/board/board";import {StateService} from "@uirouter/core";@@ -38,7 +38,7 @@ import {BoardActionsRegistryService} from "core-app/modules/boards/board/board-aimport {BoardActionService} from "core-app/modules/boards/board/board-actions/board-action.service";import {HalResource} from "core-app/modules/hal/resources/hal-resource";import {AngularTrackingHelpers} from "core-components/angular/tracking-functions";-import {CreateAutocompleterComponent} from "core-app/modules/common/autocomplete/create-autocompleter.component";+import {CreateAutocompleterComponent} from "core-app/modules/autocompleter/create-autocompleter/create-autocompleter.component.ts";import {of} from "rxjs";import {DebouncedRequestSwitchmap, errorNotificationHandler} from "core-app/helpers/rxjs/debounced-input-switchmap";import {ValueOption} from "core-app/modules/fields/edit/field-types/select-edit-field.component";diff --git a/frontend/src/app/modules/boards/board/add-list-modal/add-list-modal.html b/frontend/src/app/modules/boards/board/add-list-modal/add-list-modal.htmlindex d39113dd81d..1212b34f3da 100644--- a/frontend/src/app/modules/boards/board/add-list-modal/add-list-modal.html+++ b/frontend/src/app/modules/boards/board/add-list-modal/add-list-modal.html@@ -1,56 +1,45 @@-<div class="op-modal--portal confirm-form-submit--modal ngdialog-theme-openproject">- <div class="op-modal--modal-container confirm-dialog--modal loading-indicator--location -slim"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <a class="op-modal--modal-close-button" *ngIf="showClose">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.close_popup">- </i>- </a>- <h3 class="icon-context icon-add" [textContent]="text.title"></h3>- </div>+<div+ class="op-modal confirm-form-submit--modal loading-indicator--location"+ data-indicator-name="modal"+>+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <div class="ngdialog-body op-modal--modal-body">- <div *ngIf="showWarning && warningText"- class="notification-box -warning">- <div class="notification-box--content">- <p [innerHTML]="warningText"></p>- </div>+ <div class="op-modal--body">+ <div *ngIf="showWarning && warningText"+ class="notification-box -warning">+ <div class="notification-box--content">+ <p [innerHTML]="warningText"></p></div>+ </div>- <div class="form--field">- <div class="form--field-container">- <div class="form--select-container">- <label class="form--label" [textContent]="actionService.label"></label>- <ndc-dynamic [ndcDynamicComponent]="autocompleterComponent()"- [ndcDynamicInputs]="{ availableValues: availableValues,- typeahead: requests.input$,- appendTo: 'body',- model: '',- classes: 'new-list--action-select',- finishedLoading: true}"- [ndcDynamicOutputs]="referenceOutputs">- </ndc-dynamic>- </div>+ <div class="form--field">+ <div class="form--field-container">+ <div class="form--select-container">+ <label class="form--label" [textContent]="actionService.label"></label>+ <ndc-dynamic [ndcDynamicComponent]="autocompleterComponent()"+ [ndcDynamicInputs]="{ availableValues: availableValues,+ typeahead: requests.input$,+ appendTo: 'body',+ model: '',+ classes: 'new-list--action-select',+ finishedLoading: true}"+ [ndcDynamicOutputs]="referenceOutputs">+ </ndc-dynamic></div></div>-- </div>- <div class="op-modal--modal-footer">- <button class="button -highlight"- (click)="create()"- [disabled]="!this.selectedAttribute || inFlight"- [textContent]="text.button_add"- [attr.title]="text.button_add">- </button>- <button class="confirm-form-submit--cancel button"- (click)="closeMe($event)"- [textContent]="text.button_cancel"- [attr.title]="text.button_cancel">- </button>- </div>+ </div>+ </div>+ <div class="op-modal--footer">+ <button class="button -highlight"+ (click)="create()"+ [disabled]="!this.selectedAttribute || inFlight"+ [textContent]="text.button_add"+ [attr.title]="text.button_add">+ </button>+ <button class="confirm-form-submit--cancel button"+ (click)="closeMe($event)"+ [textContent]="text.button_cancel"+ [attr.title]="text.button_cancel">+ </button></div></div>diff --git a/frontend/src/app/modules/boards/board/board-actions/board-action.service.ts b/frontend/src/app/modules/boards/board/board-actions/board-action.service.tsindex 4e4b1737088..c2a5813ce7d 100644--- a/frontend/src/app/modules/boards/board/board-actions/board-action.service.ts+++ b/frontend/src/app/modules/boards/board/board-actions/board-action.service.ts@@ -4,7 +4,7 @@ import {HalResource} from "core-app/modules/hal/resources/hal-resource";import {ComponentType} from "@angular/cdk/portal";import {OpContextMenuItem} from "core-components/op-context-menu/op-context-menu.types";import {DisabledButtonPlaceholder} from "core-app/modules/boards/board/board-list/board-list.component";-import {CreateAutocompleterComponent} from "core-app/modules/common/autocomplete/create-autocompleter.component";+import {CreateAutocompleterComponent} from "core-app/modules/autocompleter/create-autocompleter/create-autocompleter.component.ts";import {FilterOperator} from "core-components/api/api-v3/api-v3-filter-builder";import {BoardListsService} from "core-app/modules/boards/board/board-list/board-lists.service";import {I18nService} from "core-app/modules/common/i18n/i18n.service";diff --git a/frontend/src/app/modules/boards/board/board-actions/version/version-action.service.ts b/frontend/src/app/modules/boards/board/board-actions/version/version-action.service.tsindex f418b75e531..fcb1762828c 100644--- a/frontend/src/app/modules/boards/board/board-actions/version/version-action.service.ts+++ b/frontend/src/app/modules/boards/board/board-actions/version/version-action.service.ts@@ -4,7 +4,6 @@ import {QueryResource} from "core-app/modules/hal/resources/query-resource";import {BoardActionService} from "core-app/modules/boards/board/board-actions/board-action.service";import {HalResource} from "core-app/modules/hal/resources/hal-resource";import {VersionResource} from "core-app/modules/hal/resources/version-resource";-import {VersionAutocompleterComponent} from "core-app/modules/common/autocomplete/version-autocompleter.component";import {OpContextMenuItem} from "core-components/op-context-menu/op-context-menu.types";import {LinkHandling} from "core-app/modules/common/link-handling/link-handling";import {StateService} from "@uirouter/core";@@ -14,6 +13,7 @@ import {FormResource} from "core-app/modules/hal/resources/form-resource";import {InjectField} from "core-app/helpers/angular/inject-field.decorator";import {CachedBoardActionService} from "core-app/modules/boards/board/board-actions/cached-board-action.service";import {ImageHelpers} from "core-app/helpers/images/path-helper";+import {VersionAutocompleterComponent} from "core-app/modules/autocompleter/version-autocompleter/version-autocompleter.component";@Injectable()export class BoardVersionActionService extends CachedBoardActionService {diff --git a/frontend/src/app/modules/boards/board/board-list/board-list-menu.component.ts b/frontend/src/app/modules/boards/board/board-list/board-list-menu.component.tsindex 0d76a2c9cef..fa294e187a7 100644--- a/frontend/src/app/modules/boards/board/board-list/board-list-menu.component.ts+++ b/frontend/src/app/modules/boards/board/board-list/board-list-menu.component.ts@@ -29,7 +29,7 @@import {Component, Output, EventEmitter, Input} from '@angular/core';import {I18nService} from 'core-app/modules/common/i18n/i18n.service';import {AuthorisationService} from 'core-app/modules/common/model-auth/model-auth.service';-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isolated-query-space";import {Board} from "core-app/modules/boards/board/board";import {BoardActionsRegistryService} from "core-app/modules/boards/board/board-actions/board-actions-registry.service";diff --git a/frontend/src/app/modules/boards/board/board-partitioned-page/board-list-container.component.ts b/frontend/src/app/modules/boards/board/board-partitioned-page/board-list-container.component.tsindex d0840422713..03df330fc26 100644--- a/frontend/src/app/modules/boards/board/board-partitioned-page/board-list-container.component.ts+++ b/frontend/src/app/modules/boards/board/board-partitioned-page/board-list-container.component.ts@@ -6,7 +6,7 @@ import {StateService} from "@uirouter/core";import {NotificationsService} from "core-app/modules/common/notifications/notifications.service";import {HalResourceNotificationService} from "core-app/modules/hal/services/hal-resource-notification.service";import {BoardListsService} from "core-app/modules/boards/board/board-list/board-lists.service";-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {BoardService} from "core-app/modules/boards/board/board.service";import {BannersService} from "core-app/modules/common/enterprise/banners.service";import {DragAndDropService} from "core-app/modules/common/drag-and-drop/drag-and-drop.service";diff --git a/frontend/src/app/modules/boards/board/board-video-teaser-modal/board-video-teaser-modal.component.ts b/frontend/src/app/modules/boards/board/board-video-teaser-modal/board-video-teaser-modal.component.tsindex 32ea2696afc..77da937e9b9 100644--- a/frontend/src/app/modules/boards/board/board-video-teaser-modal/board-video-teaser-modal.component.ts+++ b/frontend/src/app/modules/boards/board/board-video-teaser-modal/board-video-teaser-modal.component.ts@@ -1,8 +1,8 @@import {ChangeDetectorRef, Component, ElementRef, Inject, OnDestroy, OnInit} from '@angular/core';-import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';-import {OpModalComponent} from 'core-components/op-modals/op-modal.component';+import {OpModalLocalsMap} from 'core-app/modules/modal/modal.types';+import {OpModalComponent} from 'core-app/modules/modal/modal.component';+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {I18nService} from "core-app/modules/common/i18n/i18n.service";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {boardTeaserVideoURL} from "core-app/modules/boards/board-constants.const";import {DomSanitizer} from "@angular/platform-browser";diff --git a/frontend/src/app/modules/boards/board/configuration-modal/board-configuration.modal.html b/frontend/src/app/modules/boards/board/configuration-modal/board-configuration.modal.htmlindex fbb52c0af0b..eb67584b921 100644--- a/frontend/src/app/modules/boards/board/configuration-modal/board-configuration.modal.html+++ b/frontend/src/app/modules/boards/board/configuration-modal/board-configuration.modal.html@@ -1,45 +1,41 @@-<div class="op-modal--portal">- <div class="op-modal--modal-container -wide wp-table--configuration-modal loading-indicator--location"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <h3 [textContent]="text.title"></h3>+<div+ class="op-modal wp-table--configuration-modal loading-indicator--location"+ data-indicator-name="modal"+>+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <a class="op-modal--modal-close-button">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.closePopup">- </i>- </a>- </div>-- <div *ngIf="!!tabPortalHost"- class="content--tabs scrollable-tabs">+ <div class="op-modal--body">+ <div+ *ngIf="!!tabPortalHost"+ class="content--tabs scrollable-tabs"+ ><ul class="tabrow"><li *ngFor="let tab of availableTabs"[ngClass]="{ 'selected': currentTab && tab.name === currentTab.name }">- <a class="tab-show"- role="button"- [ngClass]="{ '-disabled': tab.disableBecause != null, 'selected': currentTab && tab.name === currentTab.name }"- [attr.title]="tab.disableBecause || tab.title"- [textContent]="tab.title"- (click)="switchTo(tab.name)"- href>- </a>+ <a+ class="tab-show"+ role="button"+ [ngClass]="{ '-disabled': tab.disableBecause != null, 'selected': currentTab && tab.name === currentTab.name }"+ [attr.title]="tab.disableBecause || tab.title"+ [textContent]="tab.title"+ (click)="switchTo(tab.name)"+ href+ ></a>+ </li></ul></div><div class="tab-content" #tabContentOutlet></div>- <div class="modal--form-actions">- <button class="button -highlight"- [textContent]="text.applyButton"- (click)="saveChanges()">- </button>- <button class="button"- [textContent]="text.cancelButton"- (click)="closeMe($event)">- </button>- </div>+ </div>++ <div class="op-modal--footer">+ <button class="button -highlight"+ [textContent]="text.applyButton"+ (click)="saveChanges()">+ </button>+ <button class="button"+ [textContent]="text.cancelButton"+ (click)="closeMe($event)">+ </button></div></div>diff --git a/frontend/src/app/modules/boards/board/configuration-modal/board-configuration.modal.ts b/frontend/src/app/modules/boards/board/configuration-modal/board-configuration.modal.tsindex 3f291b6765e..32ed9b9dfaa 100644--- a/frontend/src/app/modules/boards/board/configuration-modal/board-configuration.modal.ts+++ b/frontend/src/app/modules/boards/board/configuration-modal/board-configuration.modal.ts@@ -10,8 +10,9 @@ import {OnInit,ViewChild} from '@angular/core';-import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';-import {OpModalComponent} from 'core-components/op-modals/op-modal.component';+import {OpModalLocalsMap} from 'core-app/modules/modal/modal.types';+import {OpModalComponent} from 'core-app/modules/modal/modal.component';+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {ActiveTabInterface,TabComponent,@@ -19,7 +20,6 @@ import {TabPortalOutlet} from 'core-components/wp-table/configuration-modal/tab-portal-outlet';import {I18nService} from "core-app/modules/common/i18n/i18n.service";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {BoardConfigurationService} from "core-app/modules/boards/board/configuration-modal/board-configuration.service";import {BoardService} from "core-app/modules/boards/board/board.service";import {Board} from "core-app/modules/boards/board/board";diff --git a/frontend/src/app/modules/boards/board/configuration-modal/tabs/highlighting-tab.component.ts b/frontend/src/app/modules/boards/board/configuration-modal/tabs/highlighting-tab.component.tsindex 91de1c2e096..80de158d9f4 100644--- a/frontend/src/app/modules/boards/board/configuration-modal/tabs/highlighting-tab.component.ts+++ b/frontend/src/app/modules/boards/board/configuration-modal/tabs/highlighting-tab.component.ts@@ -1,9 +1,9 @@import {Component, Inject, Injector} from '@angular/core';import {I18nService} from 'core-app/modules/common/i18n/i18n.service';import {TabComponent} from 'core-components/wp-table/configuration-modal/tab-portal-outlet';-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {Board} from "core-app/modules/boards/board/board";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {CardHighlightingMode} from "core-components/wp-fast-table/builders/highlighting/highlighting-mode.const";@Component({diff --git a/frontend/src/app/modules/boards/board/toolbar-menu/boards-toolbar-menu.directive.ts b/frontend/src/app/modules/boards/board/toolbar-menu/boards-toolbar-menu.directive.tsindex bc2c9819ca7..3574710a343 100644--- a/frontend/src/app/modules/boards/board/toolbar-menu/boards-toolbar-menu.directive.ts+++ b/frontend/src/app/modules/boards/board/toolbar-menu/boards-toolbar-menu.directive.ts@@ -30,7 +30,7 @@ import {Directive, ElementRef, Injector, Input} from '@angular/core';import {I18nService} from 'core-app/modules/common/i18n/i18n.service';import {OpContextMenuTrigger} from 'core-components/op-context-menu/handlers/op-context-menu-trigger.directive';import {OPContextMenuService} from 'core-components/op-context-menu/op-context-menu.service';-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {Board} from "core-app/modules/boards/board/board";import {BoardConfigurationModal} from "core-app/modules/boards/board/configuration-modal/board-configuration.modal";import {BoardService} from "core-app/modules/boards/board/board.service";diff --git a/frontend/src/app/modules/boards/index-page/boards-index-page.component.ts b/frontend/src/app/modules/boards/index-page/boards-index-page.component.tsindex f8b22c1b38f..5daae5a0c43 100644--- a/frontend/src/app/modules/boards/index-page/boards-index-page.component.ts+++ b/frontend/src/app/modules/boards/index-page/boards-index-page.component.ts@@ -4,7 +4,7 @@ import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {BoardService} from "core-app/modules/boards/board/board.service";import {Board} from "core-app/modules/boards/board/board";import {NotificationsService} from "core-app/modules/common/notifications/notifications.service";-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {NewBoardModalComponent} from "core-app/modules/boards/new-board-modal/new-board-modal.component";import {BannersService} from "core-app/modules/common/enterprise/banners.service";import {LoadingIndicatorService} from "core-app/modules/common/loading-indicator/loading-indicator.service";diff --git a/frontend/src/app/modules/boards/new-board-modal/new-board-modal.component.ts b/frontend/src/app/modules/boards/new-board-modal/new-board-modal.component.tsindex 473a339650c..65eae25631f 100644--- a/frontend/src/app/modules/boards/new-board-modal/new-board-modal.component.ts+++ b/frontend/src/app/modules/boards/new-board-modal/new-board-modal.component.ts@@ -26,10 +26,10 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpModalComponent} from "core-components/op-modals/op-modal.component";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {ChangeDetectorRef, Component, ElementRef, Inject, ViewChild} from "@angular/core";-import {OpModalLocalsMap} from "core-components/op-modals/op-modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {BoardType} from "core-app/modules/boards/board/board";import {StateService} from "@uirouter/core";diff --git a/frontend/src/app/modules/boards/new-board-modal/new-board-modal.html b/frontend/src/app/modules/boards/new-board-modal/new-board-modal.htmlindex 18da0ed6a62..0f72faacbc2 100644--- a/frontend/src/app/modules/boards/new-board-modal/new-board-modal.html+++ b/frontend/src/app/modules/boards/new-board-modal/new-board-modal.html@@ -1,27 +1,17 @@-<div class="op-modal--portal confirm-form-submit--modal ngdialog-theme-openproject">- <div class="op-modal--modal-container confirm-dialog--modal loading-indicator--location"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <a class="op-modal--modal-close-button" *ngIf="showClose">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.close_popup">- </i>- </a>- <h3 class="icon-context icon-add" [textContent]="text.board_type"></h3>- </div>+<div+ class="op-modal confirm-form-submit--modal loading-indicator--location"+ data-indicator-name="modal"+>+ <op-modal-header (close)="closeMe($event)">{{text.board_type}}</op-modal-header>- <div class="ngdialog-body op-modal--modal-body">- <p [textContent]="text.select_board_type"></p>- <section class="new-board--section">- <tile-view- [tiles]="available"- [disable]="inFlight"- (create)="createBoard($event)">- </tile-view>- </section>- </div>+ <div class="op-modal--body">+ <p [textContent]="text.select_board_type"></p>+ <section class="new-board--section">+ <tile-view+ [tiles]="available"+ [disable]="inFlight"+ (create)="createBoard($event)">+ </tile-view>+ </section></div></div>\ No newline at end of filediff --git a/frontend/src/app/modules/boards/openproject-boards.module.ts b/frontend/src/app/modules/boards/openproject-boards.module.tsindex f2d5a5ac914..82e44ad74f4 100644--- a/frontend/src/app/modules/boards/openproject-boards.module.ts+++ b/frontend/src/app/modules/boards/openproject-boards.module.ts@@ -29,6 +29,7 @@import {NgModule} from '@angular/core';import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module";import {OpenprojectWorkPackagesModule} from "core-app/modules/work_packages/openproject-work-packages.module";+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";import {UIRouterModule} from "@uirouter/angular";import {BoardListComponent} from "core-app/modules/boards/board/board-list/board-list.component";import {BoardsRootComponent} from "core-app/modules/boards/boards-root/boards-root.component";@@ -60,6 +61,7 @@ import {StatusBoardHeaderComponent} from "core-app/modules/boards/board/board-acimports: [OpenprojectCommonModule,OpenprojectWorkPackagesModule,+ OpenprojectModalModule,DragScrollModule,// Dynamic Module for actionsdiff --git a/frontend/src/app/modules/common/export-options/export-options.sass b/frontend/src/app/modules/common/export-options/export-options.sassnew file mode 100644index 00000000000..ae212558e6a--- /dev/null+++ b/frontend/src/app/modules/common/export-options/export-options.sass@@ -0,0 +1,26 @@+.op-export-options+ display: flex+ flex-wrap: wrap+ margin: 0+ padding: 20px 0+ list-style-type: none++ &--option+ flex: 1 1 calc(33% - 40px) // line break after third element+ margin: 20px+ text-align: center++ &-link+ cursor: pointer+ text-decoration: none+ color: var(--body-font-color)+ font-weight: normal+ overflow-wrap: break-word+ word-wrap: break-word+ &:hover, &:active+ text-decoration: none+ color: var(--body-font-color)++ &-label+ display: block+ padding: 10px 0 0 0diff --git a/frontend/src/app/modules/common/form-field/form-binding.directive.ts b/frontend/src/app/modules/common/form-field/form-binding.directive.tsnew file mode 100644index 00000000000..e36d40d6438--- /dev/null+++ b/frontend/src/app/modules/common/form-field/form-binding.directive.ts@@ -0,0 +1,26 @@+import {+ Directive,+ forwardRef,+ Input,+} from '@angular/core';+import {+ NgControl,+ FormControl,+ FormGroup,+} from '@angular/forms';++export const formControlBinding:any = {+ provide: NgControl,+ useExisting: forwardRef(() => OpFormBindingDirective)+};++@Directive({selector: '[opFormBinding]', providers: [formControlBinding], exportAs: 'ngForm'})+export class OpFormBindingDirective extends NgControl {+ @Input('opFormBinding') form!:FormControl|FormGroup;++ get control():FormControl|FormGroup {+ return this.form;+ }++ viewToModelUpdate():void {}+}diff --git a/frontend/src/app/modules/common/form-field/form-field.children.sass b/frontend/src/app/modules/common/form-field/form-field.children.sassnew file mode 100644index 00000000000..8dc96aa01d8--- /dev/null+++ b/frontend/src/app/modules/common/form-field/form-field.children.sass@@ -0,0 +1,4 @@+.op-form-field_invalid+ .ng-select-container,+ .op-input+ border-color: var(--content-form-error-color)diff --git a/frontend/src/app/modules/common/form-field/form-field.component.html b/frontend/src/app/modules/common/form-field/form-field.component.htmlnew file mode 100644index 00000000000..cef9a992c96--- /dev/null+++ b/frontend/src/app/modules/common/form-field/form-field.component.html@@ -0,0 +1,21 @@+<label class="op-form-field--label-wrap">+ <div class="op-form-field--label">+ {{ label }}+ <span *ngIf="required" class="op-form-field--label-indicator">*</span>+ </div>+ <div class="op-form-field--description">+ <ng-content select="[slot=description]"></ng-content>+ </div>+ <div class="op-form-field--input">+ <ng-content select="[slot=input]"></ng-content>+ </div>+ <div class="op-form-field--help-text">+ <ng-content select="[slot=help-text]"></ng-content>+ </div>+</label>+<div+ class="op-form-field--errors"+ *ngIf="isInvalid"+>+ <ng-content select="[slot=errors]"></ng-content>+</div>diff --git a/frontend/src/app/modules/common/form-field/form-field.component.sass b/frontend/src/app/modules/common/form-field/form-field.component.sassnew file mode 100644index 00000000000..4d69d381781--- /dev/null+++ b/frontend/src/app/modules/common/form-field/form-field.component.sass@@ -0,0 +1,41 @@+@import './form-field.children'++.op-form-field+ display: flex+ flex-direction: column++ &--label,+ &--description,+ &--input,+ &--help-text+ margin-bottom: 0.5rem++ &--label-wrap+ display: flex+ flex-direction: column+ margin: 0++ &--label+ font-size: 14px+ font-weight: bold+ line-height: 1.2++ &-indicator+ color: var(--primary-color)++ &_invalid &--label+ color: var(--content-form-error-color)++ &--input++ &--description,+ &--help-text+ font-size: 12px++ &--errors+ display: flex+ flex-direction: column++ &--error+ color: var(--content-form-error-color)+ margin-top: 1remdiff --git a/frontend/src/app/modules/common/form-field/form-field.component.ts b/frontend/src/app/modules/common/form-field/form-field.component.tsnew file mode 100644index 00000000000..dbb444bcb95--- /dev/null+++ b/frontend/src/app/modules/common/form-field/form-field.component.ts@@ -0,0 +1,29 @@+import {+ Component,+ Input,+ HostBinding,+ ContentChild,+} from "@angular/core";+import {+ NgControl+} from "@angular/forms";++@Component({+ selector: 'op-form-field',+ templateUrl: './form-field.component.html',+})+export class OpFormFieldComponent {+ @HostBinding('class.op-form-field') className = true;+ @HostBinding('class.op-form-field_invalid') get errorClassName() {+ return this.isInvalid;+ }++ @Input() label:string = '';+ @Input() required:boolean = false;++ @ContentChild(NgControl) control:NgControl;++ get isInvalid() {+ return this.control?.touched && this.control?.invalid;+ }+}diff --git a/frontend/src/app/modules/common/form-field/form-field.sass b/frontend/src/app/modules/common/form-field/form-field.sassnew file mode 100644index 00000000000..356b89532ec--- /dev/null+++ b/frontend/src/app/modules/common/form-field/form-field.sass@@ -0,0 +1,39 @@+@import './form-field.children'++.op-form-field+ display: flex+ flex-direction: column++ &--label,+ &--description,+ &--input,+ &--help-text+ margin-bottom: 0.5rem++ &--label-wrap+ display: flex+ flex-direction: column+ margin: 0++ &--label+ font-size: 14px+ font-weight: bold+ line-height: 1.2++ &-indicator+ color: var(--primary-color)++ &_invalid &--label+ color: var(--content-form-error-color)++ &--description,+ &--help-text+ font-size: 12px++ &--errors+ display: flex+ flex-direction: column++ &--error+ color: var(--content-form-error-color)+ margin-top: 1remdiff --git a/frontend/src/app/modules/common/i18n/i18n.service.ts b/frontend/src/app/modules/common/i18n/i18n.service.tsindex 8f4430a4afd..e54216d2e2f 100644--- a/frontend/src/app/modules/common/i18n/i18n.service.ts+++ b/frontend/src/app/modules/common/i18n/i18n.service.ts@@ -1,4 +1,5 @@import {Injectable} from "@angular/core";+import {Observable, combineLatest} from "rxjs";/*** General componentsdiff --git a/frontend/src/app/modules/common/icon/op-icon.ts b/frontend/src/app/modules/common/icon/icon.component.tssimilarity index 98%rename from frontend/src/app/modules/common/icon/op-icon.tsrename to frontend/src/app/modules/common/icon/icon.component.tsindex e688dcfca38..9f4ab25ffe6 100644--- a/frontend/src/app/modules/common/icon/op-icon.ts+++ b/frontend/src/app/modules/common/icon/icon.component.ts@@ -41,7 +41,7 @@ import {Component, Input} from '@angular/core';*ngIf="iconTitle"></span>`})-export class OpIcon {+export class OpIconComponent {@Input('icon-classes') iconClasses:string;@Input('icon-title') iconTitle:string = '';}diff --git a/frontend/src/app/modules/common/icon/op-icon.spec.ts b/frontend/src/app/modules/common/icon/op-icon.spec.tsindex bfa1b077a59..71ea55a841d 100644--- a/frontend/src/app/modules/common/icon/op-icon.spec.ts+++ b/frontend/src/app/modules/common/icon/op-icon.spec.ts@@ -27,26 +27,26 @@//++import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";-import {OpIcon} from "core-app/modules/common/icon/op-icon";import {By} from "@angular/platform-browser";import {DebugElement} from "@angular/core";+import {OpIconComponent} from "core-app/modules/common/icon/icon.component";describe('opIcon Directive', function() {- let app:OpIcon;- let fixture:ComponentFixture<OpIcon>;+ let app:OpIconComponent;+ let fixture:ComponentFixture<OpIconComponent>;let element:DebugElement;beforeEach(waitForAsync(() => {// noinspection JSIgnoredPromiseFromCallTestBed.configureTestingModule({declarations: [- OpIcon+ OpIconComponent]}).compileComponents();}));beforeEach(() => {- fixture = TestBed.createComponent(OpIcon);+ fixture = TestBed.createComponent(OpIconComponent);app = fixture.debugElement.componentInstance;element = fixture.debugElement;diff --git a/frontend/src/app/modules/common/input/input.component.sass b/frontend/src/app/modules/common/input/input.component.sassnew file mode 100644index 00000000000..c54b0ba1b2d--- /dev/null+++ b/frontend/src/app/modules/common/input/input.component.sass@@ -0,0 +1,5 @@+.op-input+ background: white+ border: 1px solid #e2e8f0+ border-radius: 2px+ display: flexdiff --git a/frontend/src/app/modules/common/input/input.sass b/frontend/src/app/modules/common/input/input.sassnew file mode 100644index 00000000000..c54b0ba1b2d--- /dev/null+++ b/frontend/src/app/modules/common/input/input.sass@@ -0,0 +1,5 @@+.op-input+ background: white+ border: 1px solid #e2e8f0+ border-radius: 2px+ display: flexdiff --git a/frontend/src/app/modules/common/modal/modal-heading.component.html b/frontend/src/app/modules/common/modal/modal-heading.component.htmlnew file mode 100644index 00000000000..7338c9ea9c9--- /dev/null+++ b/frontend/src/app/modules/common/modal/modal-heading.component.html@@ -0,0 +1,11 @@+<h3>+ <ng-content></ng-content>+</h3>+<button+ class="op-modal--close-button"+ type="button"+ (click)="close.emit()"+ [attr.aria-label]="text.closePopup"+>+ <span class="icon-close"></span>+</button>diff --git a/frontend/src/app/modules/common/modal/modal-heading.component.ts b/frontend/src/app/modules/common/modal/modal-heading.component.tsnew file mode 100644index 00000000000..02c9083aefd--- /dev/null+++ b/frontend/src/app/modules/common/modal/modal-heading.component.ts@@ -0,0 +1,24 @@+import {+ Component,+ EventEmitter,+ Output,+ HostBinding,+} from '@angular/core';+import {I18nService} from "core-app/modules/common/i18n/i18n.service";++@Component({+ selector: 'op-modal-heading',+ templateUrl: './modal-heading.component.html',+})+export class OpModalHeadingComponent {+ @HostBinding('class.op-modal--heading') className = true;+ @Output('close') close = new EventEmitter<void>();++ public text = {+ closePopup: this.I18n.t('js.close_popup_title'),+ };++ constructor(+ readonly I18n:I18nService,+ ) {}+}diff --git a/frontend/src/app/modules/common/modal/modal.component.sass b/frontend/src/app/modules/common/modal/modal.component.sassnew file mode 100644index 00000000000..999a86f0a3c--- /dev/null+++ b/frontend/src/app/modules/common/modal/modal.component.sass@@ -0,0 +1,26 @@+.op-modal+ display: flex+ background: white++ &--heading+ display: flex+ padding-top: 1rem+ flex-direction: column+ position: relative++ &--close-button+ position: absolute+ right: 0px+ top: 0px+ height: 2rem+ width: 2rem+ display: flex+ justify-content: center+ align-items: center+ cursor: pointer+ color: var(--body-font-color)+ background: transparent+ border: 0+ &:hover+ text-decoration: none+ color: var(--content-link-color)diff --git a/frontend/src/app/modules/common/openproject-common.module.sass b/frontend/src/app/modules/common/openproject-common.module.sassnew file mode 100644index 00000000000..5a70bbc8c21--- /dev/null+++ b/frontend/src/app/modules/common/openproject-common.module.sass@@ -0,0 +1,5 @@+@import './input/input'+@import './form-field/form-field'+@import './option-list/option-list'+@import './export-options/export-options'+@import './modal/modal.component'diff --git a/frontend/src/app/modules/common/openproject-common.module.ts b/frontend/src/app/modules/common/openproject-common.module.tsindex 359e82419cb..6684c482441 100644--- a/frontend/src/app/modules/common/openproject-common.module.ts+++ b/frontend/src/app/modules/common/openproject-common.module.ts@@ -28,65 +28,62 @@import {FormsModule} from '@angular/forms';import {Injector, NgModule} from '@angular/core';+import {NgSelectModule} from '@ng-select/ng-select';+import {DragDropModule} from '@angular/cdk/drag-drop';+import {PortalModule} from '@angular/cdk/portal';+import {CommonModule} from '@angular/common';+import {NgOptionHighlightModule} from '@ng-select/ng-option-highlight';+import {DragulaModule} from 'ng2-dragula';+import {DynamicModule} from 'ng-dynamic-component';+import {StateService, UIRouterModule} from '@uirouter/angular';-import {AuthoringComponent} from 'core-app/modules/common/authoring/authoring.component';-import {OpDateTimeComponent} from 'core-app/modules/common/date/op-date-time.component';-import {OpIcon} from 'core-app/modules/common/icon/op-icon';-import {NotificationComponent} from 'core-app/modules/common/notifications/notification.component';-import {NotificationsContainerComponent} from 'core-app/modules/common/notifications/notifications-container.component';-import {UploadProgressComponent} from 'core-app/modules/common/notifications/upload-progress.component';-import {OpDatePickerComponent} from 'core-app/modules/common/op-date-picker/op-date-picker.component';-import {FocusWithinDirective} from 'core-app/modules/common/focus/focus-within.directive';-import {OpenprojectAccessibilityModule} from 'core-app/modules/a11y/openproject-a11y.module';-import {FocusDirective} from 'core-app/modules/common/focus/focus.directive';-import {HighlightColDirective} from 'core-app/modules/common/highlight-col/highlight-col.directive';-import {CopyToClipboardDirective} from 'core-app/modules/common/copy-to-clipboard/copy-to-clipboard.directive';-import {highlightColBootstrap} from './highlight-col/highlight-col.directive';import {HookService} from '../plugins/hook-service';-import {ColorsAutocompleter} from 'core-app/modules/common/colors/colors-autocompleter.component';-import {ResizerComponent} from 'core-app/modules/common/resizer/resizer.component';++import {OpenprojectAccessibilityModule} from 'core-app/modules/a11y/openproject-a11y.module';++import {IconTriggeredContextMenuComponent} from 'core-components/op-context-menu/icon-triggered-context-menu/icon-triggered-context-menu.component';+import {CurrentProjectService} from 'core-components/projects/current-project.service';+import {CurrentUserService} from 'core-components/user/current-user.service';import {TablePaginationComponent} from 'core-components/table-pagination/table-pagination.component';import {SortHeaderDirective} from 'core-components/wp-table/sort-header/sort-header.directive';import {ZenModeButtonComponent} from 'core-components/wp-buttons/zen-mode-toggle-button/zen-mode-toggle-button.component';import {OPContextMenuComponent} from 'core-components/op-context-menu/op-context-menu.component';-import {StateService, UIRouterModule} from '@uirouter/angular';-import {PortalModule} from '@angular/cdk/portal';-import {CommonModule} from '@angular/common';-import {CollapsibleSectionComponent} from 'core-app/modules/common/collapsible-section/collapsible-section.component';-import {NoResultsComponent} from 'core-app/modules/common/no-results/no-results.component';-import {DragDropModule} from '@angular/cdk/drag-drop';-import {UserAutocompleterComponent} from 'app/modules/common/autocomplete/user-autocompleter.component';-import {ScrollableTabsComponent} from 'core-app/modules/common/tabs/scrollable-tabs/scrollable-tabs.component';-import {ContentTabsComponent} from 'core-app/modules/common/tabs/content-tabs/content-tabs.component';-import {EditableToolbarTitleComponent} from 'core-app/modules/common/editable-toolbar-title/editable-toolbar-title.component';import {UserAvatarComponent} from 'core-components/user/user-avatar/user-avatar.component';import {EnterpriseBannerComponent} from 'core-components/enterprise-banner/enterprise-banner.component';import {EnterpriseBannerBootstrapComponent} from 'core-components/enterprise-banner/enterprise-banner-bootstrap.component';-import {DynamicModule} from 'ng-dynamic-component';-import {VersionAutocompleterComponent} from 'core-app/modules/common/autocomplete/version-autocompleter.component';-import {CreateAutocompleterComponent} from 'core-app/modules/common/autocomplete/create-autocompleter.component';import {HomescreenNewFeaturesBlockComponent} from 'core-components/homescreen/blocks/new-features.component';import {BoardVideoTeaserModalComponent} from 'core-app/modules/boards/board/board-video-teaser-modal/board-video-teaser-modal.component';-import {PersistentToggleComponent} from 'core-app/modules/common/persistent-toggle/persistent-toggle.component';-import {AutocompleteSelectDecorationComponent} from 'core-app/modules/common/autocomplete/autocomplete-select-decoration.component';-import {AddSectionDropdownComponent} from 'core-app/modules/common/hide-section/add-section-dropdown/add-section-dropdown.component';-import {HideSectionLinkComponent} from 'core-app/modules/common/hide-section/hide-section-link/hide-section-link.component';-import {RemoteFieldUpdaterComponent} from 'core-app/modules/common/remote-field-updater/remote-field-updater.component';-import {AutofocusDirective} from 'core-app/modules/common/autofocus/autofocus.directive';-import {ShowSectionDropdownComponent} from 'core-app/modules/common/hide-section/show-section-dropdown.component';-import {IconTriggeredContextMenuComponent} from 'core-components/op-context-menu/icon-triggered-context-menu/icon-triggered-context-menu.component';-import {NgSelectModule} from '@ng-select/ng-select';-import {NgOptionHighlightModule} from '@ng-select/ng-option-highlight';-import {CurrentProjectService} from 'core-components/projects/current-project.service';-import {CurrentUserService} from 'core-components/user/current-user.service';-import {WorkPackageAutocompleterComponent} from 'core-app/modules/common/autocomplete/wp-autocompleter.component';-import {TimeEntryWorkPackageAutocompleterComponent} from 'core-app/modules/common/autocomplete/te-work-package-autocompleter.component';-import {DraggableAutocompleteComponent} from 'core-app/modules/common/draggable-autocomplete/draggable-autocomplete.component';-import {DragulaModule} from 'ng2-dragula';-import {SlideToggleComponent} from 'core-app/modules/common/slide-toggle/slide-toggle.component';-import {DynamicBootstrapModule} from 'core-app/modules/common/dynamic-bootstrap/dynamic-bootstrap.module';-import {PrincipalRendererService} from "core-app/modules/common/principal/principal-renderer.service";-import {OpPrincipalComponent} from "core-app/modules/common/principal/op-principal.component";++import {highlightColBootstrap} from './highlight-col/highlight-col.directive';+import {FocusDirective} from './focus/focus.directive';+import {HighlightColDirective} from './highlight-col/highlight-col.directive';+import {CopyToClipboardDirective} from './copy-to-clipboard/copy-to-clipboard.directive';+import {AuthoringComponent} from './authoring/authoring.component';+import {OpDateTimeComponent} from './date/op-date-time.component';+import {NotificationComponent} from './notifications/notification.component';+import {NotificationsContainerComponent} from './notifications/notifications-container.component';+import {UploadProgressComponent} from './notifications/upload-progress.component';+import {OpDatePickerComponent} from './op-date-picker/op-date-picker.component';+import {FocusWithinDirective} from './focus/focus-within.directive';+import {ResizerComponent} from './resizer/resizer.component';+import {CollapsibleSectionComponent} from './collapsible-section/collapsible-section.component';+import {NoResultsComponent} from './no-results/no-results.component';+import {ScrollableTabsComponent} from './tabs/scrollable-tabs/scrollable-tabs.component';+import {ContentTabsComponent} from './tabs/content-tabs/content-tabs.component';+import {EditableToolbarTitleComponent} from './editable-toolbar-title/editable-toolbar-title.component';+import {PersistentToggleComponent} from './persistent-toggle/persistent-toggle.component';+import {AddSectionDropdownComponent} from './hide-section/add-section-dropdown/add-section-dropdown.component';+import {HideSectionLinkComponent} from './hide-section/hide-section-link/hide-section-link.component';+import {RemoteFieldUpdaterComponent} from './remote-field-updater/remote-field-updater.component';+import {AutofocusDirective} from './autofocus/autofocus.directive';+import {ShowSectionDropdownComponent} from './hide-section/show-section-dropdown.component';+import {SlideToggleComponent} from './slide-toggle/slide-toggle.component';+import {DynamicBootstrapModule} from './dynamic-bootstrap/dynamic-bootstrap.module';+import {OpPrincipalComponent} from './principal/op-principal.component';+import {OpFormFieldComponent} from './form-field/form-field.component';+import {OpFormBindingDirective} from './form-field/form-binding.directive';+import {OpOptionListComponent} from './option-list/option-list.component';+import {OpIconComponent} from './icon/icon.component';export function bootstrapModule(injector:Injector) {// Ensure error reporter is run@@ -131,12 +128,6 @@ export function bootstrapModule(injector:Injector) {NgSelectModule,NgOptionHighlightModule,- DynamicModule.withComponents([- VersionAutocompleterComponent,- WorkPackageAutocompleterComponent,- TimeEntryWorkPackageAutocompleterComponent,- CreateAutocompleterComponent]),-DynamicBootstrapModule,],exports: [@@ -154,7 +145,6 @@ export function bootstrapModule(injector:Injector) {OpDatePickerComponent,OpDateTimeComponent,- OpIcon,AutofocusDirective,FocusWithinDirective,@@ -182,8 +172,6 @@ export function bootstrapModule(injector:Injector) {NoResultsComponent,- UserAutocompleterComponent,-ScrollableTabsComponent,EditableToolbarTitleComponent,@@ -196,19 +184,19 @@ export function bootstrapModule(injector:Injector) {DynamicModule,- WorkPackageAutocompleterComponent,-- DraggableAutocompleteComponent,-// filterSlideToggleComponent,OpPrincipalComponent,++ OpFormFieldComponent,+ OpFormBindingDirective,+ OpOptionListComponent,+ OpIconComponent,],declarations: [OpDatePickerComponent,OpDateTimeComponent,- OpIcon,AutofocusDirective,FocusWithinDirective,@@ -232,8 +220,6 @@ export function bootstrapModule(injector:Injector) {CollapsibleSectionComponent,CopyToClipboardDirective,- ColorsAutocompleter,-ResizerComponent,TablePaginationComponent,@@ -244,8 +230,6 @@ export function bootstrapModule(injector:Injector) {NoResultsComponent,- UserAutocompleterComponent,-ScrollableTabsComponent,ContentTabsComponent,@@ -256,7 +240,6 @@ export function bootstrapModule(injector:Injector) {OpPrincipalComponent,PersistentToggleComponent,- AutocompleteSelectDecorationComponent,HideSectionLinkComponent,ShowSectionDropdownComponent,AddSectionDropdownComponent,@@ -266,18 +249,18 @@ export function bootstrapModule(injector:Injector) {EnterpriseBannerComponent,EnterpriseBannerBootstrapComponent,- // Autocompleter- CreateAutocompleterComponent,- VersionAutocompleterComponent,- WorkPackageAutocompleterComponent,- TimeEntryWorkPackageAutocompleterComponent,- DraggableAutocompleteComponent,+HomescreenNewFeaturesBlockComponent,BoardVideoTeaserModalComponent,//filterSlideToggleComponent,++ OpFormFieldComponent,+ OpFormBindingDirective,+ OpOptionListComponent,+ OpIconComponent,]})export class OpenprojectCommonModule {diff --git a/frontend/src/app/modules/common/option-list/option-list.component.html b/frontend/src/app/modules/common/option-list/option-list.component.htmlnew file mode 100644index 00000000000..5c286eaf1ae--- /dev/null+++ b/frontend/src/app/modules/common/option-list/option-list.component.html@@ -0,0 +1,19 @@+<label+ *ngFor="let option of options"+ [class]="{ 'op-option-list--item': true, 'op-option-list--item_selected': selected === option.value }"+>+ <input+ type="radio"+ [attr.name]="name"+ [value]="option.value"+ [(ngModel)]="selected"+ class="op-option-list--input"+ />+ <div>+ <p class="op-option-list--item-title">{{ option.title }}</p>+ <p+ *ngIf="option.description"+ class="op-option-list--item-description"+ >{{ option.description }}</p>+ </div>+</label>diff --git a/frontend/src/app/modules/common/option-list/option-list.component.sass b/frontend/src/app/modules/common/option-list/option-list.component.sassnew file mode 100644index 00000000000..c8a11529517--- /dev/null+++ b/frontend/src/app/modules/common/option-list/option-list.component.sass@@ -0,0 +1,36 @@+.op-option-list+ display: flex+ flex-direction: column+ font-size: 1rem++ // TODO: remove the [type] selector once globally overwriting styles are removed+ &--input[type]+ margin: 0+ margin-right: 0.5rem++ &--item+ padding: 1rem 1rem 0.5rem 0.75rem+ display: flex+ border: 1px solid #cbd5e0+ background: #f7fafc+ border-radius: 4px++ &:not(:last-child)+ margin-bottom: 0.5rem++ &_selected+ border: 1px solid #90cdf4+ background: #ebf8ff++ &-title,+ &-description+ margin: 0+ margin-bottom: 0.5rem+ line-height: 1.2++ &-title+ font-weight: bold+ font-size: 14px++ &-description+ font-size: 12pxdiff --git a/frontend/src/app/modules/common/option-list/option-list.component.ts b/frontend/src/app/modules/common/option-list/option-list.component.tsnew file mode 100644index 00000000000..639c0732bc8--- /dev/null+++ b/frontend/src/app/modules/common/option-list/option-list.component.ts@@ -0,0 +1,62 @@+import {+ Component,+ Input,+ Output,+ EventEmitter,+ HostBinding,+ forwardRef,+} from "@angular/core";+import {+ ControlValueAccessor,+ NG_VALUE_ACCESSOR,+} from "@angular/forms";++export interface IOpOptionListOption<T> {+ value:T;+ title:string;+ description?:string;+}++export type IOpOptionListValue<T> = T|null;++@Component({+ // Style is imported globally+ templateUrl: './option-list.component.html',+ selector: 'op-option-list',+ providers: [{+ provide: NG_VALUE_ACCESSOR,+ useExisting: forwardRef(() => OpOptionListComponent),+ multi: true,+ }],+})+export class OpOptionListComponent<T> implements ControlValueAccessor {+ @HostBinding('class.op-option-list') className = true;++ @Input() options:IOpOptionListOption<T>[] = [];+ @Input() name:string = `op-option-list-${+(new Date())}`;+ @Output() selectedChange = new EventEmitter<T>();++ private _selected:IOpOptionListValue<T> = null;+ get selected() {+ return this._selected;+ }+ set selected(value:IOpOptionListValue<T>) {+ this._selected = value;+ this.onChange(value);+ }++ onChange = (_:IOpOptionListValue<T>) => {};+ onTouched = (_:IOpOptionListValue<T>) => {};++ writeValue(value:IOpOptionListValue<T>) {+ this._selected = value;+ }++ registerOnChange(fn:any) {+ this.onChange = fn;+ }++ registerOnTouched(fn:any) {+ this.onTouched = fn;+ }+}diff --git a/frontend/src/app/modules/common/option-list/option-list.sass b/frontend/src/app/modules/common/option-list/option-list.sassnew file mode 100644index 00000000000..c8a11529517--- /dev/null+++ b/frontend/src/app/modules/common/option-list/option-list.sass@@ -0,0 +1,36 @@+.op-option-list+ display: flex+ flex-direction: column+ font-size: 1rem++ // TODO: remove the [type] selector once globally overwriting styles are removed+ &--input[type]+ margin: 0+ margin-right: 0.5rem++ &--item+ padding: 1rem 1rem 0.5rem 0.75rem+ display: flex+ border: 1px solid #cbd5e0+ background: #f7fafc+ border-radius: 4px++ &:not(:last-child)+ margin-bottom: 0.5rem++ &_selected+ border: 1px solid #90cdf4+ background: #ebf8ff++ &-title,+ &-description+ margin: 0+ margin-bottom: 0.5rem+ line-height: 1.2++ &-title+ font-weight: bold+ font-size: 14px++ &-description+ font-size: 12pxdiff --git a/frontend/src/app/modules/common/path-helper/path-helper.service.ts b/frontend/src/app/modules/common/path-helper/path-helper.service.tsindex d74cb02afc9..47e5bd1a593 100644--- a/frontend/src/app/modules/common/path-helper/path-helper.service.ts+++ b/frontend/src/app/modules/common/path-helper/path-helper.service.ts@@ -28,7 +28,6 @@import {Injectable} from '@angular/core';import {ApiV3FilterBuilder} from "core-components/api/api-v3/api-v3-filter-builder";-import {HalResource} from "core-app/modules/hal/resources/hal-resource";class Apiv3Paths {readonly apiV3Base:string;@@ -245,6 +244,14 @@ export class PathHelperService {return `${this.groupsPath()}/${id}`;}+ public rolesPath() {+ return `${this.staticBase}/roles`;+ }++ public rolePath(id:string|number) {+ return `${this.rolesPath()}/${id}`;+ }+public versionsPath() {return `${this.staticBase}/versions`;}diff --git a/frontend/src/app/modules/editor/openproject-editor.module.ts b/frontend/src/app/modules/editor/openproject-editor.module.tsindex 40c2ba94c55..22e8dfd4806 100644--- a/frontend/src/app/modules/editor/openproject-editor.module.ts+++ b/frontend/src/app/modules/editor/openproject-editor.module.ts@@ -27,23 +27,25 @@//++import {NgModule} from '@angular/core';+import {FormsModule} from '@angular/forms';+import {CommonModule} from "@angular/common";+import {OpenprojectAttachmentsModule} from 'core-app/modules/attachments/openproject-attachments.module';+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";import {WikiIncludePageMacroModal} from 'core-components/modals/editor/macro-wiki-include-page-modal/wiki-include-page-macro.modal';import {CodeBlockMacroModal} from 'core-components/modals/editor/macro-code-block-modal/code-block-macro.modal';import {ChildPagesMacroModal} from 'core-components/modals/editor/macro-child-pages-modal/child-pages-macro.modal';import {CkeditorAugmentedTextareaComponent} from 'core-app/ckeditor/ckeditor-augmented-textarea.component';-import {OpenprojectAttachmentsModule} from 'core-app/modules/attachments/openproject-attachments.module';import {OpCkeditorComponent} from 'core-app/modules/common/ckeditor/op-ckeditor.component';-import {FormsModule} from '@angular/forms';import {EditorMacrosService} from 'core-components/modals/editor/editor-macros.service';import {CKEditorSetupService} from 'core-app/modules/common/ckeditor/ckeditor-setup.service';import {CKEditorPreviewService} from 'core-app/modules/common/ckeditor/ckeditor-preview.service';-import {CommonModule} from "@angular/common";@NgModule({imports: [FormsModule,CommonModule,- OpenprojectAttachmentsModule+ OpenprojectAttachmentsModule,+ OpenprojectModalModule,],providers: [// CKEditordiff --git a/frontend/src/app/modules/fields/edit/edit-field.component.ts b/frontend/src/app/modules/fields/edit/edit-field.component.tsindex 881ab1e350d..013d81a3854 100644--- a/frontend/src/app/modules/fields/edit/edit-field.component.ts+++ b/frontend/src/app/modules/fields/edit/edit-field.component.ts@@ -41,6 +41,7 @@ import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {Field, IFieldSchema} from "core-app/modules/fields/field.base";import {ResourceChangeset} from "core-app/modules/fields/changeset/resource-changeset";import {HalResource} from "core-app/modules/hal/resources/hal-resource";+import {CurrentProjectService} from 'core-components/projects/current-project.service';export const OpEditingPortalSchemaToken = new InjectionToken('editing-portal--schema');export const OpEditingPortalHandlerToken = new InjectionToken('editing-portal--handler');diff --git a/frontend/src/app/modules/fields/edit/edit-field.initializer.ts b/frontend/src/app/modules/fields/edit/edit-field.initializer.tsindex 820c35628bc..004686d5ac8 100644--- a/frontend/src/app/modules/fields/edit/edit-field.initializer.ts+++ b/frontend/src/app/modules/fields/edit/edit-field.initializer.ts@@ -39,12 +39,12 @@ import {DateEditFieldComponent} from "core-app/modules/fields/edit/field-types/dimport {FormattableEditFieldComponent} from "core-app/modules/fields/edit/field-types/formattable-edit-field.component";import {WorkPackageCommentFieldComponent} from "core-components/work-packages/work-package-comment/wp-comment-field.component";import {SelectAutocompleterRegisterService} from "core-app/modules/fields/edit/field-types/select-autocompleter-register.service";-import {VersionAutocompleterComponent} from "core-app/modules/common/autocomplete/version-autocompleter.component";import {ProjectStatusEditFieldComponent} from "core-app/modules/fields/edit/field-types/project-status-edit-field.component";import {PlainFormattableEditFieldComponent} from "core-app/modules/fields/edit/field-types/plain-formattable-edit-field.component";-import {WorkPackageAutocompleterComponent} from "core-app/modules/common/autocomplete/wp-autocompleter.component";import {TimeEntryWorkPackageEditFieldComponent} from "core-app/modules/fields/edit/field-types/te-work-package-edit-field.component";import {CombinedDateEditFieldComponent} from "core-app/modules/fields/edit/field-types/combined-date-edit-field.component";+import {VersionAutocompleterComponent} from "core-app/modules/autocompleter/version-autocompleter/version-autocompleter.component";+import {WorkPackageAutocompleterComponent} from "core-app/modules/autocompleter/work-package-autocompleter/wp-autocompleter.component";export function initializeCoreEditFields(editFieldService:EditFieldService, selectAutocompleterRegisterService:SelectAutocompleterRegisterService) {diff --git a/frontend/src/app/modules/fields/edit/field-types/combined-date-edit-field.component.ts b/frontend/src/app/modules/fields/edit/field-types/combined-date-edit-field.component.tsindex e18905be3f8..8eeda05870c 100644--- a/frontend/src/app/modules/fields/edit/field-types/combined-date-edit-field.component.ts+++ b/frontend/src/app/modules/fields/edit/field-types/combined-date-edit-field.component.ts@@ -30,10 +30,10 @@ import {Component, OnDestroy, OnInit} from "@angular/core";import {TimezoneService} from "core-components/datetime/timezone.service";import {InjectField} from "core-app/helpers/angular/inject-field.decorator";import {DatePickerModal} from "core-components/datepicker/datepicker.modal";-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {take} from "rxjs/operators";import {DateEditFieldComponent} from "core-app/modules/fields/edit/field-types/date-edit-field.component";-import {OpModalComponent} from "core-components/op-modals/op-modal.component";+import {OpModalComponent} from "core-app/modules/modal/modal.component";@Component({template: `diff --git a/frontend/src/app/modules/fields/edit/field-types/date-edit-field.component.ts b/frontend/src/app/modules/fields/edit/field-types/date-edit-field.component.tsindex 7e988982b5e..b3045cd813e 100644--- a/frontend/src/app/modules/fields/edit/field-types/date-edit-field.component.ts+++ b/frontend/src/app/modules/fields/edit/field-types/date-edit-field.component.ts@@ -31,7 +31,7 @@ import * as moment from "moment";import {TimezoneService} from "core-components/datetime/timezone.service";import {EditFieldComponent} from "core-app/modules/fields/edit/edit-field.component";import {InjectField} from "core-app/helpers/angular/inject-field.decorator";-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";@Component({template: `diff --git a/frontend/src/app/modules/fields/edit/field-types/multi-select-edit-field.component.html b/frontend/src/app/modules/fields/edit/field-types/multi-select-edit-field.component.htmlindex 6687e7d1f76..1489d26f300 100644--- a/frontend/src/app/modules/fields/edit/field-types/multi-select-edit-field.component.html+++ b/frontend/src/app/modules/fields/edit/field-types/multi-select-edit-field.component.html@@ -18,6 +18,10 @@[appendTo]="appendTo"[dropdownPosition]="'top'"[hideSelected]="true">+ <ng-template ng-footer-tmp>+ <op-invite-user-button (invited)="selectedOption = $event">+ </op-invite-user-button>+ </ng-template></ng-select><edit-field-controls [fieldController]="self"diff --git a/frontend/src/app/modules/fields/edit/field-types/select-edit-field.component.html b/frontend/src/app/modules/fields/edit/field-types/select-edit-field.component.htmlindex c286aca515d..784cbc44b2f 100644--- a/frontend/src/app/modules/fields/edit/field-types/select-edit-field.component.html+++ b/frontend/src/app/modules/fields/edit/field-types/select-edit-field.component.html@@ -6,6 +6,7 @@disabled: inFlight,id: handler.htmlId,finishedLoading: true,- classes: 'inline-edit--field ' + handler.fieldName }"+ classes: 'inline-edit--field ' + handler.fieldName,+ showAddNewButton: showAddNewButton }"[ndcDynamicOutputs]="referenceOutputs"></ndc-dynamic>diff --git a/frontend/src/app/modules/fields/edit/field-types/select-edit-field.component.ts b/frontend/src/app/modules/fields/edit/field-types/select-edit-field.component.tsindex 3033e370ef1..230f6aa2506 100644--- a/frontend/src/app/modules/fields/edit/field-types/select-edit-field.component.ts+++ b/frontend/src/app/modules/fields/edit/field-types/select-edit-field.component.ts@@ -26,17 +26,18 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {Component, OnInit} from "@angular/core";-import {HalResourceSortingService} from "core-app/modules/hal/services/hal-resource-sorting.service";-import {CollectionResource} from "core-app/modules/hal/resources/collection-resource";-import {HalResource} from "core-app/modules/hal/resources/hal-resource";-import {EditFieldComponent} from "../edit-field.component";-import {CreateAutocompleterComponent} from "core-app/modules/common/autocomplete/create-autocompleter.component";-import {SelectAutocompleterRegisterService} from "app/modules/fields/edit/field-types/select-autocompleter-register.service";+import {Component, OnInit} from '@angular/core';+import {HalResourceSortingService} from 'core-app/modules/hal/services/hal-resource-sorting.service';+import {CollectionResource} from 'core-app/modules/hal/resources/collection-resource';+import {HalResource} from 'core-app/modules/hal/resources/hal-resource';+import {EditFieldComponent} from '../edit-field.component';+import {SelectAutocompleterRegisterService} from 'app/modules/fields/edit/field-types/select-autocompleter-register.service';import {from} from 'rxjs';import {map, tap} from 'rxjs/operators';-import {HalResourceNotificationService} from "core-app/modules/hal/services/hal-resource-notification.service";-import {InjectField} from "core-app/helpers/angular/inject-field.decorator";+import {HalResourceNotificationService} from 'core-app/modules/hal/services/hal-resource-notification.service';+import {InjectField} from 'core-app/helpers/angular/inject-field.decorator';+import {PermissionsService} from 'core-app/core/services/permissions/permissions.service';+import {CreateAutocompleterComponent} from "core-app/modules/autocompleter/create-autocompleter/create-autocompleter.component";export interface ValueOption {name:string;@@ -44,29 +45,18 @@ export interface ValueOption {}@Component({- templateUrl: './select-edit-field.component.html'+ templateUrl: './select-edit-field.component.html',})export class SelectEditFieldComponent extends EditFieldComponent implements OnInit {@InjectField() selectAutocompleterRegister:SelectAutocompleterRegisterService;@InjectField() halNotification:HalResourceNotificationService;@InjectField() halSorting:HalResourceSortingService;+ @InjectField() permissionsService:PermissionsService;public availableOptions:any[];public valueOptions:ValueOption[];- protected valuesLoaded = false;-public text:{ [key:string]:string };-public appendTo:any = null;- private hiddenOverflowContainer = '.__hidden_overflow_container';-- /** Remember the values loading promise which changes as soon as the changeset is updated- * (e.g., project or type is changed).- */- private valuesLoadingPromise:Promise<unknown>;-- protected _autocompleterComponent:CreateAutocompleterComponent;-public referenceOutputs:{ [key:string]:Function } = {onCreate: (newElement:HalResource) => this.onCreate(newElement),onChange: (value:HalResource) => this.onChange(value),@@ -75,27 +65,31 @@ export class SelectEditFieldComponent extends EditFieldComponent implements OnInonClose: () => this.onClose(),onAfterViewInit: (component:CreateAutocompleterComponent) => this._autocompleterComponent = component};+ public get selectedOption() {+ const href = this.value ? this.value.$href : null;+ return _.find(this.valueOptions, o => o.$href === href)!;+ }+ public set selectedOption(val:ValueOption) {+ let option = _.find(this.availableOptions, o => o.$href === val.$href);- protected initialize() {- this.text = {- requiredPlaceholder: this.I18n.t('js.placeholders.selection'),- placeholder: this.I18n.t('js.placeholders.default')- };+ // Special case 'null' value, which angular+ // only understands in ng-options as an empty string.+ if (option && option.$href === '') {+ option.$href = null;+ }- this.valuesLoadingPromise = this.change.getForm().then(() => {- return this.initialValueLoading();- });+ this.value = option;}+ public showAddNewButton:boolean;- protected initialValueLoading() {- this.valuesLoaded = false;- return this.loadValues().toPromise();- }+ protected valuesLoaded = false;+ protected _autocompleterComponent:CreateAutocompleterComponent;- public autocompleterComponent() {- let type = this.schema.type;- return this.selectAutocompleterRegister.getAutocompleterOfAttribute(type) || CreateAutocompleterComponent;- }+ private hiddenOverflowContainer = '.__hidden_overflow_container';+ /** Remember the values loading promise which changes as soon as the changeset is updated+ * (e.g., project or type is changed).+ */+ private valuesLoadingPromise:Promise<unknown>;public ngOnInit() {super.ngOnInit();@@ -111,23 +105,38 @@ export class SelectEditFieldComponent extends EditFieldComponent implements OnInthis._autocompleterComponent.openDirectly = true;});});- }- public get selectedOption() {- const href = this.value ? this.value.$href : null;- return _.find(this.valueOptions, o => o.$href === href)!;}- public set selectedOption(val:ValueOption) {- let option = _.find(this.availableOptions, o => o.$href === val.$href);+ protected initialize() {+ this.text = {+ requiredPlaceholder: this.I18n.t('js.placeholders.selection'),+ placeholder: this.I18n.t('js.placeholders.default')+ };- // Special case 'null' value, which angular- // only understands in ng-options as an empty string.- if (option && option.$href === '') {- option.$href = null;+ this.valuesLoadingPromise = this.change.getForm().then(() => {+ return this.initialValueLoading();+ });++ this.initializeShowAddButton();+ }++ initializeShowAddButton() {+ if (this.schema.type === 'User') {+ this.permissionsService+ .canInviteUsersToProject()+ .subscribe(canInviteUsersToProject => this.showAddNewButton = canInviteUsersToProject);}+ }- this.value = option;+ protected initialValueLoading() {+ this.valuesLoaded = false;+ return this.loadValues().toPromise();+ }++ public autocompleterComponent() {+ let type = this.schema.type;+ return this.selectAutocompleterRegister.getAutocompleterOfAttribute(type) || CreateAutocompleterComponent;}private setValues(availableValues:HalResource[]) {diff --git a/frontend/src/app/modules/fields/edit/field-types/te-work-package-edit-field.component.ts b/frontend/src/app/modules/fields/edit/field-types/te-work-package-edit-field.component.tsindex e23265a77cc..e4aa77e2735 100644--- a/frontend/src/app/modules/fields/edit/field-types/te-work-package-edit-field.component.ts+++ b/frontend/src/app/modules/fields/edit/field-types/te-work-package-edit-field.component.ts@@ -29,13 +29,13 @@import {Component} from "@angular/core";import {WorkPackageEditFieldComponent} from "core-app/modules/fields/edit/field-types/work-package-edit-field.component";import {ApiV3FilterBuilder} from "core-components/api/api-v3/api-v3-filter-builder";-import {- TimeEntryWorkPackageAutocompleterComponent,- TimeEntryWorkPackageAutocompleterMode-} from "core-app/modules/common/autocomplete/te-work-package-autocompleter.component";import {HalResource} from "core-app/modules/hal/resources/hal-resource";import {InjectField} from "core-app/helpers/angular/inject-field.decorator";import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";+import {+ TimeEntryWorkPackageAutocompleterComponent,+ TimeEntryWorkPackageAutocompleterMode+} from "core-app/modules/autocompleter/te-work-package-autocompleter/te-work-package-autocompleter.component";const RECENT_TIME_ENTRIES_MAGIC_NUMBER = 30;diff --git a/frontend/src/app/modules/fields/help-texts/attribute-help-text.component.ts b/frontend/src/app/modules/fields/help-texts/attribute-help-text.component.tsindex 03f58bdbb0c..e6a40f564fc 100644--- a/frontend/src/app/modules/fields/help-texts/attribute-help-text.component.ts+++ b/frontend/src/app/modules/fields/help-texts/attribute-help-text.component.ts@@ -37,7 +37,7 @@ import {OnInit} from '@angular/core';import {I18nService} from 'core-app/modules/common/i18n/i18n.service';-import {OpModalService} from 'core-components/op-modals/op-modal.service';+import {OpModalService} from 'core-app/modules/modal/modal.service';import {AttributeHelpTextModal} from "core-app/modules/fields/help-texts/attribute-help-text.modal";export const attributeHelpTextSelector = 'attribute-help-text';diff --git a/frontend/src/app/modules/fields/help-texts/attribute-help-text.modal.ts b/frontend/src/app/modules/fields/help-texts/attribute-help-text.modal.tsindex f2ea54eae07..84cb7e49800 100644--- a/frontend/src/app/modules/fields/help-texts/attribute-help-text.modal.ts+++ b/frontend/src/app/modules/fields/help-texts/attribute-help-text.modal.ts@@ -27,11 +27,11 @@//++import {ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Inject, OnInit} from '@angular/core';-import {OpModalComponent} from 'core-components/op-modals/op-modal.component';-import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';+import {OpModalComponent} from 'core-app/modules/modal/modal.component';+import {OpModalLocalsMap} from 'core-app/modules/modal/modal.types';+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {HelpTextResource} from 'core-app/modules/hal/resources/help-text-resource';import {I18nService} from "core-app/modules/common/i18n/i18n.service";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";@Component({templateUrl: './help-text.modal.html',diff --git a/frontend/src/app/modules/fields/help-texts/help-text.modal.html b/frontend/src/app/modules/fields/help-texts/help-text.modal.htmlindex e078f943c9f..fc3a4323bba 100644--- a/frontend/src/app/modules/fields/help-texts/help-text.modal.html+++ b/frontend/src/app/modules/fields/help-texts/help-text.modal.html@@ -1,38 +1,30 @@-<div class="op-modal--portal loading-indicator--location"- data-indicator-name="modal">- <div class="op-modal--modal-container attribute-help-text--modal" tabindex="0">- <div class="op-modal--modal-header">- <h3>- <span class="icon-context icon-help1"></span>- <span class="ellipsis" [textContent]="helpText.attributeCaption"></span>- </h3>+<div+ class="op-modal attribute-help-text--modal loading-indicator--location"+ data-indicator-name="modal"+>+ <op-modal-header (close)="closeMe($event)">+ <span class="icon-context icon-help1"></span>+ <span [textContent]="helpText.attributeCaption"></span>+ </op-modal-header>- <a class="op-modal--modal-close-button">- <i- class="icon-close"- (accessibleClick)="closeMe($event)"- [attr.title]="text.close">- </i>- </a>- </div>-- <div class="op-modal--modal-body -formattable op-uc-container op-uc-container__no-permalinks"- tabindex="0"- [innerHtml]="helpText.helpText.html">- </div>+ <div class="op-modal--body">+ <div+ class="op-uc-container op-uc-container__no-permalinks"+ [innerHtml]="helpText.helpText.html"+ ></div><attachments [resource]="helpText"data-allow-uploading="false"></attachments>+ </div>- <div class="modal--form-actions">- <a class="help-text--edit-button button"- *ngIf="helpText.editText"- [attr.href]="helpTextLink"- [attr.title]="text.edit">- <op-icon icon-classes="button--icon icon-edit"></op-icon>- <span class="button--text" [textContent]="text.edit"></span>- </a>- </div>+ <div class="op-modal--footer">+ <a class="help-text--edit-button button"+ *ngIf="helpText.editText"+ [attr.href]="helpTextLink"+ [attr.title]="text.edit">+ <op-icon icon-classes="button--icon icon-edit"></op-icon>+ <span class="button--text" [textContent]="text.edit"></span>+ </a></div></div>diff --git a/frontend/src/app/modules/fields/openproject-fields.module.ts b/frontend/src/app/modules/fields/openproject-fields.module.tsindex 8712c15c64b..469eb5ff402 100644--- a/frontend/src/app/modules/fields/openproject-fields.module.ts+++ b/frontend/src/app/modules/fields/openproject-fields.module.ts@@ -27,6 +27,11 @@//++import {APP_INITIALIZER, NgModule} from '@angular/core';+import {OpenprojectAccessibilityModule} from "core-app/modules/a11y/openproject-a11y.module";+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";+import {OpenprojectEditorModule} from 'core-app/modules/editor/openproject-editor.module';+import {OpenprojectAttachmentsModule} from "core-app/modules/attachments/openproject-attachments.module";+import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module";import {EditFieldService} from "core-app/modules/fields/edit/edit-field.service";import {DisplayFieldService} from "core-app/modules/fields/display/display-field.service";import {initializeCoreEditFields} from "core-app/modules/fields/edit/edit-field.initializer";@@ -40,11 +45,8 @@ import {MultiSelectEditFieldComponent} from "core-app/modules/fields/edit/field-import {SelectEditFieldComponent} from "core-app/modules/fields/edit/field-types/select-edit-field.component";import {FormattableEditFieldComponent} from "core-app/modules/fields/edit/field-types/formattable-edit-field.component";import {TextEditFieldComponent} from "core-app/modules/fields/edit/field-types/text-edit-field.component";-import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module";import {EditFormPortalComponent} from "core-app/modules/fields/edit/editing-portal/edit-form-portal.component";import {EditFieldControlsComponent,} from "core-app/modules/fields/edit/field-controls/edit-field-controls.component";-import {OpenprojectAccessibilityModule} from "core-app/modules/a11y/openproject-a11y.module";-import {OpenprojectEditorModule} from 'core-app/modules/editor/openproject-editor.module';import {SelectAutocompleterRegisterService} from "core-app/modules/fields/edit/field-types/select-autocompleter-register.service";import {EditFormComponent} from "core-app/modules/fields/edit/edit-form/edit-form.component";import {WorkPackageEditFieldComponent} from "core-app/modules/fields/edit/field-types/work-package-edit-field.component";@@ -56,9 +58,9 @@ import {AttributeValueMacroComponent} from "core-app/modules/fields/macros/attriimport {AttributeLabelMacroComponent} from "core-app/modules/fields/macros/attribute-label-macro.component";import {AttributeHelpTextComponent} from "core-app/modules/fields/help-texts/attribute-help-text.component";import {AttributeHelpTextModal} from "core-app/modules/fields/help-texts/attribute-help-text.modal";-import {OpenprojectAttachmentsModule} from "core-app/modules/attachments/openproject-attachments.module";import {WorkPackageQuickinfoMacroComponent} from "core-app/modules/fields/macros/work-package-quickinfo-macro.component";import {DisplayFieldComponent} from "core-app/modules/fields/display/display-field.component";+import {OpenprojectAutocompleterModule} from "core-app/modules/autocompleter/openproject-autocompleter.module";@NgModule({imports: [@@ -66,6 +68,8 @@ import {DisplayFieldComponent} from "core-app/modules/fields/display/display-fieOpenprojectAttachmentsModule,OpenprojectAccessibilityModule,OpenprojectEditorModule,+ OpenprojectModalModule,+ OpenprojectAutocompleterModule,],exports: [EditFieldControlsComponent,diff --git a/frontend/src/app/modules/grids/grid/add-widget.service.ts b/frontend/src/app/modules/grids/grid/add-widget.service.tsindex 5b5774d228c..d558241faa0 100644--- a/frontend/src/app/modules/grids/grid/add-widget.service.ts+++ b/frontend/src/app/modules/grids/grid/add-widget.service.ts@@ -1,5 +1,5 @@import {Injectable, Injector} from "@angular/core";-import {OpModalService} from "app/components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {AddGridWidgetModal} from "app/modules/grids/widgets/add/add.modal";import {GridWidgetResource} from "app/modules/hal/resources/grid-widget-resource";import {GridArea} from "app/modules/grids/areas/grid-area";diff --git a/frontend/src/app/modules/grids/openproject-grids.module.ts b/frontend/src/app/modules/grids/openproject-grids.module.tsindex 42def4f07f8..259938726b3 100644--- a/frontend/src/app/modules/grids/openproject-grids.module.ts+++ b/frontend/src/app/modules/grids/openproject-grids.module.ts@@ -30,6 +30,8 @@ import {Injector, NgModule} from '@angular/core';import {DynamicModule} from 'ng-dynamic-component';import {HookService} from "core-app/modules/plugins/hook-service";import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module";+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";+import {OpenprojectCalendarModule} from "core-app/modules/calendar/openproject-calendar.module";import {BrowserModule} from '@angular/platform-browser';import {FormsModule} from '@angular/forms';import {DragDropModule} from '@angular/cdk/drag-drop';@@ -39,7 +41,6 @@ import {WidgetTimeEntriesCurrentUserComponent} from "core-app/modules/grids/widgimport {GridWidgetsService} from "core-app/modules/grids/widgets/widgets.service";import {GridComponent} from "core-app/modules/grids/grid/grid.component";import {AddGridWidgetModal} from "core-app/modules/grids/widgets/add/add.modal";-import {OpenprojectCalendarModule} from "core-app/modules/calendar/openproject-calendar.module";import {WidgetDocumentsComponent} from "core-app/modules/grids/widgets/documents/documents.component";import {WidgetNewsComponent} from "core-app/modules/grids/widgets/news/news.component";import {WidgetWpTableComponent} from "core-app/modules/grids/widgets/wp-table/wp-table.component";@@ -74,6 +75,7 @@ import { TimeEntriesCurrentUserConfigurationModalComponent } from './widgets/timDragDropModule,OpenprojectCommonModule,+ OpenprojectModalModule,OpenprojectWorkPackagesModule,OpenprojectWorkPackageGraphsModule,OpenprojectCalendarModule,diff --git a/frontend/src/app/modules/grids/widgets/add/add.modal.html b/frontend/src/app/modules/grids/widgets/add/add.modal.htmlindex 3f57a332c1d..89491abeb81 100644--- a/frontend/src/app/modules/grids/widgets/add/add.modal.html+++ b/frontend/src/app/modules/grids/widgets/add/add.modal.html@@ -1,32 +1,22 @@-<div class="op-modal--portal ngdialog-theme-openproject">- <div class="op-modal--modal-container confirm-dialog--modal loading-indicator--location"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <a class="op-modal--modal-close-button">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.close_popup">- </i>- </a>- <h3 class="icon-context icon-attention" [textContent]="text.title"></h3>- </div>-- <div class="ngdialog-body op-modal--modal-body">- <div *ngFor="let widget of selectable;trackBy: trackWidgetBy"- (click)="select($event, widget)"- [id]="widget.identifier"- [textContent]="widget.title"- class="grid--addable-widget" >- </div>+<div+ class="op-modal loading-indicator--location"+ data-indicator-name="modal"+>+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <enterprise-banner *ngIf="eeShowBanners"- [linkMessage]="text.upsale_link"- [textMessage]="text.upsale_text"- class="grid--add-widget-ee"- opReferrer="grids#add-widget">- </enterprise-banner>+ <div class="ngdialog-body op-modal--body">+ <div *ngFor="let widget of selectable;trackBy: trackWidgetBy"+ (click)="select($event, widget)"+ [id]="widget.identifier"+ [textContent]="widget.title"+ class="grid--addable-widget" ></div>++ <enterprise-banner *ngIf="eeShowBanners"+ [linkMessage]="text.upsale_link"+ [textMessage]="text.upsale_text"+ class="grid--add-widget-ee"+ opReferrer="grids#add-widget">+ </enterprise-banner></div></div>diff --git a/frontend/src/app/modules/grids/widgets/add/add.modal.ts b/frontend/src/app/modules/grids/widgets/add/add.modal.tsindex 2f102934284..54a159d0b19 100644--- a/frontend/src/app/modules/grids/widgets/add/add.modal.ts+++ b/frontend/src/app/modules/grids/widgets/add/add.modal.ts@@ -1,8 +1,8 @@import {Component, ElementRef, Inject, ChangeDetectorRef} from "@angular/core";-import {OpModalComponent} from "app/components/op-modals/op-modal.component";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";import {WidgetRegistration} from "app/modules/grids/grid/grid.component";-import {OpModalLocalsToken} from "app/components/op-modals/op-modal.service";-import {OpModalLocalsMap} from "app/components/op-modals/op-modal.types";import {GridWidgetsService} from "app/modules/grids/widgets/widgets.service";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {BannersService} from "core-app/modules/common/enterprise/banners.service";diff --git a/frontend/src/app/modules/grids/widgets/menu/wp-set-menu.component.ts b/frontend/src/app/modules/grids/widgets/menu/wp-set-menu.component.tsindex b38fe1b745a..912fe13f656 100644--- a/frontend/src/app/modules/grids/widgets/menu/wp-set-menu.component.ts+++ b/frontend/src/app/modules/grids/widgets/menu/wp-set-menu.component.ts@@ -28,9 +28,9 @@import { Injector, EventEmitter, Output, Directive } from '@angular/core';import {I18nService} from 'core-app/modules/common/i18n/i18n.service';-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";+import {OpModalComponent} from "core-app/modules/modal/modal.component";import {GridRemoveWidgetService} from "core-app/modules/grids/grid/remove-widget.service";-import {OpModalComponent} from "core-components/op-modals/op-modal.component";import {ComponentType} from '@angular/cdk/portal';import {WidgetAbstractMenuComponent} from "core-app/modules/grids/widgets/menu/widget-abstract-menu.component";import {WpGraphConfigurationModalComponent} from "core-app/modules/work-package-graphs/configuration-modal/wp-graph-configuration.modal";diff --git a/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-configuration.modal.html b/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-configuration.modal.htmlindex a2a47b315df..bcae377b4a7 100644--- a/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-configuration.modal.html+++ b/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-configuration.modal.html@@ -1,18 +1,7 @@-<div class="op-modal--portal ">- <div class="op-modal--modal-container"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <a class="op-modal--modal-close-button">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.closePopup">- </i>- </a>- <h3 [textContent]="text.displayedDays"></h3>- </div>+<div class="op-modal">+ <op-modal-header (close)="closeMe($event)">{{text.displayedDays}}</op-modal-header>+ <div class="op-modal--body"><div class="form--field -trailing-label" *ngFor="let day of text.weekdays; let index = index"><label class="form--label" [textContent]="day" [htmlFor]="'day_' + index"></label><span class="form--field-container">@@ -21,17 +10,16 @@</span></span></div>+ </div>- <div class="tab-content"></div>- <div class="modal--form-actions">- <button class="button -highlight"- [textContent]="text.applyButton"- (click)="saveChanges()">- </button>- <button class="button"- [textContent]="text.cancelButton"- (click)="closeMe($event)">- </button>- </div>+ <div class="op-modal--footer">+ <button class="button -highlight"+ [textContent]="text.applyButton"+ (click)="saveChanges()">+ </button>+ <button class="button"+ [textContent]="text.cancelButton"+ (click)="closeMe($event)">+ </button></div></div>diff --git a/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-configuration.modal.ts b/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-configuration.modal.tsindex f127fbbc397..f224beb19fa 100644--- a/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-configuration.modal.ts+++ b/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-configuration.modal.ts@@ -12,9 +12,10 @@ import {Optional,ViewChild} from '@angular/core';-import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';+import {OpModalLocalsMap} from 'core-app/modules/modal/modal.types';+import {OpModalComponent} from 'core-app/modules/modal/modal.component';+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {ConfigurationService} from 'core-app/modules/common/config/configuration.service';-import {OpModalComponent} from 'core-components/op-modals/op-modal.component';import {ActiveTabInterface,TabComponent,@@ -23,7 +24,6 @@ import {} from 'core-components/wp-table/configuration-modal/tab-portal-outlet';import {LoadingIndicatorService} from 'core-app/modules/common/loading-indicator/loading-indicator.service';import {I18nService} from "core-app/modules/common/i18n/i18n.service";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {ComponentType} from "@angular/cdk/portal";import {WpGraphConfigurationService} from "core-app/modules/work-package-graphs/configuration/wp-graph-configuration.service";import {WpGraphConfiguration} from "core-app/modules/work-package-graphs/configuration/wp-graph-configuration";diff --git a/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-menu.component.ts b/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-menu.component.tsindex 04b103865d2..0354da7c420 100644--- a/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-menu.component.ts+++ b/frontend/src/app/modules/grids/widgets/time-entries/current-user/time-entries-current-user-menu.component.ts@@ -29,8 +29,8 @@import {Component, Output, EventEmitter, Injector} from '@angular/core';import {WpGraphConfigurationModalComponent} from "core-app/modules/work-package-graphs/configuration-modal/wp-graph-configuration.modal";import {WidgetWpSetMenuComponent} from "core-app/modules/grids/widgets/menu/wp-set-menu.component";-import {OpModalComponent} from "core-components/op-modals/op-modal.component";-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";+import {OpModalComponent} from "core-app/modules/modal/modal.component";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {GridRemoveWidgetService} from "core-app/modules/grids/grid/remove-widget.service";import {GridAreaService} from "core-app/modules/grids/grid/area.service";diff --git a/frontend/src/app/modules/hal/resources/placeholder-user-resource.ts b/frontend/src/app/modules/hal/resources/placeholder-user-resource.tsnew file mode 100644index 00000000000..2b0549660c6--- /dev/null+++ b/frontend/src/app/modules/hal/resources/placeholder-user-resource.ts@@ -0,0 +1,45 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.+//++++import {HalResource} from 'core-app/modules/hal/resources/hal-resource';+import {InputState} from 'reactivestates';++export class PlaceholderUserResource extends HalResource {+ // Links+ public updateImmediately:HalResource;+ public delete:HalResource;+ public showUser:HalResource;++ public get state():InputState<this> {+ return this.states.placeholderUsers.get(this.href as string) as any;+ }++ public get showUserPath() {+ return this.showUser ? this.showUser.$link.href : null;+ }+}diff --git a/frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.html b/frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.htmlnew file mode 100644index 00000000000..cec477aae95--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.html@@ -0,0 +1,13 @@+<button+ class="button -tiny -alt-highlight"+ type="button"+ (click)="onAddNewClick($event)"+ *ngIf="showButton">+ <op-icon icon-classes="button--icon icon-add" class="op-icon--wrapper">+ </op-icon>++ <span class="button--text">+ {{text.button}}+ </span>+</button>+diff --git a/frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.sass b/frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.sassnew file mode 100644index 00000000000..ae1c4fb6dbc--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.sass@@ -0,0 +1,6 @@+\:host+ .button.-tiny+ margin: 5px 7px+++diff --git a/frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.ts b/frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.tsnew file mode 100644index 00000000000..37633ae8567--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/button/invite-user-button.component.ts@@ -0,0 +1,89 @@+import {Component, EventEmitter, Inject, OnInit, Optional, Output} from '@angular/core';+import {OpEditingPortalSchemaToken} from "core-app/modules/fields/edit/edit-field.component";+import {IFieldSchema} from "core-app/modules/fields/field.base";+import {CurrentProjectService} from "core-components/projects/current-project.service";+import {NgSelectComponent} from "@ng-select/ng-select";+import {SelectEditFieldComponent} from "core-app/modules/fields/edit/field-types/select-edit-field.component";+import {MultiSelectEditFieldComponent} from "core-app/modules/fields/edit/field-types/multi-select-edit-field.component";+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+import {PermissionsService} from "core-app/core/services/permissions/permissions.service";+import {HalResource} from "core-app/modules/hal/resources/hal-resource";+import {OpModalService} from "core-app/modules/modal/modal.service";+import {InviteUserModalComponent} from "core-app/modules/invite-user-modal/invite-user.component";++@Component({+ selector: 'op-invite-user-button',+ templateUrl: './invite-user-button.component.html',+ styleUrls: ['./invite-user-button.component.sass']+})+export class InviteUserButtonComponent implements OnInit {+ @Output() invited = new EventEmitter<HalResource | HalResource[]>();++ get showButton() {+ const showButton = this.schema?.type === 'User' &&+ this.canInviteUsersToProject &&+ (this.selectEditFieldComponent || this.multiSelectEditFieldComponent);++ return showButton;+ }+ get parentIsMultiSelectEditFieldComponent() {+ return !!this.multiSelectEditFieldComponent;+ }++ text = {+ button: this.I18n.t('js.invite_user_modal.invite'),+ };+ canInviteUsersToProject:boolean;++ constructor(+ readonly I18n:I18nService,+ readonly opModalService:OpModalService,+ readonly currentProjectService:CurrentProjectService,+ readonly ngSelectComponent:NgSelectComponent,+ readonly permissionsService:PermissionsService,+ @Optional() readonly selectEditFieldComponent:SelectEditFieldComponent,+ @Optional() readonly multiSelectEditFieldComponent:MultiSelectEditFieldComponent,+ @Inject(OpEditingPortalSchemaToken) public schema:IFieldSchema,+ ) {}++ ngOnInit():void {+ this.permissionsService+ .canInviteUsersToProject()+ .subscribe(canInviteUsersToProject => this.canInviteUsersToProject = canInviteUsersToProject);+ }++ onAddNewClick($event:Event) {+ this.ngSelectComponent.close();+ $event.stopPropagation();+ this.openInviteUserModal();+ }++ openInviteUserModal() {+ const inviteModal = this.opModalService.show(InviteUserModalComponent, 'global', {+ projectId: this.currentProjectService.id,+ });++ inviteModal+ .closingEvent+ .subscribe((modal:any) => {+ let dataToEmit = null;++ if (modal.data) {+ // TODO: Remove this data formatting+ // The principal should be a UserResource instance to match+ // the interface used by the SelectEditFieldComponent's+ // availableOptions.+ dataToEmit = {+ ...modal.data,+ $href: modal.data.$source?._links?.self?.href,+ };++ if (this.parentIsMultiSelectEditFieldComponent) {+ dataToEmit = [dataToEmit];+ }+ }++ this.invited.emit(dataToEmit);+ });+ }+}diff --git a/frontend/src/app/modules/invite-user-modal/invite-user-modal.module.ts b/frontend/src/app/modules/invite-user-modal/invite-user-modal.module.tsnew file mode 100644index 00000000000..f386e220adc--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/invite-user-modal.module.ts@@ -0,0 +1,42 @@+import {NgModule} from "@angular/core";+import {ReactiveFormsModule} from "@angular/forms";+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";+import {InviteUserModalComponent} from "./invite-user.component";+import {ProjectSelectionComponent} from "./project-selection/project-selection.component";+import {ProjectSearchComponent} from "./project-selection/project-search.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";+import {NgSelectModule} from "@ng-select/ng-select";+import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module";+import {InviteUserButtonComponent} from "core-app/modules/invite-user-modal/button/invite-user-button.component";++@NgModule({+ imports: [+ OpenprojectCommonModule,+ OpenprojectModalModule,+ NgSelectModule,+ ReactiveFormsModule,+ ],+ exports: [+ InviteUserButtonComponent,+ ],+ declarations: [+ InviteUserModalComponent,+ InviteUserButtonComponent,+ ProjectSelectionComponent,+ ProjectSearchComponent,+ PrincipalComponent,+ PrincipalSearchComponent,+ RoleComponent,+ RoleSearchComponent,+ MessageComponent,+ SuccessComponent,+ SummaryComponent,+ ]+})+export class OpenprojectInviteUserModalModule { }diff --git a/frontend/src/app/modules/invite-user-modal/invite-user.component.html b/frontend/src/app/modules/invite-user-modal/invite-user.component.htmlnew file mode 100644index 00000000000..dd8a6a58cda--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/invite-user.component.html@@ -0,0 +1,61 @@+<op-ium-project-selection+ *ngIf="step === Steps.ProjectSelection"+ class="op-modal op-modal"+ [project]="project"+ [type]="type"+ (save)="onProjectSelectionSave($event)"+ (close)="closeMe()"+></op-ium-project-selection>++<op-ium-principal+ *ngIf="step === Steps.Principal"+ class="op-modal op-modal"+ [project]="project"+ [principal]="principal"+ [type]="type"+ (save)="onPrincipalSave($event)"+ (back)="goTo(Steps.ProjectSelection)"+ (close)="closeMe()"+></op-ium-principal>++<op-ium-role+ *ngIf="step === Steps.Role"+ class="op-modal op-modal"+ [role]="role"+ [principal]="principal"+ [project]="project"+ [type]="type"+ (save)="onRoleSave($event)"+ (back)="goTo(Steps.Principal)"+ (close)="closeMe()"+></op-ium-role>++<op-ium-message+ *ngIf="step === Steps.Message"+ class="op-modal op-modal"+ [message]="message"+ [principal]="principal"+ [project]="project"+ (save)="onMessageSave($event)"+ (back)="goTo(Steps.Role)"+ (close)="closeMe()"+></op-ium-message>++<op-ium-summary+ *ngIf="step === Steps.Summary"+ class="op-modal op-modal"+ [project]="project"+ [principal]="principal"+ [type]="type"+ [role]="role"+ [message]="message"+ (save)="onSuccessfulSubmission($event)"+ (back)="goTo(this.type === 'placeholder' ? Steps.Role : Steps.Message)"+ (close)="closeMe()"+></op-ium-summary>++<op-ium-success+ *ngIf="step === Steps.Success"+ class="op-modal op-modal"+ (close)="closeMe()"+></op-ium-success>diff --git a/frontend/src/app/modules/invite-user-modal/invite-user.component.sass b/frontend/src/app/modules/invite-user-modal/invite-user.component.sassnew file mode 100644index 00000000000..31fd3637a05--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/invite-user.component.sass@@ -0,0 +1,12 @@+.op-modal+ // different steps have different height. Force a similar height this way+ min-height: 500px++ // Unfortunately, the op-modal contents has been wrapped once here+ form+ display: flex+ flex-direction: column+ flex-grow: 1++ .op-form-field + .op-form-field+ margin-top: 1remdiff --git a/frontend/src/app/modules/invite-user-modal/invite-user.component.ts b/frontend/src/app/modules/invite-user-modal/invite-user.component.tsnew file mode 100644index 00000000000..d5fac722cf7--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/invite-user.component.ts@@ -0,0 +1,113 @@+import {+ ChangeDetectionStrategy,+ ChangeDetectorRef,+ Component,+ ElementRef,+ Inject,+ OnInit,+ ViewEncapsulation,+} from '@angular/core';+import {OpModalLocalsMap} from 'core-app/modules/modal/modal.types';+import {OpModalComponent} from 'core-app/modules/modal/modal.component';+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";+import {RoleResource} from "core-app/modules/hal/resources/role-resource";++enum Steps {+ ProjectSelection,+ Principal,+ Role,+ Message,+ Summary,+ Success,+}++export enum PrincipalType {+ User = 'user',+ Placeholder = 'placeholder',+ Group = 'group',+}++@Component({+ templateUrl: './invite-user.component.html',+ styleUrls: ['./invite-user.component.sass'],+ encapsulation: ViewEncapsulation.None,+ changeDetection: ChangeDetectionStrategy.OnPush,+})+export class InviteUserModalComponent extends OpModalComponent implements OnInit {+ public Steps = Steps;+ public step = Steps.ProjectSelection;++ /* Close on escape? */+ public closeOnEscape = true;++ /* Close on outside click */+ public closeOnOutsideClick = true;++ /* Data that is retured from the modal on close */+ public data:any = null;++ public type:PrincipalType|null = null;+ public project:any = null;+ public principal = null;+ public role:RoleResource|null = null;+ public message = '';++ constructor(+ @Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,+ readonly cdRef:ChangeDetectorRef,+ readonly elementRef:ElementRef,+ readonly apiV3Service:APIV3Service,+ ) {+ super(locals, cdRef, elementRef);+ }++ ngOnInit() {+ super.ngOnInit();++ if (this.locals.projectId) {+ this.apiV3Service.projects.id(this.locals.projectId).get().subscribe(data => {+ this.project = data;+ });+ }+ }++ onProjectSelectionSave({ type, project }:{ type:PrincipalType, project:any }) {+ this.type = type;+ this.project = project;+ this.goTo(Steps.Principal);+ }++ onPrincipalSave({ principal, isAlreadyMember }:{ principal:any, isAlreadyMember:boolean }) {+ this.principal = principal;+ if (isAlreadyMember) {+ return this.closeWithPrincipal();+ }++ this.goTo(Steps.Role);+ }++ onRoleSave(role:RoleResource) {+ this.role = role;++ if (this.type === 'placeholder') {+ this.goTo(Steps.Summary);+ } else {+ this.goTo(Steps.Message);+ }+ }++ onMessageSave({ message }:{ message:string }) {+ this.message = message;+ this.goTo(Steps.Summary);+ }++ goTo(step:Steps) {+ this.step = step;+ }++ closeWithPrincipal() {+ this.data = this.principal;+ this.closeMe();+ }+}diff --git a/frontend/src/app/modules/invite-user-modal/message/message.component.html b/frontend/src/app/modules/invite-user-modal/message/message.component.htmlnew file mode 100644index 00000000000..639aa244bed--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/message/message.component.html@@ -0,0 +1,29 @@+<form+ [formGroup]="messageForm"+ (ngSubmit)="onSubmit($event)"+>+ <op-modal-header (close)="close.emit()">{{ text.title() }}</op-modal-header>++ <div class="op-modal--body">+ <op-form-field [label]="text.label">+ <p class="op-form-field--description" slot="description">+ {{ text.description() }}+ </p>+ <textarea+ class="op-input"+ [formControl]="messageControl"+ slot="input"+ autofocus+ ></textarea>+ </op-form-field>+ </div>++ <div class="op-modal--footer">+ <button+ type="button"+ class="button"+ (click)="back.emit()"+ >{{ text.backButton }}</button>+ <button class="button">{{ text.nextButton }}</button>+ </div>+</form>diff --git a/frontend/src/app/modules/invite-user-modal/message/message.component.sass b/frontend/src/app/modules/invite-user-modal/message/message.component.sassnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/frontend/src/app/modules/invite-user-modal/message/message.component.ts b/frontend/src/app/modules/invite-user-modal/message/message.component.tsnew file mode 100644index 00000000000..bd735c6b16e--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/message/message.component.ts@@ -0,0 +1,68 @@+import {+ Component,+ OnInit,+ Input,+ EventEmitter,+ Output,+ ElementRef,+} from '@angular/core';+import {+ FormControl,+ FormGroup,+} from '@angular/forms';+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+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:any = null;+ @Input() principal:any = null;+ @Input() message:string = '';++ @Output() close = new EventEmitter<void>();+ @Output() back = new EventEmitter<void>();+ @Output() save = new EventEmitter<{message:string}>();++ 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);+ }++ onSubmit($e:Event) {+ $e.preventDefault();+ if (this.messageForm.invalid) {+ this.messageForm.markAllAsTouched();+ return;+ }++ this.save.emit({ message: this.messageControl?.value });+ }+}diff --git a/frontend/src/app/modules/invite-user-modal/principal/principal-search.component.html b/frontend/src/app/modules/invite-user-modal/principal/principal-search.component.htmlnew file mode 100644index 00000000000..d548ac06064--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/principal/principal-search.component.html@@ -0,0 +1,57 @@+<ng-select+ [formControl]="principalControl"+ [typeahead]="input$"+ [items]="items$ | async"+ [virtualScroll]="true"+ [clearable]="true"+ [clearOnBackspace]="false"+ [clearSearchOnAdd]="false"+ bindLabel="name"+ autofocus+ #ngselect+>+ <ng-template ng-option-tmp let-item="item" let-search="searchTerm">+ <!--Selectable option-->+ <div+ [ngOptionHighlight]="search"+ class="ng-option-label"+ >{{ item.name }}</div>+ <!-- Already a member of the project -->+ <div+ *ngIf="item.disabled"+ class="ng-option-label ellipsis"+ >{{ text.alreadyAMember() }}</div>+ </ng-template>++ <!--Nothing found -->+ <ng-template ng-notfound-tmp let-searchTerm="searchTerm">+ <div class="ng-option disabled">+ {{ text.noResults[type] }}+ </div>+ </ng-template>+++ <ng-template ng-footer-tmp>+ <!--Invite a new user by email-->+ <div *ngIf="canInviteByEmail$ | async">+ <button+ class="button"+ (click)="createNewFromInput()"+ >+ <op-icon icon-classes="icon-mail1"></op-icon>+ {{ text.inviteNewUser() }}+ </button>+ </div>++ <!--Create a new placeholder by name-->+ <div *ngIf="canCreateNewPlaceholder$ | async">+ <button+ class="button"+ (click)="createNewFromInput()"+ >+ <op-icon icon-classes="icon-mail1"></op-icon>+ {{ text.createNewPlaceholder() }}+ </button>+ </div>+ </ng-template>+</ng-select>diff --git a/frontend/src/app/modules/invite-user-modal/principal/principal-search.component.ts b/frontend/src/app/modules/invite-user-modal/principal/principal-search.component.tsnew file mode 100644index 00000000000..1471e97e459--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/principal/principal-search.component.ts@@ -0,0 +1,149 @@+import {+ Component,+ Input,+ EventEmitter,+ OnInit,+ Output,+ ElementRef,+} from '@angular/core';+import {FormControl} from "@angular/forms";+import {Observable, BehaviorSubject, combineLatest, forkJoin} from "rxjs";+import {debounceTime, distinctUntilChanged, first, shareReplay, map, switchMap} from "rxjs/operators";+import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";+import {ApiV3FilterBuilder} from "core-components/api/api-v3/api-v3-filter-builder";+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+import {UntilDestroyedMixin} from "core-app/helpers/angular/until-destroyed.mixin";+import {PrincipalType} from '../invite-user.component';++@Component({+ selector: 'op-ium-principal-search',+ templateUrl: './principal-search.component.html',+})+export class PrincipalSearchComponent extends UntilDestroyedMixin implements OnInit {+ @Input('opFormBinding') principalControl:FormControl;+ @Input() type:PrincipalType;+ @Input() project:any = null;++ @Output() createNew = new EventEmitter<string>();++ public input$ = new BehaviorSubject<string>('');+ public input = '';+ public items$:Observable<any[]>;+ public canInviteByEmail$:Observable<boolean>;+ public canCreateNewPlaceholder$:Observable<boolean>;++ public text = {+ alreadyAMember: () => this.I18n.t('js.invite_user_modal.principal.already_member_message', {+ project: this.project?.name,+ }),+ inviteNewUser: () => this.I18n.t('js.invite_user_modal.principal.invite_user', {+ email: this.input,+ }),+ createNewPlaceholder: () => this.I18n.t('js.invite_user_modal.principal.create_new_placeholder', {+ name: this.input,+ }),+ noResults: {+ user: this.I18n.t('js.invite_user_modal.principal.no_results_user'),+ placeholder: this.I18n.t('js.invite_user_modal.principal.no_results_placeholder'),+ group: this.I18n.t('js.invite_user_modal.principal.no_results_group'),+ },+ };++ constructor(+ public I18n:I18nService,+ readonly elementRef:ElementRef,+ readonly apiV3Service:APIV3Service,+ ) {+ super();++ this.input$.subscribe((input:string) => {+ this.input = input;+ });++ this.items$ = this.input$+ .pipe(+ this.untilDestroyed(),+ debounceTime(200),+ distinctUntilChanged(),+ switchMap(this.loadPrincipalData.bind(this)),+ );++ this.canInviteByEmail$ = combineLatest(+ this.items$,+ this.input$,+ ).pipe(+ map(([elements, input]) => this.type === 'user' && input?.includes('@') && !elements.find((el:any) => el.email === input)),+ );++ this.canCreateNewPlaceholder$ = combineLatest(+ this.items$,+ this.input$,+ ).pipe(+ map(([elements, input]) => {+ if (this.type !== PrincipalType.Placeholder) {+ return false;+ }++ return !!input && !elements.find((el:any) => el.name === input);+ }),+ );+ }++ ngOnInit() {+ // Make sure we have initial data+ setTimeout(() => this.input$.next(''));+ }++ createNewFromInput() {+ this.input$+ .pipe(first())+ .subscribe((input:string) => {+ this.createNew.emit(input);+ });+ }++ private loadPrincipalData(searchTerm:string) {+ const type = {+ placeholder: 'PlaceholderUser',+ user: 'User',+ group: 'Group',+ }[this.type];++ const nonMemberFilter = new ApiV3FilterBuilder();+ if (searchTerm) {+ nonMemberFilter.add('name', '~', [searchTerm]);+ }+ nonMemberFilter.add('status', '!', [3]);+ nonMemberFilter.add('type', '=', [type]);+ nonMemberFilter.add('member', '!', [this.project?.id]);++ const memberFilter = new ApiV3FilterBuilder();+ if (searchTerm) {+ memberFilter.add('name', '~', [searchTerm]);+ }+ memberFilter.add('status', '!', [3]);+ memberFilter.add('type', '=', [type]);+ nonMemberFilter.add('member', '=', [this.project?.id]);+ const members = this.apiV3Service.principals.filtered(memberFilter).get();+ const nonMembers = this.apiV3Service.principals.filtered(nonMemberFilter).get();++ return forkJoin({+ members,+ nonMembers,+ })+ .pipe(+ map(({ members, nonMembers }) => [+ ...members.elements.map((member:any) => ({+ ...member,+ disabled: false,+ })),+ ...nonMembers.elements.map((nonMember:any) => ({+ ...nonMember,+ disabled: true,+ })),+ ]),+ shareReplay(1),+ );++ }+}diff --git a/frontend/src/app/modules/invite-user-modal/principal/principal.component.html b/frontend/src/app/modules/invite-user-modal/principal/principal.component.htmlnew file mode 100644index 00000000000..56bfaab8fce--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/principal/principal.component.html@@ -0,0 +1,75 @@+<form+ [formGroup]="principalForm"+ (ngSubmit)="onSubmit($event)"+>+ <op-modal-header (close)="close.emit()">{{ text.title() }}</op-modal-header>++ <div class="op-modal--body">+ <op-form-field+ [label]="text.label[type]"+ required+ >+ <op-ium-principal-search+ *ngIf="!isNewPrincipal"+ [opFormBinding]="principalControl"+ [type]="type"+ [project]="project"+ slot="input"+ (createNew)="createNewFromInput($event)"+ ></op-ium-principal-search>++ <div+ class="pill"+ *ngIf="isNewPrincipal && type === 'user'"+ slot="input"+ >+ {{ text.inviteUser() }}+ <button+ class="op-link"+ (click)="principalControl?.setValue(null)"+ >{{ text.changeUserSelection }}</button>+ </div>++ <div+ class="pill"+ *ngIf="isNewPrincipal && type === 'placeholder'"+ slot="input"+ >+ {{ text.createNew.placeholder() }}+ <button+ class="op-link"+ (click)="principalControl?.setValue(null)"+ >{{ text.changePlaceholderSelection }}</button>+ </div>++ <div+ class="pill"+ *ngIf="isNewPrincipal && type === 'group'"+ slot="input"+ >+ {{ text.createNew.group() }}+ <button+ class="op-link"+ (click)="principalControl?.setValue(null)"+ >{{ text.changeGroupSelection }}</button>+ </div>++ <div+ slot="errors"+ class="op-form-field--error"+ *ngIf="principalControl?.touched && principalControl?.invalid"+ >+ {{ text.required[type] }}+ </div>+ </op-form-field>+ </div>++ <div class="op-modal--footer">+ <button+ type="button"+ class="button"+ (click)="back.emit()"+ >{{ text.backButton }}</button>+ <button class="button">{{ text.nextButton }}</button>+ </div>+</form>diff --git a/frontend/src/app/modules/invite-user-modal/principal/principal.component.sass b/frontend/src/app/modules/invite-user-modal/principal/principal.component.sassnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/frontend/src/app/modules/invite-user-modal/principal/principal.component.ts b/frontend/src/app/modules/invite-user-modal/principal/principal.component.tsnew file mode 100644index 00000000000..dcda555af08--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/principal/principal.component.ts@@ -0,0 +1,102 @@+import {+ Component,+ OnInit,+ Input,+ Output,+ EventEmitter,+} from '@angular/core';+import {+ FormGroup,+ FormControl,+ Validators,+} from '@angular/forms';+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+import {PrincipalType} from '../invite-user.component';++@Component({+ selector: 'op-ium-principal',+ templateUrl: './principal.component.html',+ styleUrls: ['./principal.component.sass'],+})+export class PrincipalComponent implements OnInit {+ @Input() principal:any = null;+ @Input() project:any = null;+ @Input() type:PrincipalType;++ @Output() close = new EventEmitter<void>();+ @Output() save = new EventEmitter<{ principal:any, isAlreadyMember:boolean }>();+ @Output() back = new EventEmitter();++ 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'),+ placeholder: this.I18n.t('js.invite_user_modal.principal.label.name'),+ group: this.I18n.t('js.invite_user_modal.principal.label.name'),+ },+ inviteUser: () => this.I18n.t('js.invite_user_modal.principal.invite_user', {+ email: this.principalControl?.value?.name,+ }),+ changeUserSelection: this.I18n.t('js.invite_user_modal.principal.change_user_selection'),+ changePlaceholderSelection: this.I18n.t('js.invite_user_modal.principal.change_placeholder_selection'),+ changeGroupSelection: this.I18n.t('js.invite_user_modal.principal.change_group_selection'),+ createNew: {+ placeholder: () => this.I18n.t('js.invite_user_modal.principal.create_new_placeholder', {+ name: this.principalControl?.value?.name+ }),+ group: () => this.I18n.t('js.invite_user_modal.principal.create_new_group', {+ name: this.principalControl?.value?.name+ }),+ },+ required: {+ user: this.I18n.t('js.invite_user_modal.principal.required.user'),+ placeholder: 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'),+ };++ public principalForm = new FormGroup({+ principal: new FormControl(null, [ Validators.required ]),+ });++ get principalControl() {+ return this.principalForm.get('principal');+ }++ get isNewPrincipal() {+ return typeof this.principalControl?.value === 'string';+ }++ get isMemberOfCurrentProject() {+ return !!this.principalControl?.value?.memberships?.elements?.find((mem:any) => mem.project.id === this.project.id);+ }++ constructor(readonly I18n:I18nService) {}++ ngOnInit() {+ this.principalControl?.setValue(this.principal);+ }++ createNewFromInput(input:string) {+ this.principalControl?.setValue(input);+ }++ onSubmit($e:Event) {+ $e.preventDefault();++ if (this.principalForm.invalid) {+ this.principalForm.markAllAsTouched();+ return;+ }++ this.save.emit({+ principal: this.principalControl?.value,+ isAlreadyMember: this.isMemberOfCurrentProject,+ });+ }+}diff --git a/frontend/src/app/modules/invite-user-modal/project-selection/project-search.component.html b/frontend/src/app/modules/invite-user-modal/project-selection/project-search.component.htmlnew file mode 100644index 00000000000..60b11d52939--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/project-selection/project-search.component.html@@ -0,0 +1,24 @@+<ng-select+ [formControl]="projectFormControl"+ [typeahead]="input$"+ [items]="items$ | async"+ [virtualScroll]="true"+ [clearable]="true"+ [clearOnBackspace]="false"+ [clearSearchOnAdd]="false"+ bindLabel="name"+ autofocus+ #ngselect+>+ <!--Selectable option-->+ <ng-template ng-option-tmp let-item="item" let-search="searchTerm">+ <div [ngOptionHighlight]="search" class="ng-option-label ellipsis">{{ item.name }}</div>+ </ng-template>++ <!--Nothing found -->+ <ng-template ng-notfound-tmp let-searchTerm="searchTerm">+ <div class="ng-option disabled">+ {{ text.noResultsFound }}+ </div>+ </ng-template>+</ng-select>diff --git a/frontend/src/app/modules/invite-user-modal/project-selection/project-search.component.ts b/frontend/src/app/modules/invite-user-modal/project-selection/project-search.component.tsnew file mode 100644index 00000000000..e6697e56e0a--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/project-selection/project-search.component.ts@@ -0,0 +1,54 @@+import {+ Component,+ Input,+ OnInit,+ ElementRef,+} from '@angular/core';+import {FormControl, NgControl} from "@angular/forms";+import {Observable, Subject} from "rxjs";+import {debounceTime, distinctUntilChanged, filter, map, switchMap, tap} from "rxjs/operators";+import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";+import {ApiV3FilterBuilder} from "core-components/api/api-v3/api-v3-filter-builder";+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+import {UntilDestroyedMixin} from "core-app/helpers/angular/until-destroyed.mixin";++@Component({+ selector: 'op-ium-project-search',+ templateUrl: './project-search.component.html',+})+export class ProjectSearchComponent extends UntilDestroyedMixin implements OnInit {+ @Input('opFormBinding') projectFormControl:FormControl;++ public text = {+ noResultsFound: this.I18n.t('js.invite_user_modal.project.no_results'),+ };++ public input$ = new Subject<string|null>();+ public items$:Observable<any>;++ constructor(+ readonly I18n:I18nService,+ readonly elementRef:ElementRef,+ readonly apiV3Service:APIV3Service,+ ) {+ super();++ this.items$ = this.input$+ .pipe(+ this.untilDestroyed(),+ debounceTime(100),+ switchMap((searchTerm:string) => {+ const filters = new ApiV3FilterBuilder();+ if (searchTerm) {+ filters.add('name_and_identifier', '~', [searchTerm]);+ }+ return this.apiV3Service.projects.filtered(filters).get().pipe(map(collection => collection.elements));+ }),+ );+ }++ ngOnInit() {+ // Make sure we have initial data+ setTimeout(() => this.input$.next(''));+ }+}diff --git a/frontend/src/app/modules/invite-user-modal/project-selection/project-selection.component.html b/frontend/src/app/modules/invite-user-modal/project-selection/project-selection.component.htmlnew file mode 100644index 00000000000..6a106ea4ab6--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/project-selection/project-selection.component.html@@ -0,0 +1,46 @@+<form+ [formGroup]="projectAndTypeForm"+ (ngSubmit)="onSubmit($event)"+>+ <op-modal-header (close)="close.emit()">{{ text.title }}</op-modal-header>++ <div class="op-modal--body">+ <op-form-field+ label="Project"+ required+ >+ <op-ium-project-search+ [opFormBinding]="projectControl"+ slot="input"+ ></op-ium-project-search>++ <div+ slot="errors"+ class="op-form-field--error"+ *ngIf="projectControl?.touched && projectControl?.invalid"+ >+ {{ text.project.required }}+ </div>+ </op-form-field>++ <div class="op-form-field">+ <op-option-list+ [options]="typeOptions"+ formControlName="type"+ ></op-option-list>++ <div+ *ngIf="typeControl?.touched && typeControl?.invalid"+ class="op-form-field--errors"+ >+ <div class="op-form-field--error">+ {{ text.type.required }}+ </div>+ </div>+ </div>+ </div>++ <div class="op-modal--footer">+ <button class="button">{{ text.nextButton }}</button>+ </div>+</form>diff --git a/frontend/src/app/modules/invite-user-modal/project-selection/project-selection.component.sass b/frontend/src/app/modules/invite-user-modal/project-selection/project-selection.component.sassnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/frontend/src/app/modules/invite-user-modal/project-selection/project-selection.component.ts b/frontend/src/app/modules/invite-user-modal/project-selection/project-selection.component.tsnew file mode 100644index 00000000000..278e4d7224b--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/project-selection/project-selection.component.ts@@ -0,0 +1,88 @@+import {+ Component,+ OnInit,+ Input,+ EventEmitter,+ Output,+ ElementRef,+} from '@angular/core';+import {+ FormControl,+ FormGroup,+ Validators,+} from '@angular/forms';+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+import {PrincipalType} from '../invite-user.component';++@Component({+ selector: 'op-ium-project-selection',+ templateUrl: './project-selection.component.html',+ styleUrls: ['./project-selection.component.sass'],+})+export class ProjectSelectionComponent implements OnInit {+ @Input() type:PrincipalType;+ @Input() project:any = null;++ @Output() close = new EventEmitter<void>();+ @Output() save = new EventEmitter<{project:any, type:string}>();++ public text = {+ title: this.I18n.t('js.invite_user_modal.title.invite'),+ project: {+ required: this.I18n.t('js.invite_user_modal.project.required'),+ },+ type: {+ required: this.I18n.t('js.invite_user_modal.type.required'),+ },+ nextButton: this.I18n.t('js.invite_user_modal.project.next_button'),+ };++ public typeOptions = [+ {+ value: 'user',+ title: 'User',+ description: 'Permissions based on the assigned role in the selected project'+ },+ {+ value: 'group',+ title: 'Group',+ description: 'Permissions based on the assigned role in the selected project'+ },+ {+ value: 'placeholder',+ title: 'Placeholder',+ description: 'Has no access to the proejct and no emails are sent out'+ },+ ];++ projectAndTypeForm = new FormGroup({+ type: new FormControl(PrincipalType.User, [ Validators.required ]),+ project: new FormControl(null, [ Validators.required ]),+ });++ get typeControl() { return this.projectAndTypeForm.get('type'); }+ get projectControl() { return this.projectAndTypeForm.get('project'); }++ constructor(+ readonly I18n:I18nService,+ readonly elementRef:ElementRef,+ ) {}++ ngOnInit() {+ this.typeControl?.setValue(this.type);+ this.projectControl?.setValue(this.project);+ }++ onSubmit($e:Event) {+ $e.preventDefault();+ if (this.projectAndTypeForm.invalid) {+ this.projectAndTypeForm.markAllAsTouched();+ return;+ }++ this.save.emit({+ project: this.projectControl?.value,+ type: this.typeControl?.value,+ });+ }+}diff --git a/frontend/src/app/modules/invite-user-modal/role/role-search.component.html b/frontend/src/app/modules/invite-user-modal/role/role-search.component.htmlnew file mode 100644index 00000000000..d6ec18851a8--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/role/role-search.component.html@@ -0,0 +1,24 @@+<ng-select+ [formControl]="roleControl"+ [typeahead]="input$"+ [items]="items$ | async"+ [virtualScroll]="true"+ [clearable]="true"+ [clearOnBackspace]="false"+ [clearSearchOnAdd]="false"+ bindLabel="name"+ autofocus+ #ngselect+>+ <!--Selectable option-->+ <ng-template ng-option-tmp let-item="item" let-search="searchTerm">+ <div [ngOptionHighlight]="search" class="ng-option-label ellipsis">{{ item.name }}</div>+ </ng-template>++ <!--Nothing found -->+ <ng-template ng-notfound-tmp let-searchTerm="searchTerm">+ <div class="ng-option disabled">+ {{ text.noRolesFound }}+ </div>+ </ng-template>+</ng-select>diff --git a/frontend/src/app/modules/invite-user-modal/role/role-search.component.ts b/frontend/src/app/modules/invite-user-modal/role/role-search.component.tsnew file mode 100644index 00000000000..cd63de3f8a7--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/role/role-search.component.ts@@ -0,0 +1,60 @@+import {+ Component,+ OnInit,+ Input,+ ElementRef,+} from '@angular/core';+import {FormControl} from "@angular/forms";+import {Observable, Subject, combineLatest} from "rxjs";+import {debounceTime, distinctUntilChanged, filter, map, switchMap, tap} from "rxjs/operators";+import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";+import {ApiV3FilterBuilder} from "core-components/api/api-v3/api-v3-filter-builder";+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+import {UntilDestroyedMixin} from "core-app/helpers/angular/until-destroyed.mixin";++@Component({+ selector: 'op-ium-role-search',+ templateUrl: './role-search.component.html',+})+export class RoleSearchComponent extends UntilDestroyedMixin implements OnInit {+ @Input('opFormBinding') roleControl:FormControl;++ public input$ = new Subject<string|null>();+ public roles$ = new Subject<any[]>();+ public items$:Observable<any[]>;++ public text = {+ noRolesFound: this.I18n.t('js.invite_user_modal.role_search.no_roles_found'),+ };++ constructor(+ readonly I18n:I18nService,+ readonly elementRef:ElementRef,+ readonly apiV3Service:APIV3Service,+ ) {+ super();++ this.items$ = combineLatest(+ this.input$+ .pipe(+ this.untilDestroyed(),+ debounceTime(200),+ map((input:string) => input.toLowerCase()),+ distinctUntilChanged(),+ ),+ this.roles$,+ ).pipe(+ tap(console.log),+ map(([input, roles]:[string, any[]]) => roles.filter((role) => !input || role.name.toLowerCase().indexOf(input) !== -1))+ );+ }++ ngOnInit() {+ const filters = new ApiV3FilterBuilder();+ filters.add('grantable', '=', true);+ filters.add('unit', '=', ['project']);+ this.apiV3Service.roles.filtered(filters).get().subscribe(({ elements }) => this.roles$.next(elements));++ setTimeout(() => this.input$.next(''));+ }+}diff --git a/frontend/src/app/modules/invite-user-modal/role/role.component.html b/frontend/src/app/modules/invite-user-modal/role/role.component.htmlnew file mode 100644index 00000000000..8d87f62b046--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/role/role.component.html@@ -0,0 +1,40 @@+<form+ [formGroup]="roleForm"+ (ngSubmit)="onSubmit($event)"+>+ <op-modal-header (close)="close.emit()">{{ text.title() }}</op-modal-header>++ <div class="op-modal--body">+ <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="op-modal--footer">+ <button+ type="button"+ class="button"+ (click)="back.emit()"+ >{{ text.backButton }}</button>+ <button class="button">{{ text.nextButton }}</button>+ </div>+</form>diff --git a/frontend/src/app/modules/invite-user-modal/role/role.component.sass b/frontend/src/app/modules/invite-user-modal/role/role.component.sassnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/frontend/src/app/modules/invite-user-modal/role/role.component.ts b/frontend/src/app/modules/invite-user-modal/role/role.component.tsnew file mode 100644index 00000000000..32026183777--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/role/role.component.ts@@ -0,0 +1,69 @@+import {+ Component,+ OnInit,+ Input,+ EventEmitter,+ Output,+} from '@angular/core';+import {+ FormControl,+ FormGroup,+ Validators,+} from '@angular/forms';+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+import {PrincipalType} from '../invite-user.component';+import {RoleResource} from "core-app/modules/hal/resources/role-resource";++@Component({+ selector: 'op-ium-role',+ templateUrl: './role.component.html',+ styleUrls: ['./role.component.sass'],+})+export class RoleComponent implements OnInit {+ @Input() type:PrincipalType;+ @Input() project:any = null;+ @Input() principal:any = null;+ @Input() role:any = null;++ @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.markAllAsTouched();+ return;+ }++ this.save.emit(this.roleForm?.value.role);+ }+}diff --git a/frontend/src/app/modules/invite-user-modal/success/success.component.html b/frontend/src/app/modules/invite-user-modal/success/success.component.htmlnew file mode 100644index 00000000000..1157ecddc01--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/success/success.component.html@@ -0,0 +1,18 @@+<div class="op-ium-success">+ <op-modal-header (close)="close.emit()"></op-modal-header>++ <div class="op-modal--body">+ <img src="" />++ <h1 [textContent]="text.title()"></h1>++ <p [textContent]="text.description[type]()"></p>+ </div>+ <div class="op-modal--footer">+ <button+ (click)="close.emit()"+ class="button"+ type="button"+ >{{ text.nextButton }}</button>+ </div>+</div>diff --git a/frontend/src/app/modules/invite-user-modal/success/success.component.sass b/frontend/src/app/modules/invite-user-modal/success/success.component.sassnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/frontend/src/app/modules/invite-user-modal/success/success.component.ts b/frontend/src/app/modules/invite-user-modal/success/success.component.tsnew file mode 100644index 00000000000..332313ab462--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/success/success.component.ts@@ -0,0 +1,39 @@+import {+ Component,+ Input,+ EventEmitter,+ Output,+ ElementRef,+} from '@angular/core';+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+import {PrincipalType} from '../invite-user.component';++@Component({+ selector: 'op-ium-success',+ templateUrl: './success.component.html',+ styleUrls: ['./success.component.sass'],+})+export class SuccessComponent {+ @Input() principal:any = null;+ @Input() project:any = null;+ @Input() type:PrincipalType;++ @Output() close = new EventEmitter<void>();++ public text = {+ title: () => this.I18n.t('js.invite_user_modal.success.title', {+ principal: this.principal.name,+ }),+ description: {+ user: () => this.I18n.t('js.invite_user_modal.success.description.user', { project: this.project?.name }),+ placeholder: () => this.I18n.t('js.invite_user_modal.success.description.placeholder', { project: this.project?.name }),+ group: () => this.I18n.t('js.invite_user_modal.success.description.group', { project: this.project?.name }),+ },+ nextButton: this.I18n.t('js.invite_user_modal.success.next_button'),+ };++ constructor(+ readonly I18n:I18nService,+ readonly elementRef:ElementRef,+ ) {}+}diff --git a/frontend/src/app/modules/invite-user-modal/summary/summary.component.html b/frontend/src/app/modules/invite-user-modal/summary/summary.component.htmlnew file mode 100644index 00000000000..3318b364b6d--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/summary/summary.component.html@@ -0,0 +1,35 @@+<form+ name="sendUserInviteForm"+ (submit)="onSubmit($event)"+ class="op-ium-summary"+>+ <op-modal-header (close)="close.emit()">{{ text.title() }}</op-modal-header>++ <div class="op-modal--body">+ <op-form-field [label]="text.projectLabel">+ <p slot="input">{{ project.name }}</p>+ </op-form-field>+ <div class="op-ium-summary__row">+ <op-form-field [label]="text.principalLabel[type]">+ <p slot="input">{{ principal.name }}</p>+ </op-form-field>+ <op-form-field [label]="text.roleLabel()">+ <p slot="input">{{ role.name }}</p>+ </op-form-field>+ </div>+ <op-form-field+ [label]="text.messageLabel"+ *ngIf="type !== 'placeholder'"+ >+ <p slot="input">{{ message }}</p>+ </op-form-field>+ </div>++ <div class="op-modal--footer">+ <button+ type="button"+ (click)="back.emit()"+ >{{ text.backButton }}</button>+ <button>{{ text.nextButton() }}</button>+ </div>+</form>diff --git a/frontend/src/app/modules/invite-user-modal/summary/summary.component.sass b/frontend/src/app/modules/invite-user-modal/summary/summary.component.sassnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/frontend/src/app/modules/invite-user-modal/summary/summary.component.ts b/frontend/src/app/modules/invite-user-modal/summary/summary.component.tsnew file mode 100644index 00000000000..deebe413f17--- /dev/null+++ b/frontend/src/app/modules/invite-user-modal/summary/summary.component.ts@@ -0,0 +1,87 @@+import {+ Component,+ Input,+ EventEmitter,+ Output,+ ElementRef,+} from '@angular/core';+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+import {APIV3Service} from "core-app/modules/apiv3/api-v3.service";+import {PrincipalType} from '../invite-user.component';+import {RoleResource} from "core-app/modules/hal/resources/role-resource";++@Component({+ selector: 'op-ium-summary',+ templateUrl: './summary.component.html',+ styleUrls: ['./summary.component.sass'],+})+export class SummaryComponent {+ @Input() type:PrincipalType;+ @Input() project:any = null;+ @Input() role:RoleResource;+ @Input() principal:any = null;+ @Input() message:string = '';++ @Output() close = new EventEmitter<void>();+ @Output() back = new EventEmitter<void>();+ @Output() save = new EventEmitter();++ public text = {+ title: () => this.I18n.t('js.invite_user_modal.title.invite_principal_to_project', {+ principal: this.principal?.name,+ project: this.project?.name,+ }),+ projectLabel: this.I18n.t('js.invite_user_modal.project.label'),+ principalLabel: {+ user: this.I18n.t('js.invite_user_modal.principal.label.name_or_email'),+ placeholder: 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', {+ 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', {+ type: this.type,+ principal: this.principal,+ }),+ };++ constructor(+ readonly I18n:I18nService,+ readonly elementRef:ElementRef,+ readonly api:APIV3Service,+ ) {}++ async invite() {+ const principal = await (async () => {+ if (this.principal.id) {+ return this.principal;+ }++ switch (this.type) {+ case PrincipalType.User:+ return this.api.users.post({+ email: this.principal.name,+ firstName: this.principal.email,+ status: 'invited',+ });+ case PrincipalType.Placeholder:+ return this.api.placeholder_users.post({ name: this.principal.name });+ }+ })();++ return this.api.memberships.post({+ principal,+ project: this.project,+ roles: [this.role],+ });+ }++ async onSubmit($e:Event) {+ $e.preventDefault();++ this.save.emit({ principal: this.principal });+ }+}diff --git a/frontend/src/app/modules/job-status/display-job-page/display-job-page.component.ts b/frontend/src/app/modules/job-status/display-job-page/display-job-page.component.tsindex f082589366c..cd3826e9c97 100644--- a/frontend/src/app/modules/job-status/display-job-page/display-job-page.component.ts+++ b/frontend/src/app/modules/job-status/display-job-page/display-job-page.component.ts@@ -1,7 +1,7 @@import {AfterViewInit, Component, Injector, OnDestroy} from "@angular/core";import {StateService} from "@uirouter/core";-import {OpModalService} from "core-components/op-modals/op-modal.service";-import {OpModalComponent} from "core-components/op-modals/op-modal.component";+import {OpModalService} from "core-app/modules/modal/modal.service";+import {OpModalComponent} from "core-app/modules/modal/modal.component";import {JobStatusModal} from "core-app/modules/job-status/job-status-modal/job-status.modal";import {take} from "rxjs/operators";diff --git a/frontend/src/app/modules/job-status/job-status-modal/job-status.modal.html b/frontend/src/app/modules/job-status/job-status-modal/job-status.modal.htmlindex fe45cd1a847..055b058a068 100644--- a/frontend/src/app/modules/job-status/job-status-modal/job-status.modal.html+++ b/frontend/src/app/modules/job-status/job-status-modal/job-status.modal.html@@ -1,49 +1,40 @@-<div class="op-modal--portal job-status--modal -wide-fixed">- <div class="op-modal--modal-container"- tabindex="0">- <div class="op-modal--modal-header">- <h3 [textContent]="title"></h3>- <a class="op-modal--modal-close-button">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.closePopup">- </i>- </a>- </div>+<div+ class="op-modal op-modal_wide-fixed job-status--modal loading-indicator--location"+ data-indicator-name="modal"+>+ <op-modal-header (close)="closeMe($event)">{{ title }}</op-modal-header>- <div>- <div class="loading-indicator--location"- data-indicator-name="modal">- <div class="status-icon-wrapper" *ngIf="!isLoading && statusIcon">- <span [ngClass]="statusIcon" class="icon-big"></span>- </div>+ <div class="op-modal--body">+ <div class="loading-indicator--location"+ data-indicator-name="modal">+ <div class="status-icon-wrapper" *ngIf="!isLoading && statusIcon">+ <span [ngClass]="statusIcon" class="icon-big"></span></div>- <div>- <span class="job-status--modal-main-message" [textContent]="message"></span>- <span [hidden]="!downloadHref">- {{ text.download_starts }}- <a #downloadLink- download- target="_blank"- [textContent]="text.click_to_download"- [attr.href]="downloadHref">- </a>- </span>- <ng-container *ngIf="payload?.errors">- <h3 class="job-status--modal-additional-errors" [textContent]="text.errors"></h3>- <ul *ngFor="let error of payload.errors">- <li [textContent]="error"></li>- </ul>+ </div>+ <div>+ <span class="job-status--modal-main-message" [textContent]="message"></span>+ <span [hidden]="!downloadHref">+ {{ text.download_starts }}+ <a #downloadLink+ download+ target="_blank"+ [textContent]="text.click_to_download"+ [attr.href]="downloadHref">+ </a>+ </span>+ <ng-container *ngIf="payload?.errors">+ <h3 class="job-status--modal-additional-errors" [textContent]="text.errors"></h3>+ <ul *ngFor="let error of payload.errors">+ <li [textContent]="error"></li>+ </ul>- <p *ngIf="payload?.redirect">- <span [textContent]="text.redirect_errors"></span>- <a [textContent]="text.redirect_link"- [attr.href]="payload.redirect">- </a>- </p>- </ng-container>- </div>+ <p *ngIf="payload?.redirect">+ <span [textContent]="text.redirect_errors"></span>+ <a [textContent]="text.redirect_link"+ [attr.href]="payload.redirect">+ </a>+ </p>+ </ng-container></div></div></div>diff --git a/frontend/src/app/modules/job-status/job-status-modal/job-status.modal.ts b/frontend/src/app/modules/job-status/job-status-modal/job-status.modal.tsindex 5433fa58020..fd7faf7b30f 100644--- a/frontend/src/app/modules/job-status/job-status-modal/job-status.modal.ts+++ b/frontend/src/app/modules/job-status/job-status-modal/job-status.modal.ts@@ -1,8 +1,8 @@import {ChangeDetectorRef, Component, ElementRef, Inject, OnInit, ViewChild} from '@angular/core';-import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';-import {OpModalComponent} from 'core-components/op-modals/op-modal.component';+import {OpModalLocalsMap} from 'core-app/modules/modal/modal.types';+import {OpModalComponent} from 'core-app/modules/modal/modal.component';+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {I18nService} from "core-app/modules/common/i18n/i18n.service";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {HttpClient, HttpErrorResponse, HttpResponse} from '@angular/common/http';import {interval, Observable, timer} from "rxjs";import {map, switchMap, takeUntil, takeWhile} from "rxjs/operators";diff --git a/frontend/src/app/modules/job-status/openproject-job-status.module.ts b/frontend/src/app/modules/job-status/openproject-job-status.module.tsindex e287686a5a1..7c596e24fe4 100644--- a/frontend/src/app/modules/job-status/openproject-job-status.module.ts+++ b/frontend/src/app/modules/job-status/openproject-job-status.module.ts@@ -26,8 +26,9 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpenprojectCommonModule} from 'core-app/modules/common/openproject-common.module';import {NgModule} from '@angular/core';+import {OpenprojectCommonModule} from 'core-app/modules/common/openproject-common.module';+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";import {Ng2StateDeclaration, UIRouterModule} from "@uirouter/angular";import {DisplayJobPageComponent} from "core-app/modules/job-status/display-job-page/display-job-page.component";import {JobStatusModal} from "core-app/modules/job-status/job-status-modal/job-status.modal";@@ -48,6 +49,7 @@ export const JOB_STATUS_ROUTE:Ng2StateDeclaration[] = [imports: [// CommonsOpenprojectCommonModule,+ OpenprojectModalModule,// Routes for /job_statuses/:uuidUIRouterModule.forChild({ states: JOB_STATUS_ROUTE }),diff --git a/frontend/src/app/modules/members/members-autocompleter.component.ts b/frontend/src/app/modules/members/members-autocompleter.component.tsindex 1e78b972465..4fb0a2a4ffb 100644--- a/frontend/src/app/modules/members/members-autocompleter.component.ts+++ b/frontend/src/app/modules/members/members-autocompleter.component.ts@@ -1,4 +1,3 @@-import {UserAutocompleterComponent} from "core-app/modules/common/autocomplete/user-autocompleter.component";import {Observable} from "rxjs";import {map} from "rxjs/operators";import {InjectField} from "core-app/helpers/angular/inject-field.decorator";@@ -6,11 +5,12 @@ import {HttpClient, HttpParams} from "@angular/common/http";import {Component} from "@angular/core";import {URLParamsEncoder} from "core-app/modules/hal/services/url-params-encoder";import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service";+import {UserAutocompleterComponent} from "core-app/modules/autocompleter/user-autocompleter/user-autocompleter.component";export const membersAutocompleterSelector = 'members-autocompleter';@Component({- templateUrl: '/app/modules/common/autocomplete/user-autocompleter.component.html',+ templateUrl: '/app/modules/autocompleter/user-autocompleter/user-autocompleter.component.html',selector: membersAutocompleterSelector})export class MembersAutocompleterComponent extends UserAutocompleterComponent {diff --git a/frontend/src/app/modules/modal/modal-delivery-element.sass b/frontend/src/app/modules/modal/modal-delivery-element.sassnew file mode 100644index 00000000000..b915dc74c29--- /dev/null+++ b/frontend/src/app/modules/modal/modal-delivery-element.sass@@ -0,0 +1,2 @@+.modal-delivery-element+ display: nonediff --git a/frontend/src/app/modules/modal/modal-header.component.html b/frontend/src/app/modules/modal/modal-header.component.htmlnew file mode 100644index 00000000000..95b120ea851--- /dev/null+++ b/frontend/src/app/modules/modal/modal-header.component.html@@ -0,0 +1,15 @@+<op-icon+ *ngIf="icon"+ [icon-classes]="icon"+></op-icon>+<h1 class="op-modal--title">+ <ng-content></ng-content>+</h1>+<button+ class="op-modal--close-button"+ type="button"+ (click)="close.emit()"+ [attr.aria-label]="text.closePopup"+>+ <op-icon icon-classes="icon-close"></op-icon>+</button>diff --git a/frontend/src/app/modules/modal/modal-header.component.ts b/frontend/src/app/modules/modal/modal-header.component.tsnew file mode 100644index 00000000000..93f4d373e05--- /dev/null+++ b/frontend/src/app/modules/modal/modal-header.component.ts@@ -0,0 +1,26 @@+import {+ Component,+ EventEmitter,+ Input,+ Output,+ HostBinding,+} from '@angular/core';+import {I18nService} from "core-app/modules/common/i18n/i18n.service";++@Component({+ selector: 'op-modal-header',+ templateUrl: './modal-header.component.html',+})+export class OpModalHeaderComponent {+ @HostBinding('class.op-modal--header') className = true;+ @Input() icon:string = '';+ @Output('close') close = new EventEmitter<void>();++ public text = {+ closePopup: this.I18n.t('js.close_popup_title'),+ };++ constructor(+ readonly I18n:I18nService,+ ) {}+}diff --git a/frontend/src/app/modules/modal/modal-overlay.sass b/frontend/src/app/modules/modal/modal-overlay.sassnew file mode 100644index 00000000000..4dc349273bf--- /dev/null+++ b/frontend/src/app/modules/modal/modal-overlay.sass@@ -0,0 +1,18 @@+.op-modal-overlay+ position: fixed+ top: 0+ left: 0+ right: 0+ bottom: 0+ z-index: 9000+ background: rgba(0, 0, 0, 0.75)+ justify-content: center+ align-items: center+ display: none++ &_active+ display: flex++ // TODO: Remove this once the wp preview is not relevant anymore+ &_not-full-screen+ position: relativediff --git a/frontend/src/app/modules/augmenting/services/modal-wrapper.augment.service.ts b/frontend/src/app/modules/modal/modal-wrapper-augment.service.tssimilarity index 87%rename from frontend/src/app/modules/augmenting/services/modal-wrapper.augment.service.tsrename to frontend/src/app/modules/modal/modal-wrapper-augment.service.tsindex 6c70f7c2440..bfe8a002b2c 100644--- a/frontend/src/app/modules/augmenting/services/modal-wrapper.augment.service.ts+++ b/frontend/src/app/modules/modal/modal-wrapper-augment.service.ts@@ -30,12 +30,16 @@import {Inject, Injectable, Injector} from "@angular/core";import {DOCUMENT} from "@angular/common";import {DynamicContentModal} from "core-components/modals/modal-wrapper/dynamic-content.modal";-import {OpModalService} from "core-components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";const iframeSelector = '.iframe-target-wrapper';+/**+ * This service takes modals that are rendered by the rails backend,+ * and re-renders them with the angular op-modal service+ */@Injectable({ providedIn: 'root' })-export class ModalWrapperAugmentService {+export class OpModalWrapperAugmentService {constructor(@Inject(DOCUMENT) protected documentElement:Document,protected injector:Injector,@@ -57,12 +61,8 @@ export class ModalWrapperAugmentService {*/public wrapElement(element:JQuery) {// Find activation link- let activationLink = element.find('.modal-wrapper--activation-link');- let activationSelector = element.data('activationSelector');-- if (activationSelector) {- activationLink = jQuery(activationSelector);- }+ const activationSelector = element.data('activationSelector') || '.modal-delivery-element--activation-link';+ const activationLink = jQuery(activationSelector);const initializeNow = element.data('modalInitializeNow');@@ -83,7 +83,7 @@ export class ModalWrapperAugmentService {const iframeUrl = element.data('modalIframeUrl');// Set template from wrapped element- const wrappedElement = element.find('.modal-wrapper--content');+ const wrappedElement = element.find('.modal-delivery-element');let modalBody = wrappedElement.html();if (iframeUrl) {diff --git a/frontend/src/app/components/op-modals/op-modal.component.ts b/frontend/src/app/modules/modal/modal.component.tssimilarity index 89%rename from frontend/src/app/components/op-modals/op-modal.component.tsrename to frontend/src/app/modules/modal/modal.component.tsindex 02394f8a651..6717d05f95e 100644--- a/frontend/src/app/components/op-modals/op-modal.component.ts+++ b/frontend/src/app/modules/modal/modal.component.ts@@ -1,6 +1,6 @@import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, Directive } from '@angular/core';-import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';-import {OpModalService} from 'core-components/op-modals/op-modal.service';+import {OpModalLocalsMap} from 'core-app/modules/modal/modal.types';+import {OpModalService} from 'core-app/modules/modal/modal.service';import {UntilDestroyedMixin} from "core-app/helpers/angular/until-destroyed.mixin";@Directive()@@ -23,6 +23,9 @@ export abstract class OpModalComponent extends UntilDestroyedMixin implements Onpublic openingEvent = new EventEmitter<this>();+ /* Data to be return from this modal instance */+ public data:unknown;+protected constructor(public locals:OpModalLocalsMap,readonly cdRef:ChangeDetectorRef,readonly elementRef:ElementRef) {diff --git a/frontend/src/app/modules/modal/modal.module.sass b/frontend/src/app/modules/modal/modal.module.sassnew file mode 100644index 00000000000..99965932350--- /dev/null+++ b/frontend/src/app/modules/modal/modal.module.sass@@ -0,0 +1,4 @@+@import './modal-overlay'+@import './modal-delivery-element'+@import './modal'+diff --git a/frontend/src/app/modules/modal/modal.module.ts b/frontend/src/app/modules/modal/modal.module.tsnew file mode 100644index 00000000000..8c4f4e08ff0--- /dev/null+++ b/frontend/src/app/modules/modal/modal.module.ts@@ -0,0 +1,16 @@+import {NgModule} from "@angular/core";+import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module";+import {OpModalService} from "./modal.service";+import {OpModalWrapperAugmentService} from "./modal-wrapper-augment.service";+import {OpModalHeaderComponent} from "./modal-header.component";++@NgModule({+ imports: [ OpenprojectCommonModule ],+ exports: [ OpModalHeaderComponent ],+ providers: [+ OpModalService,+ OpModalWrapperAugmentService,+ ],+ declarations: [ OpModalHeaderComponent ]+})+export class OpenprojectModalModule { }diff --git a/frontend/src/app/modules/modal/modal.sass b/frontend/src/app/modules/modal/modal.sassnew file mode 100644index 00000000000..6318e2b26e9--- /dev/null+++ b/frontend/src/app/modules/modal/modal.sass@@ -0,0 +1,70 @@+// TODO: Check out -danger-zone and modal-close-button patterns+.op-modal+ display: flex+ flex-direction: column+ align-items: stretch+ background: white++ width: 30rem+ min-height: 20vh++ max-width: 100vw+ max-height: 100vh++ &_wide+ width: 70rem+ min-height: 40vh++ &--body+ padding: 1rem+ flex-grow: 1+ flex-shrink: 1+ overflow-y: auto+ @include styled-scroll-bar++ &--header+ display: flex+ padding: 2rem 1rem 1rem 1rem+ position: relative+ border-bottom: 1px solid #eee++ &_highlight+ background-color: var(--header-bg-color)+ border-bottom-width: var(--header-border-bottom-width)+ border-bottom-color: var(--header-border-bottom-color)++ *+ color: var(--header-item-font-color)++ .op-icon+ height: 100%+ width: 3rem+ padding: 0.45rem 0+ display: flex+ justify-content: center+ align-items: center++ &--title+ font-size: 1.3rem+ padding: 0+ margin: 0+ margin-right: auto++ &--footer+ padding: 1rem 1rem 2rem 1rem++ &--close-button+ height: 100%+ width: 3rem+ padding: 0.45rem 0+ display: flex+ justify-content: center+ align-items: center+ cursor: pointer+ color: var(--body-font-color)+ background: transparent+ border: 0++ &:hover+ text-decoration: none+ color: var(--content-link-color)diff --git a/frontend/src/app/components/op-modals/op-modal.service.ts b/frontend/src/app/modules/modal/modal.service.tssimilarity index 85%rename from frontend/src/app/components/op-modals/op-modal.service.tsrename to frontend/src/app/modules/modal/modal.service.tsindex bbbc61ef50a..5102f5fc609 100644--- a/frontend/src/app/components/op-modals/op-modal.service.ts+++ b/frontend/src/app/modules/modal/modal.service.ts@@ -8,7 +8,7 @@ import {} from '@angular/core';import {ComponentPortal, ComponentType, DomPortalOutlet, PortalInjector} from '@angular/cdk/portal';import {TransitionService} from '@uirouter/core';-import {OpModalComponent} from 'core-components/op-modals/op-modal.component';+import {OpModalComponent} from 'core-app/modules/modal/modal.component';import {keyCodes} from 'core-app/modules/common/keyCodes.enum';import {FocusHelperService} from 'core-app/modules/common/focus/focus-helper';@@ -33,7 +33,7 @@ export class OpModalService {private injector:Injector) {const hostElement = this.portalHostElement = document.createElement('div');- hostElement.classList.add('op-modals--overlay');+ hostElement.classList.add('op-modal-overlay');document.body.appendChild(hostElement);// Listen to keyups on window to close context menus@@ -71,7 +71,12 @@ export class OpModalService {* Can be passed 'global' to take the default (global!) injector of this service.* @param locals A map to be injected via token into the component.*/- public show<T extends OpModalComponent>(modal:ComponentType<T>, injector:Injector|'global', locals:any = {}):T {+ public show<T extends OpModalComponent>(+ modal:ComponentType<T>,+ injector:Injector|'global',+ locals:any = {},+ notFullScreen:boolean = false, // TODO: Remove this option once `WpPreviewModal` is not a modal anymore+ ):T {this.close();// Prevent closing events during the opening time frame.@@ -87,7 +92,10 @@ export class OpModalService {const ref:ComponentRef<OpModalComponent> = this.bodyPortalHost.attach(portal) as ComponentRef<OpModalComponent>;const instance = ref.instance as T;this.active = instance;- this.portalHostElement.style.display = 'block';+ this.portalHostElement.classList.add('op-modal-overlay_active');+ if (notFullScreen) {+ this.portalHostElement.classList.add('op-modal-overlay_not-full-screen');+ }setTimeout(() => {// Focus on the first element@@ -97,8 +105,6 @@ export class OpModalService {this.opening = false;}, 20);- jQuery('.op-modal--modal-container').focus();-return this.active as T;}@@ -114,13 +120,14 @@ export class OpModalService {if (this.active && this.active.onClose()) {this.active.closingEvent.emit(this.active);this.bodyPortalHost.detach();- this.portalHostElement.style.display = 'none';+ this.portalHostElement.classList.remove('op-modal-overlay_active');+ this.portalHostElement.classList.remove('op-modal-overlay_not-full-screen');this.active = null;}}public get activeModal():JQuery {- return jQuery(this.portalHostElement).find('.op-modal--portal');+ return jQuery(this.portalHostElement).find('.op-modal');}/**diff --git a/frontend/src/app/components/op-modals/op-modal.types.ts b/frontend/src/app/modules/modal/modal.types.tssimilarity index 53%rename from frontend/src/app/components/op-modals/op-modal.types.tsrename to frontend/src/app/modules/modal/modal.types.tsindex b74ed00e856..55796e5e0d1 100644--- a/frontend/src/app/components/op-modals/op-modal.types.ts+++ b/frontend/src/app/modules/modal/modal.types.ts@@ -1,4 +1,4 @@-import {OpModalService} from 'core-components/op-modals/op-modal.service';+import {OpModalService} from './modal.service';export interface OpModalLocalsMap {service:OpModalService;diff --git a/frontend/src/app/modules/my-page/openproject-my-page.module.ts b/frontend/src/app/modules/my-page/openproject-my-page.module.tsindex 2c274ef3ec1..2cb4a08fe62 100644--- a/frontend/src/app/modules/my-page/openproject-my-page.module.ts+++ b/frontend/src/app/modules/my-page/openproject-my-page.module.ts@@ -27,8 +27,9 @@//++import {NgModule} from '@angular/core';-import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module";import {Ng2StateDeclaration, UIRouterModule} from "@uirouter/angular";+import {OpenprojectCommonModule} from "core-app/modules/common/openproject-common.module";+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";import {OpenprojectGridsModule} from "core-app/modules/grids/openproject-grids.module";import {MyPageComponent} from "core-app/modules/my-page/my-page.component";@@ -47,8 +48,8 @@ export const MY_PAGE_ROUTES:Ng2StateDeclaration[] = [@NgModule({imports: [OpenprojectCommonModule,-OpenprojectGridsModule,+ OpenprojectModalModule,// Routes for my_pageUIRouterModule.forChild({ states: MY_PAGE_ROUTES }),diff --git a/frontend/src/app/modules/plugins/plugin-context.ts b/frontend/src/app/modules/plugins/plugin-context.tsindex 8da4a516dc9..70eefcb0f01 100644--- a/frontend/src/app/modules/plugins/plugin-context.ts+++ b/frontend/src/app/modules/plugins/plugin-context.ts@@ -6,7 +6,7 @@ import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {ExternalQueryConfigurationService} from "core-components/wp-table/external-configuration/external-query-configuration.service";import {HalResourceService} from "core-app/modules/hal/services/hal-resource.service";import {PasswordConfirmationModal} from "../../components/modals/request-for-confirmation/password-confirmation.modal";-import {OpModalService} from "../../components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {DynamicContentModal} from "../../components/modals/modal-wrapper/dynamic-content.modal";import {DisplayField} from "core-app/modules/fields/display/display-field.module";import {HalResource} from "core-app/modules/hal/resources/hal-resource";diff --git a/frontend/src/app/modules/time_entries/create/create.service.ts b/frontend/src/app/modules/time_entries/create/create.service.tsindex b8925f21a97..cf1e0e4e7a5 100644--- a/frontend/src/app/modules/time_entries/create/create.service.ts+++ b/frontend/src/app/modules/time_entries/create/create.service.ts@@ -1,5 +1,5 @@import { Injectable, Injector } from "@angular/core";-import { OpModalService } from "app/components/op-modals/op-modal.service";+import { OpModalService } from "core-app/modules/modal/modal.service";import { HalResourceService } from "app/modules/hal/services/hal-resource.service";import { I18nService } from "core-app/modules/common/i18n/i18n.service";import { TimeEntryResource } from 'core-app/modules/hal/resources/time-entry-resource';diff --git a/frontend/src/app/modules/time_entries/edit/edit.service.ts b/frontend/src/app/modules/time_entries/edit/edit.service.tsindex 9360911d485..34fef01fcb8 100644--- a/frontend/src/app/modules/time_entries/edit/edit.service.ts+++ b/frontend/src/app/modules/time_entries/edit/edit.service.ts@@ -1,5 +1,5 @@import {Injectable, Injector} from "@angular/core";-import {OpModalService} from "app/components/op-modals/op-modal.service";+import {OpModalService} from "core-app/modules/modal/modal.service";import {HalResourceService} from "app/modules/hal/services/hal-resource.service";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import { TimeEntryResource } from 'core-app/modules/hal/resources/time-entry-resource';diff --git a/frontend/src/app/modules/time_entries/openproject-time-entries.module.ts b/frontend/src/app/modules/time_entries/openproject-time-entries.module.tsindex 3b043e86c19..c994461328c 100644--- a/frontend/src/app/modules/time_entries/openproject-time-entries.module.ts+++ b/frontend/src/app/modules/time_entries/openproject-time-entries.module.ts@@ -26,8 +26,9 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpenprojectCommonModule} from 'core-app/modules/common/openproject-common.module';import {NgModule} from '@angular/core';+import {OpenprojectCommonModule} from 'core-app/modules/common/openproject-common.module';+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";import {OpenprojectFieldsModule} from "core-app/modules/fields/openproject-fields.module";import {TimeEntryCreateModal} from "core-app/modules/time_entries/create/create.modal";import {TimeEntryEditModal} from "core-app/modules/time_entries/edit/edit.modal";@@ -40,6 +41,7 @@ import {HalResourceEditingService} from "core-app/modules/fields/edit/services/himports: [// CommonsOpenprojectCommonModule,+ OpenprojectModalModule,// Editable fields e.g. for modalsOpenprojectFieldsModule,diff --git a/frontend/src/app/modules/time_entries/shared/modal/base.modal.html b/frontend/src/app/modules/time_entries/shared/modal/base.modal.htmlindex dfc0cf4206a..21beaeff30d 100644--- a/frontend/src/app/modules/time_entries/shared/modal/base.modal.html+++ b/frontend/src/app/modules/time_entries/shared/modal/base.modal.html@@ -1,57 +1,47 @@-<div class="op-modal--portal ngdialog-theme-openproject">- <div class="op-modal--modal-container confirm-dialog--modal loading-indicator--location"- data-indicator-name="modal"- tabindex="0">- <div class="op-modal--modal-header">- <a class="op-modal--modal-close-button">- <i- class="icon-close"- (click)="closeMe($event)"- [attr.title]="text.close">- </i>- </a>- <h3 class="icon-context icon-log_time" [textContent]="text.title"></h3>- </div>+<div+ class="op-modal configm-dialog--modal loading-indicator--location"+ data-indicator-name="modal"+>+ <op-modal-header (close)="closeMe($event)">{{text.title}}</op-modal-header>- <div class="ngdialog-body op-modal--modal-body">- <te-form #editForm- [changeset]="changeset"- [showWorkPackageField]="showWorkPackageField"- (modifiedEntry)="setModifiedEntry($event)">- </te-form>- </div>+ <div class="ngdialog-body op-modal--body">+ <te-form #editForm+ [changeset]="changeset"+ [showWorkPackageField]="showWorkPackageField"+ (modifiedEntry)="setModifiedEntry($event)">+ </te-form>+ </div>- <div class="op-modal--modal-footer">- <button class="button -highlight"- *ngIf="saveAllowed"- (click)="saveEntry()"- [attr.title]="saveText"- [disabled]="formInFlight">- <op-icon icon-classes="button--icon icon-checkmark"></op-icon>- <span class="button--text"- [textContent]="saveText"- aria-hidden="true"></span>- </button>+ <div class="op-modal--footer">+ <button class="button -highlight"+ *ngIf="saveAllowed"+ (click)="saveEntry()"+ [attr.title]="saveText"+ [disabled]="formInFlight">+ <op-icon icon-classes="button--icon icon-checkmark"></op-icon>+ <span class="button--text"+ [textContent]="saveText"+ aria-hidden="true"></span>+ </button>- <button class="button"- *ngIf="saveAllowed"- (click)="closeMe($event)"- [attr.title]="text.cancel">- <op-icon icon-classes="button--icon icon-close"></op-icon>- <span class="button--text"- [textContent]="text.cancel"- aria-hidden="true"></span>- </button>+ <button class="button"+ *ngIf="saveAllowed"+ (click)="closeMe($event)"+ [attr.title]="text.cancel">+ <op-icon icon-classes="button--icon icon-close"></op-icon>+ <span class="button--text"+ [textContent]="text.cancel"+ aria-hidden="true"></span>+ </button>- <button class="button"- *ngIf="deleteAllowed"- (click)="destroy()"- [attr.title]="text.delete">- <op-icon icon-classes="button--icon icon-delete"></op-icon>- <span class="button--text"- [textContent]="text.delete"- aria-hidden="true"></span>- </button>- </div>+ <button class="button"+ *ngIf="deleteAllowed"+ (click)="destroy()"+ [attr.title]="text.delete">+ <op-icon icon-classes="button--icon icon-delete"></op-icon>+ <span class="button--text"+ [textContent]="text.delete"+ aria-hidden="true"></span>+ </button></div></div>diff --git a/frontend/src/app/modules/time_entries/shared/modal/base.modal.ts b/frontend/src/app/modules/time_entries/shared/modal/base.modal.tsindex d81ccceff86..4c4c63f5635 100644--- a/frontend/src/app/modules/time_entries/shared/modal/base.modal.ts+++ b/frontend/src/app/modules/time_entries/shared/modal/base.modal.ts@@ -1,7 +1,7 @@import { ElementRef, Inject, ChangeDetectorRef, ViewChild, Directive, Injector } from "@angular/core";-import {OpModalComponent} from "app/components/op-modals/op-modal.component";-import {OpModalLocalsToken} from "app/components/op-modals/op-modal.service";-import {OpModalLocalsMap} from "app/components/op-modals/op-modal.types";+import {OpModalComponent} from "core-app/modules/modal/modal.component";+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";+import {OpModalLocalsMap} from "core-app/modules/modal/modal.types";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {TimeEntryFormComponent} from "core-app/modules/time_entries/form/form.component";import {HalResource} from "core-app/modules/hal/resources/hal-resource";diff --git a/frontend/src/app/modules/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts b/frontend/src/app/modules/work-package-graphs/configuration-modal/wp-graph-configuration.modal.tsindex 904529eaf59..e6b4c919569 100644--- a/frontend/src/app/modules/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts+++ b/frontend/src/app/modules/work-package-graphs/configuration-modal/wp-graph-configuration.modal.ts@@ -12,9 +12,10 @@ import {Optional,ViewChild} from '@angular/core';-import {OpModalLocalsMap} from 'core-components/op-modals/op-modal.types';+import {OpModalLocalsMap} from 'core-app/modules/modal/modal.types';+import {OpModalComponent} from 'core-app/modules/modal/modal.component';+import {OpModalLocalsToken} from "core-app/modules/modal/modal.service";import {ConfigurationService} from 'core-app/modules/common/config/configuration.service';-import {OpModalComponent} from 'core-components/op-modals/op-modal.component';import {ActiveTabInterface,TabComponent,@@ -23,7 +24,6 @@ import {} from 'core-components/wp-table/configuration-modal/tab-portal-outlet';import {LoadingIndicatorService} from 'core-app/modules/common/loading-indicator/loading-indicator.service';import {I18nService} from "core-app/modules/common/i18n/i18n.service";-import {OpModalLocalsToken} from "core-components/op-modals/op-modal.service";import {ComponentType} from "@angular/cdk/portal";import {WpGraphConfigurationService} from "core-app/modules/work-package-graphs/configuration/wp-graph-configuration.service";import {WpGraphConfiguration} from "core-app/modules/work-package-graphs/configuration/wp-graph-configuration";diff --git a/frontend/src/app/modules/work-package-graphs/openproject-work-package-graphs.module.ts b/frontend/src/app/modules/work-package-graphs/openproject-work-package-graphs.module.tsindex 6bca5238ce3..618b15526c8 100644--- a/frontend/src/app/modules/work-package-graphs/openproject-work-package-graphs.module.ts+++ b/frontend/src/app/modules/work-package-graphs/openproject-work-package-graphs.module.ts@@ -26,8 +26,9 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {OpenprojectCommonModule} from 'core-app/modules/common/openproject-common.module';import {NgModule} from '@angular/core';+import {OpenprojectCommonModule} from 'core-app/modules/common/openproject-common.module';+import {OpenprojectModalModule} from "core-app/modules/modal/modal.module";import {OpenprojectWorkPackagesModule} from "core-app/modules/work_packages/openproject-work-packages.module";import {WpGraphConfigurationModalComponent} from "core-app/modules/work-package-graphs/configuration-modal/wp-graph-configuration.modal";import {WpGraphConfigurationFiltersTab} from "core-app/modules/work-package-graphs/configuration-modal/tabs/filters-tab.component";@@ -43,6 +44,7 @@ import * as ChartDataLabels from 'chartjs-plugin-datalabels';imports: [// CommonsOpenprojectCommonModule,+ OpenprojectModalModule,OpenprojectWorkPackagesModule,diff --git a/frontend/src/app/modules/work_packages/openproject-work-packages.module.ts b/frontend/src/app/modules/work_packages/openproject-work-packages.module.tsindex 360eabc0957..5d9575fc192 100644--- a/frontend/src/app/modules/work_packages/openproject-work-packages.module.ts+++ b/frontend/src/app/modules/work_packages/openproject-work-packages.module.ts@@ -26,15 +26,16 @@// See docs/COPYRIGHT.rdoc for more details.//+++import {Injector, NgModule} from '@angular/core';import {OpenprojectCommonModule} from 'core-app/modules/common/openproject-common.module';-import {WorkPackageFormAttributeGroupComponent} from 'core-components/wp-form-group/wp-attribute-group.component';import {OpenprojectFieldsModule} from 'core-app/modules/fields/openproject-fields.module';-import {Injector, NgModule} from '@angular/core';+import {OpenprojectModalModule} from 'core-app/modules/modal/modal.module';+import {HookService} from 'core-app/modules/plugins/hook-service';import {GroupDescriptor,WorkPackageSingleViewComponent} from 'core-components/work-packages/wp-single-view/wp-single-view.component';-import {HookService} from 'core-app/modules/plugins/hook-service';+import {WorkPackageFormAttributeGroupComponent} from 'core-components/wp-form-group/wp-attribute-group.component';import {WorkPackageEmbeddedTableComponent} from 'core-components/wp-table/embedded/wp-embedded-table.component';import {WorkPackageEmbeddedTableEntryComponent} from 'core-components/wp-table/embedded/wp-embedded-table-entry.component';import {WorkPackageTablePaginationComponent} from 'core-components/wp-table/table-pagination/wp-table-pagination.component';@@ -168,6 +169,7 @@ import {BackButtonComponent} from "core-app/modules/common/back-routing/back-butimport {DatePickerModal} from "core-components/datepicker/datepicker.modal";import {WorkPackagesTableComponent} from "core-components/wp-table/wp-table.component";import {WorkPackageGroupToggleDropdownMenuDirective} from "core-components/op-context-menu/handlers/wp-group-toggle-dropdown-menu.directive";+import {OpenprojectAutocompleterModule} from "core-app/modules/autocompleter/openproject-autocompleter.module";@NgModule({imports: [@@ -183,6 +185,10 @@ import {WorkPackageGroupToggleDropdownMenuDirective} from "core-components/op-coOpenprojectBcfModule,OpenprojectProjectsModule,++ OpenprojectModalModule,++ OpenprojectAutocompleterModule,],providers: [// Notification servicediff --git a/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.html b/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.htmlindex 594436edbb1..7d240a306db 100644--- a/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.html+++ b/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.html@@ -17,7 +17,6 @@<ul class="toolbar-items hide-when-print"*ngIf="showToolbar">-<ng-container *ngFor="let definition of toolbarButtonComponents"><li class="toolbar-item"*ngIf="!definition.show || definition.show()"diff --git a/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.ts b/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.tsindex 287bcc86563..ffc3574789d 100644--- a/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.ts+++ b/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.ts@@ -39,6 +39,8 @@ import {ComponentType} from "@angular/cdk/overlay";import {Ng2StateDeclaration} from "@uirouter/angular";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {WorkPackageFilterContainerComponent} from "core-components/filters/filter-container/filter-container.directive";+import {OpModalService} from 'core-app/modules/modal/modal.service';+import {InviteUserModalComponent} from 'core-app/modules/invite-user-modal/invite-user.component';export interface DynamicComponentDefinition {component:ComponentType<any>;@@ -68,6 +70,7 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase imp@InjectField() I18n!:I18nService;@InjectField() titleService:OpTitleService;@InjectField() queryParamListener:QueryParamListenerService;+ @InjectField() opModalService:OpModalService;text:{ [key:string]:string } = {'jump_to_pagination': this.I18n.t('js.work_packages.jump_marks.pagination'),@@ -257,6 +260,15 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase imp});}+ protected inviteModal = InviteUserModalComponent;++ openInviteUserModal() {+ const inviteModal = this.opModalService.show(this.inviteModal, 'global');+ inviteModal.closingEvent.subscribe((modal:any) => {+ console.log('Modal closed!', modal);+ });+ }+protected loadFirstPage():Promise<QueryResource> {if (this.currentQuery) {return this.wpListService.reloadQuery(this.currentQuery, this.projectIdentifier).toPromise();diff --git a/frontend/src/global_styles/content/_accounts.sass b/frontend/src/global_styles/content/_accounts.sassindex 6953226568a..10dbdf44e2e 100644--- a/frontend/src/global_styles/content/_accounts.sass+++ b/frontend/src/global_styles/content/_accounts.sass@@ -48,8 +48,8 @@display: inline-block// use id selectors to be specific enough to override general content and top-menu definitions-#content .login-auth-providers, #top-menu #nav-login-content .login-auth-providers,-.modal-wrapper .login-auth-providers+#content .login-auth-providers,+#top-menu #nav-login-content .login-auth-providerswidth: 471pxmargin-top: 25px@@ -110,9 +110,6 @@line-height: normalwhite-space: normal-.modal-wrapper .login-auth-providers h3 span- background: var(--header-drop-down-bg-color)-#top-menu #nav-login-content .login-auth-providersh3&:beforediff --git a/frontend/src/global_styles/content/_index.sass b/frontend/src/global_styles/content/_index.sassindex 49198448813..aa8bb1ab1cc 100644--- a/frontend/src/global_styles/content/_index.sass+++ b/frontend/src/global_styles/content/_index.sass@@ -42,7 +42,6 @@@import tabular@import types_form_configuration@import user-@import modal@import journal@import pagination@import progress_bardiff --git a/frontend/src/global_styles/content/_modal.sass b/frontend/src/global_styles/content/_modal.sassdeleted file mode 100644index bf46db2811f..00000000000--- a/frontend/src/global_styles/content/_modal.sass+++ /dev/null@@ -1,212 +0,0 @@-//-- copyright-// OpenProject is an open source project management software.-// Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.-//++--$ng-modal-padding: 3em-$ng-modal-image-height: 135px--// The portal element of a modal element-// ( = the outer element should span the entire view )-.op-modal--portal- // overlay- position: fixed- left: 0- top: 0- right: 0- bottom: 0- background: rgba(0, 0, 0, 0.75)- text-align: left- z-index: 9000-- // Center modal content vertically and horizontally- display: flex- align-items: center- justify-content: center-- &.-transparent- background: transparent--// The inner modal element containing header, body, and footer-// This is placed within --portal-.op-modal--modal-container- transition: opacity 0.25s ease- background: var(--body-background)- position: relative- padding: 5px $ng-modal-padding / 2- min-width: 200px- max-width: 60vw- overflow-y: auto-- @include styled-scroll-bar-- &.-wide-fixed- width: 75vw- min-height: 40vh-- &.-wide- min-width: 75vw- min-height: 40vh-- &.-slim- min-width: 25vw- min-height: 20vh--.op-modal--modal-header- display: flex- align-items: center- height: var(--header-height)- padding: 0 45px 0 0- margin-bottom: 15px- border-bottom: 1px solid var(--light-gray)-- *- height: var(--header-height)- line-height: var(--header-height)-- h2, h3- border: none- @include text-shortener- margin: 0--.op-modal--modal-body- margin: 1em 0- max-height: calc(100vh - var(--header-height) - var(--header-height))- overflow: auto- @include styled-scroll-bar-- &.-formattable- p:last-of-type- margin-bottom: 0px--.op-modal--modal-footer- margin: 1.5rem 0-- button- margin-bottom: 0-- &:last-of-type- margin-right: 0--.op-modal--modal-close-button- position: absolute- right: 25px- top: 4px- cursor: pointer- color: var(--body-font-color)- &:hover- text-decoration: none- color: var(--content-link-color)--// Highlighted modal style matching header menu-.op-modal--modal-container.-highlight- padding: 0-- .op-modal--modal-body,- .op-modal--modal-footer- padding: 0 1.5rem-- // Overridden header styles- .op-modal--modal-header- padding-left: 1.5rem- background-color: var(--header-bg-color)- border-bottom-width: var(--header-border-bottom-width)- border-bottom-color: var(--header-border-bottom-color)-- *- color: var(--header-item-font-color)-- .op-modal--modal-close-button- top: 0- color: var(--header-item-font-color)-- .avatar- margin-right: 0.5rem-- &.-danger-zone- .op-modal--modal-header- background-color: var(--content-form-danger-zone-bg-color)- border-bottom-color: var(--content-form-danger-zone-bg-color)-- .op-modal--modal-close-button- color: var(--content-form-danger-zone-font-color)---// Specific styles for columns-modal-.columns-modal--content- margin-bottom: 15px- label- display: inline- padding-right: 30px--.ee-relation-columns-upsale- margin-top: -0.7rem- padding-bottom: 1rem--// Specific styles for export-modal-ul.export-options- display: flex- flex-wrap: wrap- margin: 0- padding: 20px 0- list-style-type: none- li- flex: 1 1 calc(33% - 40px) // line break after third element- margin: 20px- text-align: center- a- cursor: pointer- text-decoration: none- color: var(--body-font-color)- font-weight: normal- overflow-wrap: break-word- word-wrap: break-word- &:hover, &:active- text-decoration: none- color: var(--body-font-color)- span.export-label- display: block- padding: 10px 0 0 0--// Legacy styles for jQuery UI modal-.ui-dialog.ui-widget- overflow: visible--// remove iframe border explicitly because Firefox does add it for some reason-#modalIframe- border: 0--// Hide modal content forwarded from rails-// for the dynamic modal-.modal-wrapper--content- display: none---@include breakpoint(680px down)- .wp-table--configuration-modal,- .op-modal--modal-container- width: 90vw- max-width: unsetdiff --git a/frontend/src/global_styles/content/modules/_auth_plugins.sass b/frontend/src/global_styles/content/modules/_auth_plugins.sassindex a9bf033af4f..9b184b686b0 100644--- a/frontend/src/global_styles/content/modules/_auth_plugins.sass+++ b/frontend/src/global_styles/content/modules/_auth_plugins.sass@@ -21,8 +21,7 @@// see: https://developers.google.com/identity/branding-guidelines// !important is necessary to overwrite the default styling options#top-menu #nav-login-content .login-auth-providers a.auth-provider.auth-provider-google,-#content .login-auth-providers a.auth-provider-google,-.modal-wrapper .login-auth-providers a.auth-provider-google+#content .login-auth-providers a.auth-provider-googlepadding: 8px 8px 8px 50pxbackground-position-x: 8pxbackground-size: 18px 18pxdiff --git a/frontend/src/global_styles/openproject.sass b/frontend/src/global_styles/openproject.sassindex dc3ddd966fe..71117ab71cc 100644--- a/frontend/src/global_styles/openproject.sass+++ b/frontend/src/global_styles/openproject.sass@@ -2,4 +2,7 @@@import "openproject/_index.sass"@import "vendor/_index.sass"@import "layout/_index.sass"-@import "content/_index.sass"\ No newline at end of file+@import "content/_index.sass"++@import "../app/modules/common/openproject-common.module"+@import "../app/modules/modal/modal.module"\ No newline at end of filediff --git a/frontend/src/global_styles/vendor/_index.sass b/frontend/src/global_styles/vendor/_index.sassindex e3ab359a7f7..6c523e9851b 100644--- a/frontend/src/global_styles/vendor/_index.sass+++ b/frontend/src/global_styles/vendor/_index.sass@@ -2,3 +2,4 @@@import dragula@import enjoyhint+@import ngselectdiff --git a/frontend/src/global_styles/vendor/_ngselect.sass b/frontend/src/global_styles/vendor/_ngselect.sassnew file mode 100644index 00000000000..04790c7026b--- /dev/null+++ b/frontend/src/global_styles/vendor/_ngselect.sass@@ -0,0 +1,2 @@+.ng-dropdown-footer+ padding: 0 !important\ No newline at end of filediff --git a/modules/bim/spec/features/bcf/export_spec.rb b/modules/bim/spec/features/bcf/export_spec.rbindex da5e7619a0f..bb03311fcf8 100644--- a/modules/bim/spec/features/bcf/export_spec.rb+++ b/modules/bim/spec/features/bcf/export_spec.rb@@ -88,7 +88,7 @@ describe 'bcf export',expect(page).to have_text("completed successfully")# Close the modal- page.find('.op-modal--modal-close-button').click+ page.find('.op-modal--close-button').click@download_list.refresh_from(page)diff --git a/modules/boards/spec/features/support/board_page.rb b/modules/boards/spec/features/support/board_page.rbindex 0e3ec4e2dc0..8ee0dd2ecd3 100644--- a/modules/boards/spec/features/support/board_page.rb+++ b/modules/boards/spec/features/support/board_page.rb@@ -352,7 +352,7 @@ module Pagesdef open_and_fill_add_list_modal(name)open_add_list_modalsleep(0.1)- page.find('.op-modal--modal-container .new-list--action-select input').set(name)+ page.find('.op-modal .new-list--action-select input').set(name)enddef open_add_list_modal@@ -361,7 +361,7 @@ module Pagesenddef add_list_modal_shows_warning(value, with_link: false)- within page.find('.op-modal--modal-container') do+ within page.find('.op-modal') dowarning = '.notification-box.-warning'link = '.notification-box--content a'diff --git a/modules/grids/spec/support/pages/grid.rb b/modules/grids/spec/support/pages/grid.rbindex c1f65f4b904..9821f3f2602 100644--- a/modules/grids/spec/support/pages/grid.rb+++ b/modules/grids/spec/support/pages/grid.rb@@ -83,7 +83,7 @@ module Pagesarea.hoverarea.find('.grid--widget-add', visible: :all).click- within '.op-modal--portal', &block+ within '.op-modal', &blockenddef expect_widget_adding_prohibited_generally(row_number = 1, column_number = 1)diff --git a/modules/webhooks/app/cells/views/response_body.erb b/modules/webhooks/app/cells/views/response_body.erbindex 740821e3f48..cbdfed4c792 100644--- a/modules/webhooks/app/cells/views/response_body.erb+++ b/modules/webhooks/app/cells/views/response_body.erb@@ -1,28 +1,41 @@-<section data-augmented-model-wrapper>- <a class="modal-wrapper--activation-link" title="<%= log_entry.class.human_attribute_name('response_body') %>">+<section+ data-augmented-model-wrapper+ data-modal-class-name="webhooks--response-body-modal"+>+ <a class="modal-delivery-element--activation-link" title="<%= log_entry.class.human_attribute_name('response_body') %>"><%= op_icon('icon-info1') %><%= t(:button_show) %></a>- <div style="display: none" class="modal-wrapper--content ngdialog-theme-openproject">- <div class="webhooks--response-body-modal">- <div class="modal--header">- <h2><%= log_entry.class.human_attribute_name('response_body') %></h2>- </div>- <div class="ngdialog-body modal--main -inner-scroll">- <h2>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>- <pre class="webhooks--response-body">- <%= log_entry.response_body %>- </pre>- </div>- <div class="modal--footer">- <button class="button dynamic-content-modal--close-button button"- title="<%= t(:button_close) %>">- <%= t(:button_close)%>- </button>- </div>- </div>+ <div class="modal-delivery-element">+ <div class="op-modal--header">+ <h1 class="op-modal--title">+ <%= log_entry.class.human_attribute_name('response_body') %>+ </h1>+ <button+ type="button"+ class="op-modal--close-button"+ aria-label="<%= t(:button_close) %>"+ >+ <%= op_icon('icon-close') %>+ </button>+ </div>+ <div class="op-modal--body">+ <h2>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>+ <pre class="webhooks--response-body">+ <%= log_entry.response_body %>+ </pre>+ </div>+ <div class="op-modal--footer">+ <button+ class="button"+ title="<%= t(:button_close) %>"+ dynamic-content-modal-close-button+ >+ <%= t(:button_close)%>+ </button>+ </div></div></section>\ No newline at end of filediff --git a/modules/webhooks/spec/features/manage_webhooks_spec.rb b/modules/webhooks/spec/features/manage_webhooks_spec.rbindex 9ef0faae448..f0757858c18 100644--- a/modules/webhooks/spec/features/manage_webhooks_spec.rb+++ b/modules/webhooks/spec/features/manage_webhooks_spec.rb@@ -98,7 +98,7 @@ describe 'Manage webhooks through UI', type: :feature, js: true doSeleniumHubWaiter.waitfind('td.response_body a', text: 'Show').click- page.within('.webhooks--response-body-modal') do+ page.within('.op-modal') doexpect(page).to have_selector('.webhooks--response-headers strong', text: 'test')expect(page).to have_selector('.webhooks--response-body', text: log.response_body)enddiff --git a/spec/features/support/components/attribute_help_text_modal.rb b/spec/features/support/components/attribute_help_text_modal.rbindex 872fd184a1d..5155f57dbcb 100644--- a/spec/features/support/components/attribute_help_text_modal.rb+++ b/spec/features/support/components/attribute_help_text_modal.rb@@ -53,14 +53,14 @@ module Componentsdef open!SeleniumHubWaiter.waitcontainer.find(".help-text--for-#{help_text.attribute_name}").click- expect(page).to have_selector('.attribute-help-text--modal h3', text: help_text.attribute_caption)+ expect(page).to have_selector('.attribute-help-text--modal h1', text: help_text.attribute_caption)enddef close!within modal_container dopage.find('.icon-close').clickend- expect(page).to have_no_selector('.attribute-help-text--modal h3', text: help_text.attribute_caption)+ expect(page).to have_no_selector('.attribute-help-text--modal h1', text: help_text.attribute_caption)enddef expect_edit(admin:)diff --git a/spec/features/support/components/time_logging_modal.rb b/spec/features/support/components/time_logging_modal.rbindex 47dd7f4e89b..491a32b4160 100644--- a/spec/features/support/components/time_logging_modal.rb+++ b/spec/features/support/components/time_logging_modal.rb@@ -52,7 +52,7 @@ module Components.to have_content(I18n.t('js.button_log_time'))endelse- expect(page).to have_no_selector '.op-modal--modal-container'+ expect(page).to have_no_selector '.op-modal'endend@@ -133,7 +133,7 @@ module Componentsenddef modal_container- page.find('.op-modal--modal-container')+ page.find('.op-modal')endendenddiff --git a/spec/features/users/invitation_spec.rb b/spec/features/users/invitation_spec.rbindex 600ce789a1d..8993f6e2609 100644--- a/spec/features/users/invitation_spec.rb+++ b/spec/features/users/invitation_spec.rb@@ -50,7 +50,7 @@ feature 'invitation spec', type: :feature, js: true do# Visit invitation link with correct tokenvisit account_activate_path(token: Token::Invitation.last.value)- expect(page).to have_selector('.op-modal--modal-header', text: 'Welcome to OpenProject')+ expect(page).to have_selector('.op-modal--header', text: 'Welcome to OpenProject')endcontext 'as admin' dodiff --git a/spec/features/users/invite_user_modal_spec.rb b/spec/features/users/invite_user_modal_spec.rbnew file mode 100644index 00000000000..b7fc93eb71f--- /dev/null+++ b/spec/features/users/invite_user_modal_spec.rb@@ -0,0 +1,101 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.+#++++require 'spec_helper'++feature 'Invite user modal', type: :feature, js: true do+ shared_let(:project) { FactoryBot.create :project }+ shared_let(:work_package) { FactoryBot.create :work_package, project: project }++ let(:permissions) { %i[view_work_packages edit_work_packages manage_members] }+ current_user do+ FactoryBot.create :user,+ member_in_project: project,+ member_through_role: role+ end++ let!(:non_project_user) do+ FactoryBot.create :user,+ firstname: 'Nonproject',+ lastname: 'User'+ end++ let!(:role) do+ FactoryBot.create :role,+ name: 'Member',+ permissions: permissions+ end++ describe 'through the assignee field' do+ let(:wp_page) { Pages::FullWorkPackage.new(work_package, project) }+ let(:assignee_field) { wp_page.edit_field :assignee }+ let(:modal) { ::Components::Users::InviteUserModal.new }++ before do+ wp_page.visit!+ end++ it 'can add an existing user to the project' do+ assignee_field.activate!++ find('.ng-dropdown-footer button', text: 'Invite', wait: 10).click++ modal.expect_open++ # STEP 1: Project and type+ modal.expect_title 'Invite user'+ modal.autocomplete project.name+ modal.select_type 'User'++ modal.next++ # STEP 2: User name+ modal.autocomplete non_project_user.name+ modal.next++ # STEP 3: Role name+ modal.autocomplete role.name+ modal.next++ # STEP 4: Invite message+ modal.invitation_message 'Welcome user!'+ modal.click_modal_button 'Review Invitation'++ modal.within_modal do+ expect(page).to have_text project.name+ expect(page).to have_text non_project_user.name+ expect(page).to have_text role.name+ expect(page).to have_text 'Welcome user!'+ end+ end++ context 'when the user has no permission to manage members' do+ let(:permissions) { %i[view_work_packages edit_work_packages] }+ end+ end+enddiff --git a/spec/features/work_packages/export_spec.rb b/spec/features/work_packages/export_spec.rbindex d0a680cc577..3157a079eda 100644--- a/spec/features/work_packages/export_spec.rb+++ b/spec/features/work_packages/export_spec.rb@@ -73,7 +73,7 @@ describe 'work package export', type: :feature dowait: 10# Expect title- expect(page).to have_selector 'h3', text: I18n.t('export.your_work_packages_export')+ expect(page).to have_selector 'h1', text: I18n.t('export.your_work_packages_export')beginperform_enqueued_jobsdiff --git a/spec/features/wysiwyg/macros/child_pages_spec.rb b/spec/features/wysiwyg/macros/child_pages_spec.rbindex bcd14a5c675..432952b5818 100644--- a/spec/features/wysiwyg/macros/child_pages_spec.rb+++ b/spec/features/wysiwyg/macros/child_pages_spec.rb@@ -98,14 +98,14 @@ describe 'Wysiwyg child pages spec',# Edit widget and cancel againplaceholder.clickpage.find('.ck-balloon-panel .ck-button', visible: :all, text: 'Edit').click- expect(page).to have_selector('.op-modal--macro-modal')+ expect(page).to have_selector('.op-modal')expect(page).to have_field('selected-page', with: '')find('.op-modal--cancel-button').click# Edit widget and saveplaceholder.clickpage.find('.ck-balloon-panel .ck-button', visible: :all, text: 'Edit').click- expect(page).to have_selector('.op-modal--macro-modal')+ expect(page).to have_selector('.op-modal')fill_in 'selected-page', with: 'parent-page'# Save widget@@ -138,7 +138,7 @@ describe 'Wysiwyg child pages spec',# Edit widget and saveplaceholder.clickpage.find('.ck-balloon-panel .ck-button', visible: :all, text: 'Edit').click- expect(page).to have_selector('.op-modal--macro-modal')+ expect(page).to have_selector('.op-modal')page.check 'include-parent'# Save widgetdiff --git a/spec/features/wysiwyg/macros/code_block_macro_spec.rb b/spec/features/wysiwyg/macros/code_block_macro_spec.rbindex 8754c734c13..652f2e50e01 100644--- a/spec/features/wysiwyg/macros/code_block_macro_spec.rb+++ b/spec/features/wysiwyg/macros/code_block_macro_spec.rb@@ -98,7 +98,7 @@ describe 'Wysiwyg code block macro',editor.in_editor do |container,|editor.click_toolbar_button 'Insert code snippet'- expect(page).to have_selector('.op-modal--macro-modal')+ expect(page).to have_selector('.op-modal')# CM wraps an accessor to the editor instance on the outer containercm = page.find('.CodeMirror')@@ -133,7 +133,7 @@ describe 'Wysiwyg code block macro',editor.in_editor do |container,|editor.click_toolbar_button 'Insert code snippet'- expect(page).to have_selector('.op-modal--macro-modal')+ expect(page).to have_selector('.op-modal')# CM wraps an accessor to the editor instance on the outer containercm = page.find('.CodeMirror')@@ -176,7 +176,7 @@ describe 'Wysiwyg code block macro',widget = container.find('.op-uc-code-block')page.driver.browser.action.double_click(widget.native).perform- expect(page).to have_selector('.op-modal--macro-modal')+ expect(page).to have_selector('.op-modal')expect(page).to have_selector('.op-uc-code-block--language', text: 'ruby')expect(page).to have_selector('.cm-keyword', text: 'def')diff --git a/spec/features/wysiwyg/macros/work_package_button_spec.rb b/spec/features/wysiwyg/macros/work_package_button_spec.rbindex 7ec30c4c422..252c11c2e23 100644--- a/spec/features/wysiwyg/macros/work_package_button_spec.rb+++ b/spec/features/wysiwyg/macros/work_package_button_spec.rb@@ -58,7 +58,7 @@ describe 'Wysiwyg work package button spec',editor.in_editor do |_container, editable|editor.insert_macro 'Insert create work package button'- expect(page).to have_selector('.op-modal--macro-modal')+ expect(page).to have_selector('.op-modal')select 'MyTaskName', from: 'selected-type'# Cancel editingdiff --git a/spec/support/components/common/modal.rb b/spec/support/components/common/modal.rbnew file mode 100644index 00000000000..c51a969ca46--- /dev/null+++ b/spec/support/components/common/modal.rb@@ -0,0 +1,70 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.+#++++module Components+ module Common+ class Modal+ include Capybara::DSL+ include RSpec::Matchers++ def initialize; end++ def expect_title(text)+ within_modal do+ expect(page).to have_selector('.op-modal--title' ,text: text)+ end+ end++ def expect_open+ expect(page).to have_selector(selector, wait: 40)+ end++ def expect_closed+ expect(page).to have_no_selector(selector)+ end++ def click_modal_button(text)+ within_modal do+ click_button text+ end+ end++ def within_modal(&block)+ page.within(selector, &block)+ end++ def modal_element+ page.find(selector)+ end++ def selector+ '.op-modal'+ end+ end+ end+enddiff --git a/spec/support/components/confirmation_dialog.rb b/spec/support/components/confirmation_dialog.rbindex 7de381eab7c..79055d049aa 100644--- a/spec/support/components/confirmation_dialog.rb+++ b/spec/support/components/confirmation_dialog.rb@@ -34,7 +34,7 @@ module Componentsdef initialize; enddef container- '.confirm-dialog--modal'+ '.op-modal'enddef expect_opendiff --git a/spec/support/components/timelines/configuration_modal.rb b/spec/support/components/timelines/configuration_modal.rbindex b95fb1415b4..81ba7f559b4 100644--- a/spec/support/components/timelines/configuration_modal.rb+++ b/spec/support/components/timelines/configuration_modal.rb@@ -57,7 +57,7 @@ module Componentsget_select(:right).find('option', text: right).select_optionget_select(:farRight).find('option', text: farRight).select_option- page.within '.op-modal--portal' do+ page.within '.op-modal' doclick_on 'Apply'endenddiff --git a/spec/support/components/users/invite_user_modal.rb b/spec/support/components/users/invite_user_modal.rbnew file mode 100644index 00000000000..a5bcf97cff0--- /dev/null+++ b/spec/support/components/users/invite_user_modal.rb@@ -0,0 +1,61 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2021 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 docs/COPYRIGHT.rdoc for more details.+#+++require_relative '../common/modal'+require_relative '../ng_select_autocomplete_helpers'++module Components+ module Users+ class InviteUserModal < ::Components::Common::Modal+ include ::Components::NgSelectAutocompleteHelpers++ def autocomplete(query)+ select_autocomplete modal_element.find('.ng-select-container'),+ query: query,+ results_selector: 'body'+ end++ def select_type(type)+ within_modal do+ page.find('.op-option-list--item', text: type).click+ end+ end++ def next+ within_modal do+ click_button 'Next'+ end+ end++ def invitation_message(text)+ within_modal do+ find('textarea').set text+ end+ end+ end+ end+enddiff --git a/spec/support/components/work_packages/settings_menu.rb b/spec/support/components/work_packages/settings_menu.rbindex 8bb7860c047..4d0b080e03f 100644--- a/spec/support/components/work_packages/settings_menu.rb+++ b/spec/support/components/work_packages/settings_menu.rb@@ -35,7 +35,7 @@ module Componentsdef open_and_save_query(name)open!find("#{selector} .menu-item", text: 'Save', match: :prefer_exact).click- page.within('.op-modal--modal-container') do+ page.within('.op-modal') dofind('#save-query-name').set nameclick_on 'Save'enddiff --git a/spec/support/components/work_packages/sort_by.rb b/spec/support/components/work_packages/sort_by.rbindex f14805b031e..7060a85f572 100644--- a/spec/support/components/work_packages/sort_by.rb+++ b/spec/support/components/work_packages/sort_by.rb@@ -97,13 +97,13 @@ module Componentsenddef cancel_changes- page.within('.op-modal--modal-container') do+ page.within('.op-modal') doclick_on 'Cancel'endenddef apply_changes- page.within('.op-modal--modal-container') do+ page.within('.op-modal') doclick_on 'Apply'endenddiff --git a/spec/support/components/work_packages/table_configuration_modal.rb b/spec/support/components/work_packages/table_configuration_modal.rbindex b06aced522a..c5c8688e634 100644--- a/spec/support/components/work_packages/table_configuration_modal.rb+++ b/spec/support/components/work_packages/table_configuration_modal.rb@@ -109,7 +109,7 @@ module Componentsenddef selector- '.wp-table--configuration-modal'+ '.op-modal'endprivate