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
[32880] Display scheduling mode in work package view (full, split & table) (#8410)
Henriette Dargeb3dd61946e3a
diff --git a/app/assets/stylesheets/content/_attributes_group.lsg b/app/assets/stylesheets/content/_attributes_group.lsgindex 4216c911d03..c4dc67749e0 100644--- a/app/assets/stylesheets/content/_attributes_group.lsg+++ b/app/assets/stylesheets/content/_attributes_group.lsg@@ -111,11 +111,7 @@<div class="attributes-key-value--key">Date</div><div class="attributes-key-value--value-container"><div class="inline-edit--container">- <span class="inline-edit--display-field inline-edit--display-field inplace-edit -editable" title="12/06/2018">12/06/2018</span>- </div>- <span class="attributes-key-value--value-separator"></span>- <div class="inline-edit--container">- <span class="inline-edit--display-field inline-edit--display-field inplace-edit -placeholder -editable">no end date</span>+ <span class="inline-edit--display-field inline-edit--display-field inplace-edit -editable" title="12/06/2018 - no end date">12/06/2018 - no end date</span></div></div><div class="attributes-key-value--key">Priority</div>diff --git a/app/assets/stylesheets/content/_attributes_key_value.sass b/app/assets/stylesheets/content/_attributes_key_value.sassindex a09581b3d6e..df5e130473c 100644--- a/app/assets/stylesheets/content/_attributes_key_value.sass+++ b/app/assets/stylesheets/content/_attributes_key_value.sass@@ -58,15 +58,6 @@&.not-editablepadding: 6px-.attributes-key-value--value-separator- margin: 0px 4px- line-height: normal-- &:after- display: inline- content: '-'- vertical-align: middle-.attributes-key-value--value@include grid-visible-overflowdiff --git a/app/assets/stylesheets/content/_datepicker.lsg b/app/assets/stylesheets/content/_datepicker.lsgindex 32f349719e9..d3b05f536a9 100644--- a/app/assets/stylesheets/content/_datepicker.lsg+++ b/app/assets/stylesheets/content/_datepicker.lsg@@ -1,18 +1,6 @@## Datepicker```-<input type="text" id="datepicker-input">--<div id="datepicker-inline"></div>--```--```-@javascript--jQuery(function($) {- $("#datepicker-inline").datepicker();- $("#datepicker-input").datepicker();-});+<input type="text" id="datepicker-input" class='-augmented-datepicker'>```diff --git a/app/assets/stylesheets/content/_datepicker.sass b/app/assets/stylesheets/content/_datepicker.sassindex a08d8704e28..368c04062c5 100644--- a/app/assets/stylesheets/content/_datepicker.sass+++ b/app/assets/stylesheets/content/_datepicker.sass@@ -26,178 +26,6 @@// See docs/COPYRIGHT.rdoc for more details.//++-//$dp- var prefix for date picker--$dp-theme-color: #CCCCCC-$dp-theme-lines-color1: #FFFFFF-$dp-theme-lines-color2: #F8F8F8-$dp-theme-border-color: #DDDDDD--$dp-header-elements-height: 30px-$dp-header-top: 5px-$dp-header-padding: .2em 0--$dp-hover-normalisation: 2px-$dp-round-corners-radius: 0-$dp-cell-corner-radius: 3px-$dp-day-margin: 2px-$dp-day-margin-hover: 1px-$dp-days-text-color: #535353--$dp-week-padding-top: 7px-$dp-week-padding-bottom: 7px-$dp-week-text-color: #CCCCCC--$dp-border: 1px solid $dp-theme-border-color--$dp-font-size-rewrite: .9em--$dp-number-of-columns: 8-$dp-table-width: 100%--$dp-month-year-width: 40%-$dp-month-year-margin: 0 4.5%--$dp-shadow-box: 1px 1px 5px 0-$dp-shadow-box-opacity: 1--@mixin set-table-cells-width($table-width, $columns-number)- width: $table-width/$columns-number- table-layout: fixed--.ui-datepicker,-.work-package-table--container .ui-datepicker- border: $dp-border- padding: 0- background-color: $dp-theme-lines-color2- box-shadow: $dp-shadow-box rgba($dp-theme-color, $dp-shadow-box-opacity)- &.ui-datepicker-inline- box-shadow: none- &.ui-corner-all- border-radius: $dp-round-corners-radius-- //[class^="ui-corner"] this selector is not working...- //a list is used- $corner-types: tl tr lf br top bottom right left all- @each $corner-type in $corner-types- .ui-corner-#{$corner-type}- border-radius: $dp-round-corners-radius-- .ui-datepicker-header- padding: $dp-header-padding- border: none- background-color: $dp-theme-lines-color1-- .ui-icon.ui-icon-circle-triangle-w- background-position: -96px -16px- user-select: none-- .ui-icon.ui-icon-circle-triangle-e- background-position: -32px -16px- user-select: none-- .ui-state-hover- border-width: 0 !important- background-color: transparent- cursor: pointer !important-- .ui-datepicker-prev-hover- left: $dp-hover-normalisation-- .ui-datepicker-next-hover- right: $dp-hover-normalisation-- .ui-datepicker-prev,- .ui-datepicker-next- top: $dp-header-top-- .ui-datepicker-title- .ui-datepicker-month,- .ui-datepicker-year- width: $dp-month-year-width- select- @extend .form--select- height: $dp-header-elements-height- font-size: $dp-font-size-rewrite- font-weight: normal- padding-top: 0- padding-bottom: 0- margin: $dp-month-year-margin- border: $dp-border-- .ui-datepicker-calendar- margin-bottom: 0- border-spacing: 0- border-collapse: collapse- background-color: $dp-theme-lines-color1-- th- background-color: $dp-theme-lines-color2- font-weight: normal- border-top: $dp-border- border-bottom: $dp-border- padding-top: $dp-week-padding-top- padding-bottom: $dp-week-padding-bottom- @include set-table-cells-width($dp-table-width, $dp-number-of-columns)- text-align: center- font-size: 0.9em-- // Cancel out effect of min-width css in generic-table in cases where the- // date picker is included inside a table.- table.generic-table &- min-width: 0px-- td- padding: 0- color: $dp-days-text-color- @include set-table-cells-width($dp-table-width, $dp-number-of-columns)-- a- border: none- text-align: center- background-color: #FFFFFF- margin: $dp-day-margin- &.ui-state-highlight,- &.ui-state-active,- &:hover- margin: $dp-day-margin-hover- border: $dp-border- border-radius: $dp-cell-corner-radius-- &.ui-state-active- border-color: $inplace-edit--selected-date-border-color-- // Cancel out effect of min-width css in generic-table in cases where the- // date picker is included inside a table.- table.generic-table &- min-width: 0px-- tbody tr- border-bottom: none- &:hover- background-color: $dp-theme-lines-color1-- .ui-datepicker-week-col- color: $dp-week-text-color- text-align: center-- .ui-datepicker-buttonpane- border-top: $dp-border- margin-top: 0-- button- font-weight: normal- font-size: $dp-font-size-rewrite- border: none- background-color: transparent-- .ui-priority-secondary- opacity: 1- filter: Alpha(Opacity = 100)- font-weight: bold--// ui-datepicker arbitrarily sets the css z-index using JS-// So we have to override that value.-#ui-datepicker-div- z-index: 10001 !important- position: absolute+.flatpickr-calendar+ .flatpickr-monthDropdown-months+ display: inline-block\ No newline at end of filediff --git a/app/assets/stylesheets/content/_forms.sass b/app/assets/stylesheets/content/_forms.sassindex 8b4125bc0c7..33affbcb6cb 100644--- a/app/assets/stylesheets/content/_forms.sass+++ b/app/assets/stylesheets/content/_forms.sass@@ -185,11 +185,6 @@ hr@include grid-block@include grid-visible-overflow-// TODO: Customise with proper jQuery UI theme.-.ui-datepicker-month,-.ui-datepicker-year- display: inline-block-.checkbox-labelposition: relativedisplay: inline-blockdiff --git a/app/assets/stylesheets/content/_modal.sass b/app/assets/stylesheets/content/_modal.sassindex 510c85b59e4..caffb0691e4 100644--- a/app/assets/stylesheets/content/_modal.sass+++ b/app/assets/stylesheets/content/_modal.sass@@ -52,6 +52,9 @@ $modal-footer-height: $modal-header-heightalign-items: centerjustify-content: center+ &.-transparent+ background: transparent+// The inner modal element containing header, body, and footer// This is placed within --portal.op-modal--modal-containerdiff --git a/app/assets/stylesheets/content/work_packages/_table_content.sass b/app/assets/stylesheets/content/work_packages/_table_content.sassindex b73670874e2..3e9e1976c3e 100644--- a/app/assets/stylesheets/content/work_packages/_table_content.sass+++ b/app/assets/stylesheets/content/work_packages/_table_content.sass@@ -120,9 +120,6 @@ html:not(.-browser-mobile).wp-table-context-menu-linkpadding-left: 5px-.wp-table--cell .ui-datepicker- margin-left: -38%-.wp-table--cell-container@extend .ellipsisdisplay: inline-blockdiff --git a/config/locales/en.yml b/config/locales/en.ymlindex 13f85a5a8ff..0cb136b467d 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -925,6 +925,7 @@ en:date:abbr_day_names: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]abbr_month_names: [~, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]+ abbr_week: 'Wk'day_names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]formats:# Use the strftime parameters for formats.diff --git a/config/locales/js-en.yml b/config/locales/js-en.ymlindex 0acb6c48e25..3b964c8b388 100644--- a/config/locales/js-en.yml+++ b/config/locales/js-en.yml@@ -645,6 +645,10 @@ en:project_menu_details: "Details"+ scheduling:+ manual: 'Manual scheduling'+ automatic: 'Automatic scheduling'+sort:sorted_asc: 'Ascending sort applied, 'sorted_dsc: 'Descending sort applied, '@@ -937,6 +941,7 @@ en:label_delete_page: "Delete current page"button_apply: "Apply"button_save: "Save"+ button_clear_all: "Clear all"button_submit: "Submit"button_cancel: "Cancel"form_submit:diff --git a/frontend/angular.json b/frontend/angular.jsonindex e396fe8f672..6895d0b8433 100644--- a/frontend/angular.json+++ b/frontend/angular.json@@ -28,7 +28,8 @@"node_modules/jquery-ui/themes/base/dialog.css","node_modules/@fullcalendar/core/main.css","node_modules/@fullcalendar/daygrid/main.css",- "node_modules/@fullcalendar/timegrid/main.css"+ "node_modules/@fullcalendar/timegrid/main.css",+ "node_modules/flatpickr/dist/flatpickr.min.css"],"stylePreprocessorOptions": {"includePaths": [diff --git a/frontend/npm-shrinkwrap.json b/frontend/npm-shrinkwrap.jsonindex 7e3879936fe..a46eb9b48f1 100644--- a/frontend/npm-shrinkwrap.json+++ b/frontend/npm-shrinkwrap.json@@ -139,9 +139,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.8.6",@@ -154,9 +154,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -206,9 +206,9 @@"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="},"caniuse-lite": {- "version": "1.0.30001066",- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001066.tgz",- "integrity": "sha512-Gfj/WAastBtfxLws0RCh2sDbTK/8rJuSeZMecrSkNGYxPcv7EzblmDGfWQCFEQcSqYE2BRgQiJh8HOD07N5hIw=="+ "version": "1.0.30001077",+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001077.tgz",+ "integrity": "sha512-AEzsGvjBJL0lby/87W96PyEvwN0GsYvk5LHsglLg9tW37K4BqvAvoSCdWIE13OZQ8afupqZ73+oL/1LkedN8hA=="},"core-js": {"version": "3.6.4",@@ -886,19 +886,19 @@}},"caniuse-lite": {- "version": "1.0.30001066",- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001066.tgz",- "integrity": "sha512-Gfj/WAastBtfxLws0RCh2sDbTK/8rJuSeZMecrSkNGYxPcv7EzblmDGfWQCFEQcSqYE2BRgQiJh8HOD07N5hIw=="+ "version": "1.0.30001077",+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001077.tgz",+ "integrity": "sha512-AEzsGvjBJL0lby/87W96PyEvwN0GsYvk5LHsglLg9tW37K4BqvAvoSCdWIE13OZQ8afupqZ73+oL/1LkedN8hA=="},"electron-to-chromium": {- "version": "1.3.453",- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.453.tgz",- "integrity": "sha512-IQbCfjJR0NDDn/+vojTlq7fPSREcALtF8M1n01gw7nQghCtfFYrJ2dfhsp8APr8bANoFC8vRTFVXMOGpT0eetw=="+ "version": "1.3.458",+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.458.tgz",+ "integrity": "sha512-OjRkb0igW0oKE2QbzS7vBYrm7xjW/KRTtIj0OGGx57jr/YhBiKb7oZvdbaojqjfCb/7LbnwsbMbdsYjthdJbAw=="},"node-releases": {- "version": "1.1.57",- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.57.tgz",- "integrity": "sha512-ZQmnWS7adi61A9JsllJ2gdj2PauElcjnOwTp2O011iGzoakTxUsDGSe+6vD7wXbKdqhSFymC0OSx35aAMhrSdw=="+ "version": "1.1.58",+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.58.tgz",+ "integrity": "sha512-NxBudgVKiRh/2aPWMgPR7bPTX0VPmGx5QBwCtdHitnqFE5/O8DeBXuIMH1nwNnw/aMo6AjOrpsHzfY3UbUJ7yg=="}}},@@ -934,11 +934,11 @@}},"@babel/generator": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.1.tgz",- "integrity": "sha512-AT0YPLQw9DI21tliuJIdplVfLHya6mcGa8ctkv7n4Qv+hYacJrKmNWIteAK1P9iyLikFIAkwqJ7HAOqIDLFfgA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz",+ "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==","requires": {- "@babel/types": "^7.10.1",+ "@babel/types": "^7.10.2","jsesc": "^2.5.1","lodash": "^4.17.13","source-map": "^0.5.0"@@ -981,9 +981,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.10.1",@@ -1012,9 +1012,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1098,9 +1098,9 @@},"dependencies": {"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1119,9 +1119,9 @@},"dependencies": {"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1131,9 +1131,9 @@}},"@babel/helper-compilation-targets": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.10.1.tgz",- "integrity": "sha512-YuF8IrgSmX/+MV2plPkjEnzlC2wf+gaok8ehMNN0jodF3/sejZauExqpEVGbJua62oaWoNYIXwz4RmAsVcGyHw==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.10.2.tgz",+ "integrity": "sha512-hYgOhF4To2UTB4LTaZepN/4Pl9LD4gfbJx8A34mqoluT8TLbof1mhUlYuNWTEebONa8+UlCC4X0TEXu7AOUyGA==","requires": {"@babel/compat-data": "^7.10.1","browserslist": "^4.12.0",@@ -1154,19 +1154,19 @@}},"caniuse-lite": {- "version": "1.0.30001066",- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001066.tgz",- "integrity": "sha512-Gfj/WAastBtfxLws0RCh2sDbTK/8rJuSeZMecrSkNGYxPcv7EzblmDGfWQCFEQcSqYE2BRgQiJh8HOD07N5hIw=="+ "version": "1.0.30001077",+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001077.tgz",+ "integrity": "sha512-AEzsGvjBJL0lby/87W96PyEvwN0GsYvk5LHsglLg9tW37K4BqvAvoSCdWIE13OZQ8afupqZ73+oL/1LkedN8hA=="},"electron-to-chromium": {- "version": "1.3.453",- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.453.tgz",- "integrity": "sha512-IQbCfjJR0NDDn/+vojTlq7fPSREcALtF8M1n01gw7nQghCtfFYrJ2dfhsp8APr8bANoFC8vRTFVXMOGpT0eetw=="+ "version": "1.3.458",+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.458.tgz",+ "integrity": "sha512-OjRkb0igW0oKE2QbzS7vBYrm7xjW/KRTtIj0OGGx57jr/YhBiKb7oZvdbaojqjfCb/7LbnwsbMbdsYjthdJbAw=="},"node-releases": {- "version": "1.1.57",- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.57.tgz",- "integrity": "sha512-ZQmnWS7adi61A9JsllJ2gdj2PauElcjnOwTp2O011iGzoakTxUsDGSe+6vD7wXbKdqhSFymC0OSx35aAMhrSdw=="+ "version": "1.1.58",+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.58.tgz",+ "integrity": "sha512-NxBudgVKiRh/2aPWMgPR7bPTX0VPmGx5QBwCtdHitnqFE5/O8DeBXuIMH1nwNnw/aMo6AjOrpsHzfY3UbUJ7yg=="}}},@@ -1268,9 +1268,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.10.1",@@ -1283,9 +1283,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1312,11 +1312,11 @@}},"@babel/generator": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.1.tgz",- "integrity": "sha512-AT0YPLQw9DI21tliuJIdplVfLHya6mcGa8ctkv7n4Qv+hYacJrKmNWIteAK1P9iyLikFIAkwqJ7HAOqIDLFfgA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz",+ "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==","requires": {- "@babel/types": "^7.10.1",+ "@babel/types": "^7.10.2","jsesc": "^2.5.1","lodash": "^4.17.13","source-map": "^0.5.0"@@ -1359,9 +1359,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.10.1",@@ -1390,9 +1390,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1448,9 +1448,9 @@},"dependencies": {"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1468,9 +1468,9 @@},"dependencies": {"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1488,9 +1488,9 @@},"dependencies": {"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1540,9 +1540,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.10.1",@@ -1555,9 +1555,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1575,9 +1575,9 @@},"dependencies": {"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1620,11 +1620,11 @@}},"@babel/generator": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.1.tgz",- "integrity": "sha512-AT0YPLQw9DI21tliuJIdplVfLHya6mcGa8ctkv7n4Qv+hYacJrKmNWIteAK1P9iyLikFIAkwqJ7HAOqIDLFfgA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz",+ "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==","requires": {- "@babel/types": "^7.10.1",+ "@babel/types": "^7.10.2","jsesc": "^2.5.1","lodash": "^4.17.13","source-map": "^0.5.0"@@ -1667,9 +1667,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.10.1",@@ -1698,9 +1698,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1747,11 +1747,11 @@}},"@babel/generator": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.1.tgz",- "integrity": "sha512-AT0YPLQw9DI21tliuJIdplVfLHya6mcGa8ctkv7n4Qv+hYacJrKmNWIteAK1P9iyLikFIAkwqJ7HAOqIDLFfgA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz",+ "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==","requires": {- "@babel/types": "^7.10.1",+ "@babel/types": "^7.10.2","jsesc": "^2.5.1","lodash": "^4.17.13","source-map": "^0.5.0"@@ -1794,9 +1794,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.10.1",@@ -1825,9 +1825,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1882,9 +1882,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.10.1",@@ -1897,9 +1897,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -1942,11 +1942,11 @@}},"@babel/generator": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.1.tgz",- "integrity": "sha512-AT0YPLQw9DI21tliuJIdplVfLHya6mcGa8ctkv7n4Qv+hYacJrKmNWIteAK1P9iyLikFIAkwqJ7HAOqIDLFfgA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz",+ "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==","requires": {- "@babel/types": "^7.10.1",+ "@babel/types": "^7.10.2","jsesc": "^2.5.1","lodash": "^4.17.13","source-map": "^0.5.0"@@ -1989,9 +1989,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.10.1",@@ -2020,9 +2020,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -2068,11 +2068,11 @@}},"@babel/generator": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.1.tgz",- "integrity": "sha512-AT0YPLQw9DI21tliuJIdplVfLHya6mcGa8ctkv7n4Qv+hYacJrKmNWIteAK1P9iyLikFIAkwqJ7HAOqIDLFfgA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz",+ "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==","requires": {- "@babel/types": "^7.10.1",+ "@babel/types": "^7.10.2","jsesc": "^2.5.1","lodash": "^4.17.13","source-map": "^0.5.0"@@ -2115,9 +2115,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.10.1",@@ -2146,9 +2146,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -2450,9 +2450,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.10.1",@@ -2465,9 +2465,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -2572,9 +2572,9 @@}},"@babel/parser": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.1.tgz",- "integrity": "sha512-AUTksaz3FqugBkbTZ1i+lDLG5qy8hIzCaAxEtttU6C0BtZZU9pkNZtWSVAht4EW9kl46YBiyTGMp9xTTGqViNg=="+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz",+ "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ=="},"@babel/template": {"version": "7.10.1",@@ -2587,9 +2587,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -2698,9 +2698,9 @@}},"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -2852,9 +2852,9 @@},"dependencies": {"@babel/types": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.1.tgz",- "integrity": "sha512-L2yqUOpf3tzlW9GVuipgLEcZxnO+96SzR6fjXMuxxNkIgFJ5+07mHCZ+HkHqaeZu8+3LKnNJJ1bKbjBETQAsrA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz",+ "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==","requires": {"@babel/helper-validator-identifier": "^7.10.1","lodash": "^4.17.13",@@ -2876,9 +2876,9 @@}},"@babel/runtime": {- "version": "7.10.1",- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.1.tgz",- "integrity": "sha512-nQbbCbQc9u/rpg1XCxoMYQTbSMVZjCDxErQ1ClCn9Pvcmv1lGads19ep0a2VsEiIJeHqjZley6EQGEC3Yo1xMA==",+ "version": "7.10.2",+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.2.tgz",+ "integrity": "sha512-6sF3uQw2ivImfVIl62RZ7MXhO2tap69WeWK57vAaimT6AZbE4FbqjdEJIN1UqoD6wI6B+1n9UiagafH1sxjOtg==","requires": {"regenerator-runtime": "^0.13.4"}@@ -3461,9 +3461,9 @@"integrity": "sha512-eWN5ElDTeBc5lRDh95SqA8x18D0ll2pWudU3uWiyfsRmIZcmUXpEsxPU+7+BsdCrO2vfLRC629u/MmjbmF+2tA=="},"@types/webpack-sources": {- "version": "0.1.7",- "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.7.tgz",- "integrity": "sha512-XyaHrJILjK1VHVC4aVlKsdNN5KBTwufMb43cQs+flGxtPAf/1Qwl8+Q0tp5BwEGaI8D6XT1L+9bSWXckgkjTLw==",+ "version": "0.1.8",+ "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-0.1.8.tgz",+ "integrity": "sha512-JHB2/xZlXOjzjBB6fMOpH1eQAfsrpqVVIbneE0Rok16WXwFaznaI5vfg75U5WgGJm7V9W1c4xeRQDjX/zwvghA==","requires": {"@types/node": "*","@types/source-list-map": "*",@@ -5606,9 +5606,9 @@"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="},"postcss": {- "version": "7.0.31",- "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.31.tgz",- "integrity": "sha512-a937VDHE1ftkjk+8/7nj/mrjtmkn69xxzJgRETXdAUU+IgOYPQNJF17haGWbeDxSyk++HA14UA98FurvPyBJOA==",+ "version": "7.0.32",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz",+ "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==","requires": {"chalk": "^2.4.2","source-map": "^0.6.1",@@ -5702,9 +5702,9 @@}},"css-what": {- "version": "3.2.1",- "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.2.1.tgz",- "integrity": "sha512-WwOrosiQTvyms+Ti5ZC5vGEK0Vod3FTt1ca+payZqvKuGJF+dq7bG63DstxtN0dpm6FxY27a/zS3Wten+gEtGw=="+ "version": "3.3.0",+ "resolved": "https://registry.npmjs.org/css-what/-/css-what-3.3.0.tgz",+ "integrity": "sha512-pv9JPyatiPaQ6pf4OvD/dbfm0o5LviWmwxNWzblYf/1u9QZd0ihV+PMwy5jdQWQ3349kZmKEx9WXuSka2dM4cg=="},"cssauron": {"version": "1.4.0",@@ -7092,6 +7092,11 @@"locate-path": "^3.0.0"}},+ "flatpickr": {+ "version": "4.6.3",+ "resolved": "https://registry.npmjs.org/flatpickr/-/flatpickr-4.6.3.tgz",+ "integrity": "sha512-007VucCkqNOMMb9ggRLNuJowwaJcyOh4sKAFcdGfahfGc7JQbf94zSzjdBq/wVyHWUEs5o3+idhFZ0wbZMRmVQ=="+ },"flatted": {"version": "2.0.1","resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz",@@ -7805,9 +7810,9 @@}},"postcss": {- "version": "7.0.31",- "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.31.tgz",- "integrity": "sha512-a937VDHE1ftkjk+8/7nj/mrjtmkn69xxzJgRETXdAUU+IgOYPQNJF17haGWbeDxSyk++HA14UA98FurvPyBJOA==",+ "version": "7.0.32",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz",+ "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==","requires": {"chalk": "^2.4.2","source-map": "^0.6.1",@@ -11022,9 +11027,9 @@}},"postcss": {- "version": "7.0.31",- "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.31.tgz",- "integrity": "sha512-a937VDHE1ftkjk+8/7nj/mrjtmkn69xxzJgRETXdAUU+IgOYPQNJF17haGWbeDxSyk++HA14UA98FurvPyBJOA==",+ "version": "7.0.32",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz",+ "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==","requires": {"chalk": "^2.4.2","source-map": "^0.6.1",@@ -11311,9 +11316,9 @@}},"postcss": {- "version": "7.0.31",- "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.31.tgz",- "integrity": "sha512-a937VDHE1ftkjk+8/7nj/mrjtmkn69xxzJgRETXdAUU+IgOYPQNJF17haGWbeDxSyk++HA14UA98FurvPyBJOA==",+ "version": "7.0.32",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz",+ "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==","requires": {"chalk": "^2.4.2","source-map": "^0.6.1",@@ -11365,9 +11370,9 @@}},"postcss": {- "version": "7.0.31",- "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.31.tgz",- "integrity": "sha512-a937VDHE1ftkjk+8/7nj/mrjtmkn69xxzJgRETXdAUU+IgOYPQNJF17haGWbeDxSyk++HA14UA98FurvPyBJOA==",+ "version": "7.0.32",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz",+ "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==","requires": {"chalk": "^2.4.2","source-map": "^0.6.1",@@ -11419,9 +11424,9 @@}},"postcss": {- "version": "7.0.31",- "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.31.tgz",- "integrity": "sha512-a937VDHE1ftkjk+8/7nj/mrjtmkn69xxzJgRETXdAUU+IgOYPQNJF17haGWbeDxSyk++HA14UA98FurvPyBJOA==",+ "version": "7.0.32",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz",+ "integrity": "sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==","requires": {"chalk": "^2.4.2","source-map": "^0.6.1",@@ -14967,9 +14972,12 @@}},"serialize-javascript": {- "version": "2.1.2",- "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz",- "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ=="+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz",+ "integrity": "sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==",+ "requires": {+ "randombytes": "^2.1.0"+ }},"source-map": {"version": "0.6.1",@@ -14977,15 +14985,15 @@"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="},"terser-webpack-plugin": {- "version": "1.4.3",- "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz",- "integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==",+ "version": "1.4.4",+ "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.4.tgz",+ "integrity": "sha512-U4mACBHIegmfoEe5fdongHESNJWqsGU+W0S/9+BmYGVQDw1+c2Ow05TpMhxjPK1sRb7cuYq1BPl1e5YHJMTCqA==","requires": {"cacache": "^12.0.2","find-cache-dir": "^2.1.0","is-wsl": "^1.1.0","schema-utils": "^1.0.0",- "serialize-javascript": "^2.1.2",+ "serialize-javascript": "^3.1.0","source-map": "^0.6.1","terser": "^4.1.2","webpack-sources": "^1.4.0",@@ -15295,9 +15303,9 @@}},"websocket-extensions": {- "version": "0.1.3",- "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz",- "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg=="+ "version": "0.1.4",+ "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz",+ "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg=="},"when": {"version": "3.6.4",diff --git a/frontend/package.json b/frontend/package.jsonindex 1c8389384bb..ce985792bb7 100644--- a/frontend/package.json+++ b/frontend/package.json@@ -95,6 +95,7 @@"es6-promise": "^4.2.8","es6-shim": "0.35.5","expose-loader": "^0.7.5",+ "flatpickr": "^4.6.3","fuse.js": "^3.4.5","glob": "^7.1.4","hammerjs": "^2.0.8",diff --git a/frontend/src/app/components/datepicker/datepicker.helper.ts b/frontend/src/app/components/datepicker/datepicker.helper.tsnew file mode 100644index 00000000000..d079a5f882c--- /dev/null+++ b/frontend/src/app/components/datepicker/datepicker.helper.ts@@ -0,0 +1,121 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2020 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-2017 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 {Injectable} from '@angular/core';+import {DateKeys} from "core-components/datepicker/datepicker.modal";+import {DatePicker} from "core-app/modules/common/op-date-picker/datepicker";++@Injectable({ providedIn: 'root' })+export class DatepickerHelper {+ public currentlyActivatedDateField:DateKeys;++ /**+ * Map the date to the internal format,+ * setting to null if it's empty.+ * @param key+ */+ public mappedDate(date:string):string|null {+ return date === '' ? null : date;+ }++ public parseDate(date:Date|string):Date|'' {+ if (date instanceof Date) {+ return date;+ } else if (date === '') {+ return '';+ } else {+ return new Date(date);+ }+ }++ public validDate(date:Date|string) {+ return (date instanceof Date) ||+ (date === '') ||+ !!new Date(date).valueOf();+ }++ public setCurrentActivatedField(val:DateKeys) {+ this.currentlyActivatedDateField = val;+ }++ public toggleCurrentActivatedField(dates:{ [key in DateKeys]:string }, datePicker:DatePicker) {+ this.currentlyActivatedDateField = this.currentlyActivatedDateField === 'start' ? 'end' : 'start';+ this.setDatepickerRestrictions(dates, datePicker);+ }++ public isStateOfCurrentActivatedField(val:DateKeys):boolean {+ return this.currentlyActivatedDateField === val;+ }++ public setDatepickerRestrictions(dates:{ [key in DateKeys]:string }, datePicker:DatePicker) {+ if (this.isStateOfCurrentActivatedField('start')) {+ datePicker.datepickerInstance.set('minDate', null);+ datePicker.datepickerInstance.set('maxDate', dates.end);+ } else {+ datePicker.datepickerInstance.set('minDate', dates.start);+ datePicker.datepickerInstance.set('maxDate', null);+ }+ }++ public setRangeClasses(dates:{ [key in DateKeys]:string }, datePickerInstance:DatePicker) {+ if (!dates.start || !dates.end) {+ return;+ }++ var selectedElements = document.getElementsByClassName('flatpickr-day selected');+ if (selectedElements.length === 2) {+ selectedElements[0].classList.add('startRange');+ selectedElements[1].classList.add('endRange');++ this.selectRangeFromUntil(selectedElements[0], selectedElements[1]);+ } else if (selectedElements.length === 1) {+ // Date range needs to be shown over multiple months+ if (this.datepickerShowsDate(dates.start, datePickerInstance)) {+ selectedElements[0].classList.add('startRange');+ this.selectRangeFromUntil(selectedElements[0], '');+ } else if (this.datepickerShowsDate(dates.end, datePickerInstance)) {+ selectedElements[0].classList.add('endRange');++ let firstDay = jQuery('.flatpickr-days .flatpickr-day')[0];+ firstDay.classList.add('inRange');+ this.selectRangeFromUntil(firstDay, selectedElements[0]);+ }+ } else {+ jQuery('.dayContainer .flatpickr-day').addClass('inRange');+ }+ }++ private datepickerShowsDate(date:string, datePickerInstance:DatePicker):boolean {+ return datePickerInstance.datepickerInstance.currentMonth === new Date(date).getMonth() &&+ datePickerInstance.datepickerInstance.currentYear === new Date(date).getFullYear();+ }++ private selectRangeFromUntil(from:Element, until:string|Element) {+ jQuery(from).nextUntil(until).addClass('inRange');+ }+}diff --git a/frontend/src/app/components/datepicker/datepicker.modal.html b/frontend/src/app/components/datepicker/datepicker.modal.htmlnew file mode 100644index 00000000000..2070b9bd568--- /dev/null+++ b/frontend/src/app/components/datepicker/datepicker.modal.html@@ -0,0 +1,97 @@+<div class="op-modal--portal -transparent">+ <div 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="grid-block">+ <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>+ </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)"+ (click)="datepickerHelper.setCurrentActivatedField('start')">+ </div>+ </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)"+ (click)="datepickerHelper.setCurrentActivatedField('end')">+ </div>+ </div>+ </div>+ </ng-container>++ <a (click)="clear()"+ class="datepicker-modal--action"+ [textContent]="text.clear">+ </a>+ </div>+ <div class="form--field">+ <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>+ </form>++ <input id="flatpickr-input"+ hidden>++ <div class="datepicker-modal--actions-container">+ <a (click)="cancel()"+ class="datepicker-modal--action"+ [textContent]="text.cancel">+ </a>+ <a (click)="save()"+ class="datepicker-modal--action"+ [textContent]="text.save">+ </a>+ </div>+ </div>+ </div>+</div>diff --git a/frontend/src/app/components/datepicker/datepicker.modal.sass b/frontend/src/app/components/datepicker/datepicker.modal.sassnew file mode 100644index 00000000000..2e619d28e70--- /dev/null+++ b/frontend/src/app/components/datepicker/datepicker.modal.sass@@ -0,0 +1,26 @@+.datepicker-modal+ position: relative+ z-index: 500+ width: fit-content+ padding: 5px 0+ box-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.25)++ .op-modal--modal-body+ overflow: hidden++ .grid-block+ align-items: center++.datepicker-modal--actions-container+ display: grid+ grid-template-columns: auto auto+ grid-column-gap: 30px+ margin-top: 20px+ justify-content: end++.form--date-field+ margin: 2px !important++ &.-current,+ &.-current:hover+ outline: 2px solid var(--primary-color)diff --git a/frontend/src/app/components/datepicker/datepicker.modal.ts b/frontend/src/app/components/datepicker/datepicker.modal.tsnew file mode 100644index 00000000000..0b3ffd83f56--- /dev/null+++ b/frontend/src/app/components/datepicker/datepicker.modal.ts@@ -0,0 +1,266 @@+// -- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2020 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 {+ AfterViewInit,+ ChangeDetectionStrategy,+ ChangeDetectorRef,+ Component,+ ElementRef,+ EventEmitter,+ Inject,+ Injector,+ 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 {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";+import {ResourceChangeset} from "core-app/modules/fields/changeset/resource-changeset";+import {DatepickerHelper} from "core-components/datepicker/datepicker.helper";++export type DateKeys = 'date'|'start'|'end';++@Component({+ templateUrl: './datepicker.modal.html',+ styleUrls: ['./datepicker.modal.sass'],+ changeDetection: ChangeDetectionStrategy.OnPush,+ encapsulation: ViewEncapsulation.None+})+export class DatePickerModal extends OpModalComponent implements AfterViewInit {+ @InjectField() I18n:I18nService;+ @InjectField() timezoneService:TimezoneService;+ @InjectField() halEditing:HalResourceEditingService;+ @InjectField() datepickerHelper:DatepickerHelper;++ text = {+ save: this.I18n.t('js.button_save'),+ cancel: this.I18n.t('js.button_cancel'),+ clear: this.I18n.t('js.modals.button_clear_all'),+ manualScheduling: this.I18n.t('js.scheduling.manual'),+ date: this.I18n.t('js.work_packages.properties.date'),+ startDate: this.I18n.t('js.work_packages.properties.startDate'),+ endDate: this.I18n.t('js.work_packages.properties.dueDate'),+ placeholder: this.I18n.t('js.placeholders.default')+ };+ public onDataUpdated = new EventEmitter<string>();++ public singleDate = false;++ public scheduleManually = false;++ public htmlId:string = '';++ public dates:{ [key in DateKeys]:string } = {+ date: '',+ start: '',+ end: ''+ };++ private changeset:ResourceChangeset;++ private datePickerInstance:DatePicker;++ constructor(readonly injector:Injector,+ @Inject(OpModalLocalsToken) public locals:OpModalLocalsMap,+ readonly cdRef:ChangeDetectorRef,+ readonly elementRef:ElementRef) {+ super(locals, cdRef, elementRef);+ this.changeset = locals.changeset;+ this.htmlId = `wp-datepicker-${locals.fieldName}`;++ this.singleDate = this.changeset.isWritable('date');+ this.scheduleManually = this.changeset.value('scheduleManually');++ if (this.singleDate) {+ this.dates.date = this.changeset.value('date');+ this.datepickerHelper.setCurrentActivatedField('date');+ } else {+ this.dates.start = this.changeset.value('startDate');+ this.dates.end = this.changeset.value('dueDate');+ this.datepickerHelper.setCurrentActivatedField(this.locals.fieldName === 'dueDate' ? 'end' : 'start');+ }+ }++ ngAfterViewInit():void {+ this.initializeDatepicker();+ this.datepickerHelper.setDatepickerRestrictions(this.dates, this.datePickerInstance);+ this.datepickerHelper.setRangeClasses(this.dates, this.datePickerInstance);++ this.onDataChange();+ }++ changeSchedulingMode() {+ this.scheduleManually = !this.scheduleManually;+ this.cdRef.detectChanges();+ }++ save():void {+ if (this.singleDate) {+ this.changeset.setValue('date', this.datepickerHelper.mappedDate(this.dates.date));+ } else {+ this.changeset.setValue('startDate', this.datepickerHelper.mappedDate(this.dates.start));+ this.changeset.setValue('dueDate', this.datepickerHelper.mappedDate(this.dates.end));+ }++ this.changeset.setValue('scheduleManually', this.scheduleManually);+ this.closeMe();+ }++ cancel():void {+ this.closeMe();+ }++ clear():void {+ this.dates = {+ date: '',+ start: '',+ end: ''+ };++ this.datePickerInstance.clear();+ }++ updateDate(key:DateKeys, val:string) {+ this.dates[key] = val;+ if (this.datepickerHelper.validDate(val) && this.datePickerInstance) {+ this.setDatesToDatepicker();+ }+ }++ reposition(element:JQuery<HTMLElement>, target:JQuery<HTMLElement>) {+ element.position({+ my: 'left top',+ at: 'left bottom',+ of: target,+ collision: 'flipfit'+ });+ }++ private initializeDatepicker() {+ this.datePickerInstance = new DatePicker(+ '#flatpickr-input',+ this.singleDate ? this.dates.date : [this.dates.start, this.dates.end],+ {+ mode: this.singleDate ? 'single' : 'multiple',+ inline: true,+ onChange: (dates:Date[]) => {+ this.onDatePickerChange(dates);++ this.onDataChange();+ },+ onMonthChange: () => { this.datepickerHelper.setRangeClasses(this.dates, this.datePickerInstance); },+ onYearChange: () => { this.datepickerHelper.setRangeClasses(this.dates, this.datePickerInstance); },+ }+ );+ }++ private setDatesToDatepicker() {+ if (this.singleDate) {+ let date = this.datepickerHelper.parseDate(this.dates.date);+ this.datePickerInstance.setDates(date);+ } else {+ let dates = [this.datepickerHelper.parseDate(this.dates.start), this.datepickerHelper.parseDate(this.dates.end)];+ this.datePickerInstance.setDates(dates);+ }+ }++ private onDatePickerChange(dates:Date[]) {+ switch (dates.length) {+ case 0: {+ break;+ }+ case 1: {+ if (this.singleDate) {+ this.dates.date = this.timezoneService.formattedISODate(dates[0]);+ } else {+ if (this.dates.start && this.dates.end) {+ // In case we remove a value by clicking on the selected date within the datepicker+ this.dates[this.datepickerHelper.currentlyActivatedDateField] = '';+ } else {+ this.dates[this.datepickerHelper.currentlyActivatedDateField] = this.timezoneService.formattedISODate(dates[0]);+ this.datepickerHelper.toggleCurrentActivatedField(this.dates, this.datePickerInstance);+ }+ }++ break;+ }+ case 2: {+ if ((!this.dates.end && this.datepickerHelper.isStateOfCurrentActivatedField('start')) ||+ (!this.dates.start && this.datepickerHelper.isStateOfCurrentActivatedField('end'))) {+ // If we change a start date when no end date is set, we keep only the newly clicked value and not both+ this.datePickerInstance.setDates([dates[1]]);+ this.onDatePickerChange([dates[1]]);+ } else {+ // Sort dates so that the start date is always first+ if (dates[0] > dates[1]) {+ dates.sort(function(a:Date, b:Date) {+ return a.getTime() - b.getTime();+ });+ this.datePickerInstance.setDates([dates[0], dates[1]]);+ }++ let index = this.datepickerHelper.isStateOfCurrentActivatedField('start') ? 0 : 1;+ this.dates[this.datepickerHelper.currentlyActivatedDateField] = this.timezoneService.formattedISODate(dates[index]);++ this.datepickerHelper.toggleCurrentActivatedField(this.dates, this.datePickerInstance);+ this.datepickerHelper.setRangeClasses(this.dates, this.datePickerInstance);+ }++ break;+ }+ default: {+ // Reset the date picker with the two new values+ if (this.datepickerHelper.isStateOfCurrentActivatedField('start')) {+ this.datePickerInstance.setDates([dates[2], dates[1]]);+ this.onDatePickerChange([dates[2], dates[1]]);+ } else {+ this.datePickerInstance.setDates([dates[0], dates[2]]);+ this.onDatePickerChange([dates[0], dates[2]]);+ }++ break;+ }+ }++ this.cdRef.detectChanges();+ }++ private onDataChange() {+ let date = this.dates.date || '';+ let start = this.dates.start || '';+ let end = this.dates.end || '';++ let output = this.singleDate ? date : start + ' - ' + end;+ this.onDataUpdated.emit(output);+ }+}diff --git a/frontend/src/app/components/datetime/timezone.service.ts b/frontend/src/app/components/datetime/timezone.service.tsindex 2d1831af1ac..37df6d84b85 100644--- a/frontend/src/app/components/datetime/timezone.service.ts+++ b/frontend/src/app/components/datetime/timezone.service.ts@@ -58,7 +58,7 @@ export class TimezoneService {return d;}- public parseDate(date:string, format?:string) {+ public parseDate(date:Date|string, format?:string) {return moment(date, format);}@@ -149,7 +149,7 @@ export class TimezoneService {}public formattedDuration(durationString:string) {- return this.I18n.t('js.units.hour', {count: this.toHours(durationString)});+ return this.I18n.t('js.units.hour', { count: this.toHours(durationString) });}public formattedISODate(date:any) {diff --git a/frontend/src/app/components/filters/filter-date-time-value/filter-date-time-value.component.html b/frontend/src/app/components/filters/filter-date-time-value/filter-date-time-value.component.htmlindex a95ea6dffae..f64a9a755f9 100644--- a/frontend/src/app/components/filters/filter-date-time-value/filter-date-time-value.component.html+++ b/frontend/src/app/components/filters/filter-date-time-value/filter-date-time-value.component.html@@ -1,14 +1,12 @@<div class="inline-label" id="div-values-{{filter.id}}">- <op-date-picker (onChange)="value = isoDateParser($event)">- <input [ngModel]="isoDateFormatter(value)"- [focus]="shouldFocus"- (ngModelChange)="value = isoDateParser($event)"- required- id="values-{{filter.id}}"- name="v[{{filter.id}}]"- class="advanced-filters--date-field"- size="10"- type="text"/>+ <op-date-picker (onChange)="value = isoDateParser($event)"+ [initialDate]="isoDateFormatter(value)"+ [focus]="shouldFocus"+ required="true"+ [id]="'values-' + filter.id"+ [name]="'v[' + filter.id + ']'"+ classes="advanced-filters--date-field"+ size="10"></op-date-picker><span class="advanced-filters--tooltip-trigger -multiline"[attr.data-tooltip]="timeZoneText"diff --git a/frontend/src/app/components/filters/filter-date-times-value/filter-date-times-value.component.html b/frontend/src/app/components/filters/filter-date-times-value/filter-date-times-value.component.htmlindex 38def014b76..d3ec7f73867 100644--- a/frontend/src/app/components/filters/filter-date-times-value/filter-date-times-value.component.html+++ b/frontend/src/app/components/filters/filter-date-times-value/filter-date-times-value.component.html@@ -1,27 +1,23 @@<div id="div-values-{{filter.id}}" class="inline-label">- <op-date-picker (onChange)="begin = isoDateParser($event)">- <input [ngModel]="isoDateFormatter(begin)"- [focus]="shouldFocus"- (ngModelChange)="begin = isoDateParser($event)"- required- id="values-{{filter.id}}-begin"- name="v[{{filter.id}}]-begin"- class="advanced-filters--date-field"- size="10"- type="text"/>+ <op-date-picker (onChange)="begin = isoDateParser($event)"+ [initialDate]="isoDateFormatter(begin)"+ [focus]="shouldFocus"+ required="true"+ [id]="'values-' + filter.id + '-begin'"+ [name]="'v[' + filter.id + ']-begin'"+ classes="advanced-filters--date-field"+ size="10"></op-date-picker><span class="advanced-filters--affix" [textContent]="text.spacer"></span>- <op-date-picker (onChange)="end = isoDateParser($event)">- <input [ngModel]="isoDateFormatter(end)"- (ngModelChange)="end = isoDateParser($event)"- id="values-{{filter.id}}-end"- name="v[{{filter.id}}]-end"- class="advanced-filters--date-field"- size="10"- type="text"/>+ <op-date-picker (onChange)="end = isoDateParser($event)"+ [initialDate]="isoDateFormatter(end)"+ [id]="'values-' + filter.id + '-end'"+ [name]="'v[' + filter.id + ']-end'"+ classes="advanced-filters--date-field"+ size="10"></op-date-picker><span class="advanced-filters--tooltip-trigger -multiline"*ngIf="isTimeZoneDifferent"diff --git a/frontend/src/app/components/filters/filter-date-value/filter-date-value.component.html b/frontend/src/app/components/filters/filter-date-value/filter-date-value.component.htmlindex 1a41c4fb0a4..25641e0ad73 100644--- a/frontend/src/app/components/filters/filter-date-value/filter-date-value.component.html+++ b/frontend/src/app/components/filters/filter-date-value/filter-date-value.component.html@@ -1,13 +1,11 @@<div id="div-values-{{filter.id}}">- <op-date-picker (onChange)="value = parser($event)">- <input [ngModel]="formatter(value)"- [focus]="shouldFocus"- (ngModelChange)="value = parser($event)"- required- id="values-{{filter.id}}"- name="v[{{filter.id}}]"- class="advanced-filters--date-field"- size="10"- type="text"/>+ <op-date-picker (onChange)="value = parser($event)"+ [initialDate]="formatter(value)"+ [focus]="shouldFocus"+ required="true"+ [id]="'values-' + filter.id"+ [name]="'v[' + filter.id + ']'"+ classes="advanced-filters--date-field"+ size="10"></op-date-picker></div>diff --git a/frontend/src/app/components/filters/filter-dates-value/filter-dates-value.component.html b/frontend/src/app/components/filters/filter-dates-value/filter-dates-value.component.htmlindex f90c99f058c..73fb59f1be1 100644--- a/frontend/src/app/components/filters/filter-dates-value/filter-dates-value.component.html+++ b/frontend/src/app/components/filters/filter-dates-value/filter-dates-value.component.html@@ -1,28 +1,24 @@<div id="div-values-{{filter.id}}"class="inline-label">- <op-date-picker (onChange)="begin = parser($event)">- <input [ngModel]="formatter(begin)"- [focus]="shouldFocus"- (ngModelChange)="begin = parser($event)"- required- id="values-{{filter.id}}-begin"- name="v[{{filter.id}}]-begin"- class="advanced-filters--date-field"- size="10"- type="text"/>+ <op-date-picker (onChange)="begin = parser($event)"+ [initialDate]="formatter(begin)"+ [focus]="shouldFocus"+ required="true"+ [id]="'values-' + filter.id + '-begin'"+ [name]="'v[' + filter.id + ']-begin'"+ classes="advanced-filters--date-field"+ size="10"></op-date-picker><span class="advanced-filters--affix" [textContent]="text.spacer"></span>- <op-date-picker (onChange)="end = parser($event)">- <input [ngModel]="formatter(end)"- (ngModelChange)="end = parser($event)"- required- id="values-{{filter.id}}-end"- name="v[{{filter.id}}]-end"- class="advanced-filters--date-field"- size="10"- type="text"/>+ <op-date-picker (onChange)="end = parser($event)"+ [initialDate]="formatter(end)"+ required="true"+ [id]="'values-' + filter.id + '-end'"+ [name]="'v[' + filter.id + ']-end'"+ classes="advanced-filters--date-field"+ size="10"></op-date-picker></div>diff --git a/frontend/src/app/components/work-packages/wp-single-view/wp-single-view.component.ts b/frontend/src/app/components/work-packages/wp-single-view/wp-single-view.component.tsindex d5aaa6ee852..1c1a05e97ca 100644--- a/frontend/src/app/components/work-packages/wp-single-view/wp-single-view.component.ts+++ b/frontend/src/app/components/work-packages/wp-single-view/wp-single-view.component.ts@@ -343,16 +343,16 @@ export class WorkPackageSingleViewComponent extends UntilDestroyedMixin implemen*/private getDateField(resource:WorkPackageResource):FieldDescriptor {let object:any = {- name: 'date',label: this.I18n.t('js.work_packages.properties.date'),multiple: false};if (resource.schema.hasOwnProperty('date')) {object.field = this.displayField(resource, 'date');+ object.name = 'date';} else {- object.fields = [this.displayField(resource, 'startDate'), this.displayField(resource, 'dueDate')];- object.multiple = true;+ object.field = this.displayField(resource, 'startDate');+ object.name = 'startDate';}return object;diff --git a/frontend/src/app/components/wp-custom-actions/date-action/custom-date-action-admin.html b/frontend/src/app/components/wp-custom-actions/date-action/custom-date-action-admin.htmlindex 1844e0d1c50..c1cc6ae5e03 100644--- a/frontend/src/app/components/wp-custom-actions/date-action/custom-date-action-admin.html+++ b/frontend/src/app/components/wp-custom-actions/date-action/custom-date-action-admin.html@@ -11,12 +11,11 @@</select></span><span class="form--text-field-container -slim" *ngIf="valueVisible">- <op-date-picker (onChange)="updateField($event)" (onInputChange)="updateField($event)">- <input [attr.id]="fieldId + '_visible'"- [name]="fieldId + '_input'"- [ngModel]="fieldValue"- class="form--text-field"- type="text"/>+ <op-date-picker (onChange)="updateField($event)"+ [id]="fieldId + '_visible'"+ [name]="fieldId + '_input'"+ [initialDate]="fieldValue"+ classes="form--text-field"></op-date-picker></span><input type="hidden"diff --git a/frontend/src/app/components/wp-edit-form/display-field-renderer.ts b/frontend/src/app/components/wp-edit-form/display-field-renderer.tsindex 04c3b043d65..4a2206ab388 100644--- a/frontend/src/app/components/wp-edit-form/display-field-renderer.ts+++ b/frontend/src/app/components/wp-edit-form/display-field-renderer.ts@@ -9,6 +9,7 @@ import {MultipleLinesUserFieldModule} from "core-app/modules/fields/display/fielimport {ResourceChangeset} from "core-app/modules/fields/changeset/resource-changeset";import {HalResource} from "core-app/modules/hal/resources/hal-resource";import {InjectField} from "core-app/helpers/angular/inject-field.decorator";+import {CombinedDateDisplayField} from "core-app/modules/fields/display/field-types/combined-date-display.field";export const editableClassName = '-editable';export const requiredClassName = '-required';@@ -102,6 +103,11 @@ export class DisplayFieldRenderer<T extends HalResource = HalResource> {return new MultipleLinesUserFieldModule(name, context) as DisplayField;}+ // In the single view, start and end date are shown in a combined date field+ if (this.container === 'single-view' && (name === 'startDate')) {+ return new CombinedDateDisplayField(name, context) as DisplayField;+ }+// We handle progress differently in the timelineif (this.container === 'timeline' && name === 'percentageDone') {return new ProgressTextDisplayField(name, context);@@ -190,7 +196,6 @@ export class DisplayFieldRenderer<T extends HalResource = HalResource> {}return name;-}private getDefaultPlaceholder(fieldSchema:IFieldSchema):string {diff --git a/frontend/src/app/components/wp-form-group/wp-attribute-group.component.ts b/frontend/src/app/components/wp-form-group/wp-attribute-group.component.tsindex cf9c77db8fe..062974330fb 100644--- a/frontend/src/app/components/wp-form-group/wp-attribute-group.component.ts+++ b/frontend/src/app/components/wp-form-group/wp-attribute-group.component.ts@@ -40,13 +40,6 @@ export class WorkPackageFormAttributeGroupComponent {@Input() public workPackage:WorkPackageResource;@Input() public group:GroupDescriptor;- public text = {- date: {- startDate: this.I18n.t('js.label_no_start_date'),- dueDate: this.I18n.t('js.label_no_due_date')- },- };-constructor(readonly I18n:I18nService,public wpeditForm:EditFormComponent,protected injector:Injector) {diff --git a/frontend/src/app/components/wp-form-group/wp-attribute-group.template.html b/frontend/src/app/components/wp-form-group/wp-attribute-group.template.htmlindex 57b6baea201..d96fde77695 100644--- a/frontend/src/app/components/wp-form-group/wp-attribute-group.template.html+++ b/frontend/src/app/components/wp-form-group/wp-attribute-group.template.html@@ -27,31 +27,6 @@[fieldName]="descriptor.name"></editable-attribute-field></div>- <div- class="attributes-key-value--key"- *ngIf="descriptor.multiple">- <wp-replacement-label [fieldName]="descriptor.name">- {{ descriptor.label }}- </wp-replacement-label>- <attribute-help-text [attribute]="descriptor.name" [attributeScope]="'WorkPackage'"></attribute-help-text>- </div>- <div- *ngIf="descriptor.multiple"- class="attributes-key-value--value-container -minimal">- <editable-attribute-field [fieldName]="descriptor.fields[0].name"- [resource]="workPackage"- [wrapperClasses]="'-small -shrink'"- [displayPlaceholder]="text[descriptor.name][descriptor.fields[0].name]">- </editable-attribute-field>-- <span class="attributes-key-value--value-separator"></span>-- <editable-attribute-field [fieldName]="descriptor.fields[1].name"- [resource]="workPackage"- [wrapperClasses]="'-small -shrink'"- [displayPlaceholder]="text[descriptor.name][descriptor.fields[1].name]">- </editable-attribute-field>- </div></ng-template></div></div>diff --git a/frontend/src/app/globals/global-listeners/augmented-date-picker.ts b/frontend/src/app/globals/global-listeners/augmented-date-picker.tsindex 17c38a14edf..b255f739614 100644--- a/frontend/src/app/globals/global-listeners/augmented-date-picker.ts+++ b/frontend/src/app/globals/global-listeners/augmented-date-picker.ts@@ -1,3 +1,5 @@+import {DatePicker} from "core-app/modules/common/op-date-picker/datepicker";+/*** Our application is still a hybrid one, meaning most routes are still* handled by Rails. As such, we disable the default link-hijacking that@@ -8,8 +10,17 @@export function augmentedDatePicker(evt:JQuery.TriggeredEvent, target:JQuery) {if (target.hasClass('-augmented-datepicker')) {target- .attr('autocomplete', 'off') // Disable autocomplete for those fields- .datepicker() // Create datepicker with defaults- .datepicker('show'); // And show immediately since the click is not yet wired to the datepicker instance+ .attr('autocomplete', 'off'); // Disable autocomplete for those fields++ var datePicker = new DatePicker(+ '.-augmented-datepicker',+ target.val(),+ {+ weekNumbers: true,+ allowInput: true+ },+ target[0]+ );+ datePicker.show();}}diff --git a/frontend/src/app/modules/common/op-date-picker/datepicker.ts b/frontend/src/app/modules/common/op-date-picker/datepicker.tsindex 9964a81873c..ae340d34086 100644--- a/frontend/src/app/modules/common/op-date-picker/datepicker.ts+++ b/frontend/src/app/modules/common/op-date-picker/datepicker.ts@@ -26,66 +26,87 @@// See docs/COPYRIGHT.rdoc for more details.//++-import {ConfigurationService} from '../../common/config/configuration.service';-import {TimezoneService} from 'core-components/datetime/timezone.service';+import flatpickr from "flatpickr";+import {Instance} from "flatpickr/dist/types/instance";+import {ConfigurationService} from "core-app/modules/common/config/configuration.service";+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+import DateOption = flatpickr.Options.DateOption;export class DatePicker {- public datepickerFormat = 'yy-mm-dd';+ private datepickerFormat = 'Y-m-d';- private datepickerCont: JQuery = jQuery(this.datepickerElem);- private datepickerInstance:any = null;+ private datepickerCont:JQuery = jQuery(this.datepickerElemIdentifier);+ public datepickerInstance:Instance;- constructor(readonly ConfigurationService:ConfigurationService,- readonly timezoneService:TimezoneService,- private datepickerElem:JQuery,+ constructor(private datepickerElemIdentifier:string,private date:any,- private options:any) {+ private options:any,+ private datepickerTarget?:HTMLElement,+ private configurationService?:ConfigurationService) {this.initialize(options);}private initialize(options:any) {- const firstDayOfWeek = this.ConfigurationService.startOfWeekPresent() ?- this.ConfigurationService.startOfWeek() : (jQuery.datepicker as any)._defaults.firstDay;-- var mergedOptions = _.extend({}, options, {- firstDay: firstDayOfWeek,- showWeeks: true,- changeMonth: true,- changeYear: true,- closeText: I18n.t('js.button_confirm'),+ const I18n = new I18nService();+ const firstDayOfWeek =+ this.configurationService?.startOfWeekPresent() ? this.configurationService.startOfWeek() : 1;++ const mergedOptions = _.extend({}, options, {+ weekNumbers: true,dateFormat: this.datepickerFormat,- defaultDate: this.timezoneService.formattedISODate(this.date),- showButtonPanel: true,- yearRange: "-15:+20"+ defaultDate: this.date,+ locale: {+ weekdays: {+ shorthand: I18n.t('date.abbr_day_names'),+ longhand: I18n.t('date.day_names'),+ },+ months: {+ shorthand: (I18n.t('date.abbr_month_names') as any).slice(1),+ longhand: (I18n.t('date.month_names') as any).slice(1),+ },+ firstDayOfWeek: firstDayOfWeek,+ weekAbbreviation: I18n.t('date.abbr_week')+ },});- this.datepickerInstance = this.datepickerCont.datepicker(mergedOptions);+ var datePickerInstances:Instance|Instance[];+ if (this.datepickerTarget) {+ datePickerInstances = flatpickr(this.datepickerTarget as Node, mergedOptions);+ } else {+ datePickerInstances = flatpickr(this.datepickerElemIdentifier, mergedOptions);+ }- // Disable autocomplete to avoid overlay- this.datepickerCont.attr('autocomplete', 'off');+ this.datepickerInstance = Array.isArray(datePickerInstances) ? datePickerInstances[0] : datePickerInstances;}public clear() {- this.datepickerInstance.datepicker('setDate', null);+ this.datepickerInstance.clear();}public destroy() {this.hide();- this.datepickerInstance.datepicker('destroy');+ this.datepickerInstance.destroy();}public hide() {- this.datepickerInstance.datepicker('hide');+ if (this.isOpen) {+ this.datepickerInstance.close();+ }+this.datepickerCont.scrollParent().off('scroll');}public show() {- this.datepickerInstance.datepicker('show');+ this.datepickerInstance.open();this.hideDuringScroll();}- public reshow() {- this.datepickerInstance.datepicker('show');+ public setDates(dates:DateOption|DateOption[]) {+ this.datepickerInstance.setDate(dates);+ }++ public get isOpen():boolean {+ return this.datepickerInstance.isOpen;}private hideDuringScroll() {@@ -93,14 +114,14 @@ export class DatePicker {let scrollParent = this.datepickerCont.scrollParent();scrollParent.scroll(() => {- this.datepickerInstance.datepicker('hide');+ this.datepickerInstance.close();if (reshowTimeout) {clearTimeout(reshowTimeout);}reshowTimeout = setTimeout(() => {if (this.visibleAndActive()) {- this.datepickerInstance.datepicker('show');+ this.datepickerInstance.open();}}, 50);});@@ -112,7 +133,7 @@ export class DatePicker {try {return document.elementFromPoint(input.offset()!.left, input.offset()!.top) === input[0] &&document.activeElement === input[0];- } catch(e) {+ } catch (e) {console.error("Failed to test visibleAndActive " + e)return false;}diff --git a/frontend/src/app/modules/common/op-date-picker/op-date-picker.component.html b/frontend/src/app/modules/common/op-date-picker/op-date-picker.component.htmlindex dfdbcc70d33..08ea76dfee3 100644--- a/frontend/src/app/modules/common/op-date-picker/op-date-picker.component.html+++ b/frontend/src/app/modules/common/op-date-picker/op-date-picker.component.html@@ -1,3 +1,13 @@-<div>- <ng-content></ng-content>-</div>+<input #dateInput+ [id]="id"+ [name]="name"+ [value]="initialDate"+ [ngClass]="classes"+ [size]="size"+ [required]="required"+ [focus]="focus"+ [disabled]="disabled"+ (click)="openOnClick()"+ (blur)="closeOnOutsideClick($event)"+ (input)="onInputChange($event)"+ type="text">diff --git a/frontend/src/app/modules/common/op-date-picker/op-date-picker.component.ts b/frontend/src/app/modules/common/op-date-picker/op-date-picker.component.tsindex d842c771b83..c20daed1465 100644--- a/frontend/src/app/modules/common/op-date-picker/op-date-picker.component.ts+++ b/frontend/src/app/modules/common/op-date-picker/op-date-picker.component.ts@@ -26,93 +26,125 @@// See docs/COPYRIGHT.rdoc for more details.// ++-import {Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output} from '@angular/core';+import {AfterViewInit, Component, ElementRef, EventEmitter, Input, OnDestroy, Output, ViewChild} from '@angular/core';import {ConfigurationService} from 'core-app/modules/common/config/configuration.service';-import {DatePicker} from 'core-app/modules/common/op-date-picker/datepicker';import {TimezoneService} from 'core-components/datetime/timezone.service';+import {DatePicker} from "core-app/modules/common/op-date-picker/datepicker";+import {DebouncedEventEmitter} from "core-components/angular/debounced-event-emitter";+import {UntilDestroyedMixin} from "core-app/helpers/angular/until-destroyed.mixin";+import {componentDestroyed} from "@w11k/ngx-componentdestroyed";+import {keyCodes} from "core-app/modules/common/keyCodes.enum";+import {Instance} from "flatpickr/dist/types/instance";@Component({selector: 'op-date-picker',templateUrl: './op-date-picker.component.html'})-export class OpDatePickerComponent implements OnInit, OnDestroy {- @Output() public onChange = new EventEmitter<string>();- @Output() public onInputChange = new EventEmitter<string>();- @Output() public onClose = new EventEmitter<string>();- @Input() public initialDate?:string;+export class OpDatePickerComponent extends UntilDestroyedMixin implements OnDestroy, AfterViewInit {+ @Output() public onChange = new DebouncedEventEmitter<string>(componentDestroyed(this));+ @Output() public onCancel = new EventEmitter<string>();++ @Input() public initialDate:string = '';+ @Input() public appendTo?:HTMLElement = document.body;+ @Input() public classes:string = '';+ @Input() public id:string = '';+ @Input() public name:string = '';+ @Input() public required:boolean = false;+ @Input() public size:number = 20;+ @Input() public focus:boolean = false;+ @Input() public disabled:boolean = false;++ @ViewChild('dateInput') dateInput:ElementRef;- private $element:JQuery;private datePickerInstance:DatePicker;- private input:JQuery;public constructor(private elementRef:ElementRef,private ConfigurationService:ConfigurationService,private timezoneService:TimezoneService) {- }-+ super();- ngOnInit() {- this.$element = jQuery(this.elementRef.nativeElement);+ if (!this.id) {+ this.id = 'datepicker-input-' + Math.floor(Math.random() * 1000).toString(3);+ }+ }- this.input = this.$element.find('input');- this.input.on('change', () => this.onInputChange.emit(this.currentValue()))- this.setup();+ ngAfterViewInit():void {+ this.initializeDatepicker();}ngOnDestroy() {this.datePickerInstance && this.datePickerInstance.destroy();}- public setup() {- this.input.focus(() => this.showDatePicker());- this.input.keydown((event) => {- if (this.isEmpty()) {- this.datePickerInstance.clear();- }- });+ openOnClick() {+ if (!this.disabled) {+ this.datePickerInstance.show();+ }+ }++ onInputChange(_event:KeyboardEvent) {+ if (this.isEmpty()) {+ this.datePickerInstance.clear();+ } else if (this.inputIsValidDate()) {+ this.onChange.emit(this.currentValue);+ }+ }++ closeOnOutsideClick(event:any) {+ if (!(event.relatedTarget &&+ this.datePickerInstance.datepickerInstance.calendarContainer.contains(event.relatedTarget))) {+ this.datePickerInstance.hide();+ }}private isEmpty():boolean {- return this.currentValue().trim() === '';+ return this.currentValue.trim() === '';}- private currentValue():string {- return this.input.val() as string;+ private get currentValue():string {+ return this.inputElement?.value || '';}- private showDatePicker() {- let options:any = {- onSelect: (date:any) => {- this.datePickerInstance.hide();+ private get inputElement():HTMLInputElement {+ return this.dateInput.nativeElement;+ }++ private inputIsValidDate():boolean {+ return this.currentValue.match(/\d{4}-\d{2}-\d{2}/) !== null;+ }- let val = date;+ private initializeDatepicker() {+ let options:any = {+ allowInput: true,+ appendTo: this.appendTo,+ onChange:(selectedDates:Date[], dateStr:string) => {+ let val:string = dateStr;if (this.isEmpty()) {- val = null;+ return;}- this.input.val(val);- this.input.trigger('change');+ this.inputElement.value = val;this.onChange.emit(val);},- onClose: () => this.onClose.emit()+ onKeyDown: (selectedDates:Date[], dateStr:string, instance:Instance, data:KeyboardEvent) => {+ if (data.which == keyCodes.ESCAPE) {+ this.onCancel.emit();+ }+ }};let initialValue;if (this.isEmpty && this.initialDate) {initialValue = this.timezoneService.parseISODate(this.initialDate).toDate();} else {- initialValue = this.currentValue();+ initialValue = this.currentValue;}this.datePickerInstance = new DatePicker(- this.ConfigurationService,- this.timezoneService,- this.input,+ '#' + this.id,initialValue,options);-- this.datePickerInstance.show();}}diff --git a/frontend/src/app/modules/fields/changeset/resource-changeset.ts b/frontend/src/app/modules/fields/changeset/resource-changeset.tsindex 5a6f5061218..86822fd72b0 100644--- a/frontend/src/app/modules/fields/changeset/resource-changeset.ts+++ b/frontend/src/app/modules/fields/changeset/resource-changeset.ts@@ -198,9 +198,9 @@ export class ResourceChangeset<T extends HalResource|{ [key:string]:unknown; } =** @param key*/- public isWritable(key:string) {+ public isWritable(key:string):boolean {const fieldSchema = this.schema[key] as IFieldSchema|null;- return fieldSchema && fieldSchema.writable;+ return !!(fieldSchema && fieldSchema.writable);}/**@@ -261,10 +261,25 @@ export class ResourceChangeset<T extends HalResource|{ [key:string]:unknown; } =return this.changeset.contains(key) || this.pristineResource.hasOwnProperty(key);}+ /**+ * Change the value of the projected resource to some value+ *+ * @param key+ * @param val+ */public setValue(key:string, val:any) {this.changeset.set(key, val, this.pristineResource[key]);}+ /**+ * Clear the changed value of the projected resource+ *+ * @param keys A set of keys to reset+ */+ public clearValue(...keys:string[]) {+ this.changeset.reset(...keys);+ }+public clear() {this.state && this.state.clear();this.changeset.clear();diff --git a/frontend/src/app/modules/fields/display/field-types/combined-date-display.field.ts b/frontend/src/app/modules/fields/display/field-types/combined-date-display.field.tsnew file mode 100644index 00000000000..8fa32510d39--- /dev/null+++ b/frontend/src/app/modules/fields/display/field-types/combined-date-display.field.ts@@ -0,0 +1,63 @@+// -- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2020 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 {DateDisplayField} from "core-app/modules/fields/display/field-types/date-display-field.module";++export class CombinedDateDisplayField extends DateDisplayField {+ text = {+ placeholder: {+ startDate: this.I18n.t('js.label_no_start_date'),+ dueDate: this.I18n.t('js.label_no_due_date')+ },+ };++ public render(element:HTMLElement, displayText:string):void {+ var startDateElement = this.createDateDisplayField('startDate');+ var dueDateElement = this.createDateDisplayField('dueDate');++ var separator = document.createElement('span');+ separator.textContent = ' - ';++ element.appendChild(startDateElement);+ element.appendChild(separator);+ element.appendChild(dueDateElement);+ }++ private createDateDisplayField(date:'dueDate'|'startDate'):HTMLElement {+ var dateElement = document.createElement('span');+ var dateDisplayField = new DateDisplayField(date, this.context);+ var text = this.resource[date] ?+ this.timezoneService.formattedDate(this.resource[date]) :+ this.text.placeholder[date];++ dateDisplayField.apply(this.resource, this.schema);+ dateDisplayField.render(dateElement, text);++ return dateElement;+ }+}diff --git a/frontend/src/app/modules/fields/display/field-types/date-display-field.module.ts b/frontend/src/app/modules/fields/display/field-types/date-display-field.module.tsindex 822a4d1ce37..00411bfcf93 100644--- a/frontend/src/app/modules/fields/display/field-types/date-display-field.module.ts+++ b/frontend/src/app/modules/fields/display/field-types/date-display-field.module.ts@@ -37,6 +37,15 @@ export class DateDisplayField extends HighlightableDisplayField {public render(element:HTMLElement, displayText:string):void {super.render(element, displayText);+ // Show scheduling mode in front of the start date field+ if (this.showSchedulingMode()) {+ const schedulingIcon = document.createElement('span');+ schedulingIcon.classList.add('icon-context');+ schedulingIcon.classList.add(this.resource.scheduleManually ? 'icon-pin' : 'icon-arrow-left-right');++ element.prepend(schedulingIcon);+ }+// Highlight overdue tasksif (this.shouldHighlight && this.canOverdue) {const diff = this.timezoneService.daysFromToday(this.value);@@ -55,4 +64,8 @@ export class DateDisplayField extends HighlightableDisplayField {return '';}}++ private showSchedulingMode():boolean {+ return this.name === 'startDate' || this.name === 'date';+ }}diff --git a/frontend/src/app/modules/fields/edit/edit-field.initializer.ts b/frontend/src/app/modules/fields/edit/edit-field.initializer.tsindex 96a81eb0915..081fc4861b1 100644--- a/frontend/src/app/modules/fields/edit/edit-field.initializer.ts+++ b/frontend/src/app/modules/fields/edit/edit-field.initializer.ts@@ -44,6 +44,7 @@ import {ProjectStatusEditFieldComponent} from "core-app/modules/fields/edit/fielimport {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";export function initializeCoreEditFields(editFieldService:EditFieldService, selectAutocompleterRegisterService:SelectAutocompleterRegisterService) {@@ -75,6 +76,7 @@ export function initializeCoreEditFields(editFieldService:EditFieldService, sele.addFieldType(WorkPackageCommentFieldComponent, '_comment', ['comment']);editFieldService+ .addSpecificFieldType('WorkPackage', CombinedDateEditFieldComponent, 'date', ['startDate', 'dueDate', 'date']).addSpecificFieldType('TimeEntry', PlainFormattableEditFieldComponent, 'comment', ['comment']).addSpecificFieldType('TimeEntry', TimeEntryWorkPackageEditFieldComponent, 'workPackage', ['WorkPackage']);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.tsnew file mode 100644index 00000000000..9b5f6750bb9--- /dev/null+++ b/frontend/src/app/modules/fields/edit/field-types/combined-date-edit-field.component.ts@@ -0,0 +1,100 @@+// -- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2020 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 {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 {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";++@Component({+ template: `+ <input [value]="dates"+ (click)="handleClick()"+ type="text" />+ `+})+export class CombinedDateEditFieldComponent extends DateEditFieldComponent implements OnInit, OnDestroy {+ @InjectField() readonly timezoneService:TimezoneService;+ @InjectField() opModalService:OpModalService;++ dates:string = '';++ private modal:OpModalComponent;++ ngOnInit() {+ super.ngOnInit();++ this.handler+ .$onUserActivate+ .pipe(+ this.untilDestroyed()+ )+ .subscribe(() => {+ this.showDatePickerModal();+ });+ }++ ngOnDestroy() {+ super.ngOnDestroy();+ this.modal?.closeMe();+ }++ public handleClick() {+ this.showDatePickerModal();+ }++ private showDatePickerModal():void {+ const modal = this.modal = this+ .opModalService+ .show(DatePickerModal, this.injector, { changeset: this.change, fieldName: this.name });++ setTimeout(() => {+ const modalElement = jQuery(modal.elementRef.nativeElement).find('.datepicker-modal');+ const field = jQuery(this.elementRef.nativeElement);+ modal.reposition(modalElement, field);+ });++ modal+ .onDataUpdated+ .subscribe((dates:string) => {+ this.dates = dates;+ this.cdRef.detectChanges();+ });++ modal+ .closingEvent+ .pipe(take(1))+ .subscribe(() => {+ this.handler.handleUserSubmit();+ });+ }+}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 05d3d1bd4ae..9d8fc4b4fce 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@@ -26,39 +26,42 @@// See docs/COPYRIGHT.rdoc for more details.// ++-import {Component} from "@angular/core";+import {Component, OnInit} from "@angular/core";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";@Component({template: `<op-date-picker- tabindex="-1"- (onChange)="onValueSelected($event)"- (onClose)="handler.handleUserSubmit()"- [initialDate]="defaultDate">-- <input [ngModel]="formatter(value)"- (ngModelChange)="value = parser($event);"- type="text"- class="inline-edit--field"- (keydown)="handler.handleUserKeydown($event)"- [attr.required]="required"- [disabled]="inFlight"- [attr.placeholder]="placeholder"- [id]="handler.htmlId"/>-+ tabindex="-1"+ (onChange)="onValueSelected($event)"+ (onCancel)="onCancel()"+ [initialDate]="formatter(value)"+ [required]="required"+ [disabled]="inFlight"+ [id]="handler.htmlId"+ classes="inline-edit--field"></op-date-picker>-`})-export class DateEditFieldComponent extends EditFieldComponent {+export class DateEditFieldComponent extends EditFieldComponent implements OnInit {@InjectField() readonly timezoneService:TimezoneService;+ @InjectField() opModalService:OpModalService;++ ngOnInit() {+ super.ngOnInit();+ }public onValueSelected(data:string) {this.value = this.parser(data);+ this.handler.handleUserSubmit();+ }++ public onCancel() {+ this.handler.handleUserCancel();}public parser(data:any) {@@ -77,18 +80,4 @@ export class DateEditFieldComponent extends EditFieldComponent {return null;}}-- /**- * Return the default date for the datepicker instance.- * If this field is the finish date, we select the start date + 1 as the default.- */- public get defaultDate():String {- const isDueDate = this.name === 'dueDate';-- if (isDueDate) {- return this.resource.startDate;- }-- return '';- }}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 7d2ad18ccbb..8770b56d8c9 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@@ -168,6 +168,7 @@ import {PartitionedQuerySpacePageComponent} from "core-app/modules/work_packagesimport {WorkPackageViewPageComponent} from "core-app/modules/work_packages/routing/wp-view-page/wp-view-page.component";import {WorkPackageSettingsButtonComponent} from "core-components/wp-buttons/wp-settings-button/wp-settings-button.component";import {BackButtonComponent} from "core-app/modules/common/back-routing/back-button.component";+import {DatePickerModal} from "core-components/datepicker/datepicker.modal";@NgModule({imports: [@@ -363,6 +364,7 @@ import {BackButtonComponent} from "core-app/modules/common/back-routing/back-butQuerySharingModal,SaveQueryModal,WpDestroyModal,+ DatePickerModal,// CustomActionsWpCustomActionComponent,diff --git a/modules/costs/app/views/cost_types/_rate.html.erb b/modules/costs/app/views/cost_types/_rate.html.erbindex d3e3253a131..f621fea39b0 100644--- a/modules/costs/app/views/cost_types/_rate.html.erb+++ b/modules/costs/app/views/cost_types/_rate.html.erb@@ -51,7 +51,7 @@ See docs/COPYRIGHT.rdoc for more details.<td><label class="hidden-for-sighted" for="<%= "#{id_prefix}_valid_from" %>"><%= Rate.human_attribute_name(:valid_from) %></label><%= rate_form.text_field :valid_from,- class: 'date costs-date-picker -augmented-calendar',+ class: 'date costs-date-picker -augmented-datepicker',index: id_or_index,required: true %></td>diff --git a/modules/costs/frontend/module/augment/cost-subform.augment.service.ts b/modules/costs/frontend/module/augment/cost-subform.augment.service.tsindex aecdc95be92..71564a76512 100644--- a/modules/costs/frontend/module/augment/cost-subform.augment.service.ts+++ b/modules/costs/frontend/module/augment/cost-subform.augment.service.ts@@ -56,7 +56,6 @@ export class CostSubformAugmentService {container.append(row);rowIndex += 1;- container.find('.costs-date-picker').datepicker();container.find('.subform-row:last-child input:first').focus();return false;diff --git a/modules/costs/spec/features/members_hourly_rates_spec.rb b/modules/costs/spec/features/members_hourly_rates_spec.rbindex 851fc76f738..b9551bd6000 100644--- a/modules/costs/spec/features/members_hourly_rates_spec.rb+++ b/modules/costs/spec/features/members_hourly_rates_spec.rb@@ -62,18 +62,11 @@ describe 'hourly rates on a member', type: :feature, js: true dofill_in 'Valid from', with: date.strftime('%Y-%m-%d') if datefill_in 'Rate', with: rateend-- find('.ui-datepicker-close').click rescue nilenddef change_rate_date(from:, to:)input = find("table.rates .date[value='#{from.strftime('%Y-%m-%d')}']")input.set(to.strftime('%Y-%m-%d'))-- find('.ui-datepicker-close').click rescue nil-- # Without this, the opening Datepicker seems to revert the result???- sleep(1)endbefore dodiff --git a/spec/features/work_packages/custom_actions_spec.rb b/spec/features/work_packages/custom_actions_spec.rbindex 4326d01793b..7ce91258d29 100644--- a/spec/features/work_packages/custom_actions_spec.rb+++ b/spec/features/work_packages/custom_actions_spec.rb@@ -289,15 +289,10 @@ describe 'Custom actions', type: :feature, js: true doselect date_custom_field.name, from: 'Add action'select 'on', from: date_custom_field.name- date = (Date.today + 5.days).to_s- field_name = "custom_action_actions_custom_field_#{date_custom_field.id}_visible"- page.execute_script("jQuery('##{field_name}').val('#{date}');")- page.execute_script("jQuery('##{field_name}').trigger('change');")-- # Close autocompleter- if page.has_selector? '.ui-datepicker-close'- scroll_to_and_click(find('.ui-datepicker-close'))- end+ date = (Date.today + 5.days)+ find("#custom_action_actions_custom_field_#{date_custom_field.id}_visible").click+ datepicker = Components::Datepicker.new 'body'+ datepicker.set_date datenew_ca_page.add_action('Type', other_type.name)new_ca_page.expect_action('type', other_type.id)diff --git a/spec/features/work_packages/details/date_editor_spec.rb b/spec/features/work_packages/details/date_editor_spec.rbindex 742ce538d7a..e5d2e83e94a 100644--- a/spec/features/work_packages/details/date_editor_spec.rb+++ b/spec/features/work_packages/details/date_editor_spec.rb@@ -40,8 +40,8 @@ describe 'date inplace editor',let(:work_package) { FactoryBot.create :work_package, project: project, start_date: '2016-01-01' }let(:user) { FactoryBot.create :admin }let(:work_packages_page) { Pages::FullWorkPackage.new(work_package,project) }+ let(:wp_table) { Pages::WorkPackagesTable.new(project) }- let(:due_date) { work_packages_page.edit_field(:dueDate) }let(:start_date) { work_packages_page.edit_field(:startDate) }before do@@ -52,17 +52,16 @@ describe 'date inplace editor',endit 'uses the start date as a placeholder for the end date' do- due_date.activate!+ start_date.activate!+ start_date.expect_active!- within('.ui-datepicker') do- expect(page).to have_selector('.ui-datepicker-month option', text: 'Jan')- expect(page).to have_selector('.ui-datepicker-year option', text: '2016')- day = find('td a', text: '25')- scroll_to_and_click(day)- end+ start_date.datepicker.expect_year '2016'+ start_date.datepicker.expect_month 'January'+ start_date.datepicker.select_day '25'- due_date.expect_inactive!- due_date.expect_state_text '2016-01-25'+ start_date.save!+ start_date.expect_inactive!+ start_date.expect_state_text '2016-01-25'endit 'saves the date when clearing and then confirming' do@@ -74,9 +73,7 @@ describe 'date inplace editor',start_date.clear with_backspace: truestart_date.input_element.send_keys :backspace- within('.ui-datepicker') do- find('button', text: 'Confirm').click- end+ start_date.save!work_packages_page.expect_and_dismiss_notification message: 'Successful update.'@@ -86,4 +83,66 @@ describe 'date inplace editor',work_package.reloadexpect(work_package.start_date).to be_nilend++ it 'closes the date picker when moving away' do+ wp_table.visit!+ wp_table.open_full_screen_by_doubleclick work_package++ start_date.activate!+ start_date.expect_active!++ page.execute_script('window.history.back()')+ work_packages_page.accept_alert_dialog! if work_packages_page.has_alert_dialog?++ # Ensure no modal survives+ expect(page).to have_no_selector('.op-modal--modal-container')+ end++ context 'with a date custom field' do+ let!(:type) { FactoryBot.create :type }+ let!(:project) { FactoryBot.create :project, types: [type] }+ let!(:priority) { FactoryBot.create :default_priority }+ let!(:status) { FactoryBot.create :default_status }++ let!(:date_cf) do+ FactoryBot.create(+ :date_wp_custom_field,+ name: "My date",+ types: [type],+ projects: [project]+ )+ end++ let(:cf_field) { EditField.new page, :"customField#{date_cf.id}" }+ let(:datepicker) { ::Components::Datepicker.new }+ let(:create_page) { ::Pages::FullWorkPackageCreate.new(project: project) }++ it 'can handle creating a CF date' do+ create_page.visit!++ type_field = create_page.edit_field(:type)+ type_field.activate!+ type_field.set_value type.name++ cf_field.expect_active!++ # When cancelling, expect there to be no notification+ create_page.cancel!+ create_page.expect_no_notification type: nil++ create_page.visit!+ cf_field.expect_active!++ # Open date picker+ cf_field.input_element.click+ datepicker.set_date Date.today++ create_page.edit_field(:subject).set_value 'My subject!'+ create_page.save!+ create_page.expect_and_dismiss_notification message: 'Successful creation'++ wp = WorkPackage.last+ expect(wp.custom_value_for(date_cf.id).value).to eq Date.today.iso8601+ end+ endenddiff --git a/spec/features/work_packages/edit_work_package_spec.rb b/spec/features/work_packages/edit_work_package_spec.rbindex de014b601ef..b4fb2edd343 100644--- a/spec/features/work_packages/edit_work_package_spec.rb+++ b/spec/features/work_packages/edit_work_package_spec.rb@@ -128,8 +128,7 @@ describe 'edit work package', js: true doit 'allows updating and seeing the results' dowp_page.update_attributes subject: 'a new subject',type: type2.name,- startDate: '2013-03-04',- dueDate: '2013-03-20',+ startDate: ['2013-03-04', '2013-03-20'],responsible: manager.name,assignee: manager.name,estimatedTime: '5',@@ -143,8 +142,7 @@ describe 'edit work package', js: true dowp_page.expect_attributes type: type2.name.upcase,responsible: manager.name,assignee: manager.name,- startDate: '03/04/2013',- dueDate: '03/20/2013',+ startDate: '03/04/2013 - 03/20/2013',estimatedTime: '5',percentageDone: '30%',subject: 'a new subject',diff --git a/spec/features/work_packages/scheduling/toggle_scheduling_mode_spec.rb b/spec/features/work_packages/scheduling/toggle_scheduling_mode_spec.rbnew file mode 100644index 00000000000..70ac9382bb8--- /dev/null+++ b/spec/features/work_packages/scheduling/toggle_scheduling_mode_spec.rb@@ -0,0 +1,67 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2020 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-2017 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'+require 'features/page_objects/notification'+require 'features/work_packages/details/inplace_editor/shared_examples'+require 'features/work_packages/shared_contexts'+require 'support/edit_fields/edit_field'+require 'features/work_packages/work_packages_page'++describe 'toggle scheduling mode',+ js: true do+ let(:project) { FactoryBot.create :project_with_types, public: true }+ let(:work_package) { FactoryBot.create :work_package, project: project, start_date: '2016-01-01' }+ let(:user) { FactoryBot.create :admin }+ let(:work_packages_page) { Pages::FullWorkPackage.new(work_package, project) }++ let(:start_date) { work_packages_page.edit_field(:startDate) }++ before do+ login_as(user)++ work_packages_page.visit!+ work_packages_page.ensure_page_loaded+ end++ it 'can toggle the scheduling mode through the date modal' do+ expect(work_package.schedule_manually).to eq false+ start_date.activate!+ start_date.expect_active!++ start_date.expect_scheduling_mode manually: false+ start_date.toggle_scheduling_mode+ start_date.expect_scheduling_mode manually: true++ start_date.save!+ work_packages_page.expect_and_dismiss_notification message: 'Successful update.'++ work_package.reload+ expect(work_package.schedule_manually).to eq true+ end+enddiff --git a/spec/features/work_packages/table/milestones_spec.rb b/spec/features/work_packages/table/milestones_spec.rbindex c3a027ed5c9..4ca43c0d041 100644--- a/spec/features/work_packages/table/milestones_spec.rb+++ b/spec/features/work_packages/table/milestones_spec.rb@@ -37,11 +37,9 @@ describe 'Inline editing milestones', js: true do# Open start datestart_date.activate!start_date.expect_active!- due_date.expect_inactive!- # Open second date, closese first+ # Open second date, closes firstdue_date.activate!- start_date.expect_inactive!due_date.expect_active!# Close with escapediff --git a/spec/support/browsers/chrome.rb b/spec/support/browsers/chrome.rbindex 398d59e02e3..58bcb4a6834 100644--- a/spec/support/browsers/chrome.rb+++ b/spec/support/browsers/chrome.rb@@ -21,8 +21,6 @@ def register_chrome_headless(language, name: :"chrome_headless_#{language}")options.add_argument('--disable-gpu')end- options.add_argument("--remote-debugging-port=9222")-options.add_argument('--no-sandbox')options.add_argument('--disable-gpu')options.add_argument('--disable-popup-blocking')diff --git a/spec/support/components/datepicker/datepicker.rb b/spec/support/components/datepicker/datepicker.rbnew file mode 100644index 00000000000..7533107a58d--- /dev/null+++ b/spec/support/components/datepicker/datepicker.rb@@ -0,0 +1,89 @@+module Components+ class Datepicker+ include Capybara::DSL+ include RSpec::Matchers+ attr_reader :context_selector++ def initialize(context = 'body')+ @context_selector = context+ end++ def container+ page.find("#{context_selector} .flatpickr-calendar")+ end++ ##+ # Select year from input+ def select_year(value)+ container+ .find('.numInput.cur-year')+ .set value+ end++ ##+ # Select month from select+ def select_month(value)+ container+ .find('.flatpickr-monthDropdown-months option', text: value, visible: :all)+ .select_option+ end++ ##+ # Select day from datepicker+ def select_day(value)+ unless (1..31).cover?(value.to_i)+ raise ArgumentError, "Invalid value #{value} for day, expected 1-31"+ end++ container+ .find('.flatpickr-days .flatpickr-day:not(.nextMonthDay):not(.prevMonthDay)',+ text: value,+ exact_text: true)+ .click+ end++ ##+ # Set a ISO8601 date through the datepicker+ def set_date(date)+ date = Date.parse(date) unless date.is_a?(Date)++ select_year date.year+ select_month date.strftime('%B')+ select_day date.day+ end++ ##+ # Expect the selected month+ def expect_month(month)+ month = Date::MONTHNAMES.index(month) if month.is_a?(String)++ # Month is 0-index in select+ field = container.find('.flatpickr-monthDropdown-months')+ expect(field.value.to_i).to eq(month - 1)+ end++ ##+ # Expect the selected day+ def expect_day(value)+ expect(container).to have_selector('.flatpickr-day.selected', text: value)+ end++ ##+ # Expect the selected year+ def expect_year(value)+ field = container.find('.cur-year')+ expect(field.value.to_i).to eq(value.to_i)+ end++ ##+ # Expect the current selection to match the+ # given ISO601 date+ def expect_current_date(date)+ date = Date.parse(date) unless date.is_a?(Date)++ expect_year(date.year)+ expect_month(date.month)+ expect_day(date.day)+ end+ end+enddiff --git a/spec/support/edit_fields/date_edit_field.rb b/spec/support/edit_fields/date_edit_field.rbnew file mode 100644index 00000000000..a0da4b529c8--- /dev/null+++ b/spec/support/edit_fields/date_edit_field.rb@@ -0,0 +1,120 @@+require_relative './edit_field'++class DateEditField < EditField+ attr_accessor :milestone++ def initialize(context,+ property_name,+ selector: nil,+ is_milestone: false)++ super(context, property_name, selector: selector)+ self.milestone = is_milestone+ end++ def datepicker+ @datepicker ||= ::Components::Datepicker.new modal_selector+ end++ def modal_selector+ "#wp-datepicker-#{property_name}"+ end++ def input_selector+ "input[name=#{property_name}]"+ end++ def property_name+ if milestone+ 'date'+ else+ super+ end+ end++ def expect_scheduling_mode(manually:)+ within_modal do+ expect(page).to have_field('scheduling', checked: manually)+ end+ end++ def toggle_scheduling_mode+ within_modal do+ find('.datepicker-modal--scheduling-action').click+ end+ end++ def modal_element+ page.find(modal_selector)+ end++ def within_modal(&block)+ page.within(modal_selector, &block)+ end++ def input_element+ modal_element.find(input_selector)+ end++ def active?+ page.has_selector?("#{modal_selector} #{input_selector}", wait: 1)+ end++ def expect_active!+ expect(page)+ .to have_selector("#{modal_selector} #{input_selector}", wait: 10),+ "Expected date field '#{property_name}' to be active."+ end++ def expect_inactive!+ expect(context).to have_selector(display_selector, wait: 10)+ expect(page).to have_no_selector("#{modal_selector} #{input_selector}")+ end++ def update(value, save: true, expect_failure: false)+ # Retry to set attributes due to reloading the page after setting+ # an attribute, which may cause an input not to open properly.+ retry_block do+ activate_edition+ within_modal do+ if value.is_a?(Array)+ value.each {|el| select_value(el)}+ else+ select_value value+ end+ end++ save! if save+ expect_state! open: expect_failure+ end+ end++ def expect_value(value)+ expect+ expect(input_element.text).to eq(value)+ end++ def select_value(value)+ datepicker.set_date value+ end++ def save!+ submit_by_click+ end++ def submit_by_click+ scroll_to_and_click action_button('Save')+ end++ def cancel_by_click+ scroll_to_and_click action_button('Cancel')+ end++ def clear_changes+ scroll_to_and_click action_button('Clear all')+ end++ def action_button(text)+ page.find("#{modal_selector} .datepicker-modal--action", text: text)+ end+enddiff --git a/spec/support/edit_fields/edit_field.rb b/spec/support/edit_fields/edit_field.rbindex 31e8e9e14bd..7705f942f84 100644--- a/spec/support/edit_fields/edit_field.rb+++ b/spec/support/edit_fields/edit_field.rb@@ -69,7 +69,7 @@ class EditFieldendif expect_open && !active?- raise "Expected field input type '#{field_type}' for attribute '#{property_name}'."+ raise "Expected field for attribute '#{property_name}' to be active."endendenddiff --git a/spec/support/pages/page.rb b/spec/support/pages/page.rbindex 67067f87ede..d4f30f39691 100644--- a/spec/support/pages/page.rb+++ b/spec/support/pages/page.rb@@ -108,7 +108,11 @@ module Pagesenddef expect_no_notification(type: :success, message: nil)- expect(page).to have_no_selector(".notification-box.-#{type}", text: message)+ if type.nil?+ expect(page).to have_no_selector(".notification-box")+ else+ expect(page).to have_no_selector(".notification-box.-#{type}", text: message)+ endenddef pathdiff --git a/spec/support/pages/work_packages/abstract_work_package.rb b/spec/support/pages/work_packages/abstract_work_package.rbindex 6096cafe07b..4ff0f7d7733 100644--- a/spec/support/pages/work_packages/abstract_work_package.rb+++ b/spec/support/pages/work_packages/abstract_work_package.rb@@ -189,23 +189,30 @@ module Pagesenddef work_package_field(key)- if key =~ /customField(\d+)$/- cf = CustomField.find $1-- if cf.field_format == 'text'- TextEditorField.new container, key- else- EditField.new container, key- end- elsif key == :description+ case key+ when /customField(\d+)$/+ work_package_custom_field(key, $1)+ when :date, :startDate, :dueDate+ DateEditField.new container, key, is_milestone: work_package.milestone?+ when :descriptionTextEditorField.new container, key- elsif key == :status+ when :statusWorkPackageStatusField.new containerelseEditField.new container, keyendend+ def work_package_custom_field(key, id)+ cf = CustomField.find id++ if cf.field_format == 'text'+ TextEditorField.new container, key+ else+ EditField.new container, key+ end+ end+def add_childvisit_tab!('relations')diff --git a/spec/support/pages/work_packages/abstract_work_package_create.rb b/spec/support/pages/work_packages/abstract_work_package_create.rbindex 07700e46c4d..6952d16ceb1 100644--- a/spec/support/pages/work_packages/abstract_work_package_create.rb+++ b/spec/support/pages/work_packages/abstract_work_package_create.rb@@ -65,5 +65,9 @@ module Pagesdef save!scroll_to_and_click find('.button', text: I18n.t('js.button_save'))end++ def cancel!+ scroll_to_and_click find('.button', text: I18n.t('js.button_cancel'))+ endendenddiff --git a/spec/support/pages/work_packages/work_packages_table.rb b/spec/support/pages/work_packages/work_packages_table.rbindex aecafd165c2..b735c42527c 100644--- a/spec/support/pages/work_packages/work_packages_table.rb+++ b/spec/support/pages/work_packages/work_packages_table.rb@@ -236,7 +236,7 @@ module Pagesrow(work_package)end- ::EditField.new(context, attribute)+ work_package_field(work_package, context, attribute)enddef click_setting_item(label)@@ -273,6 +273,15 @@ module Pagespageend+ def work_package_field(work_package, context, key)+ case key.to_sym+ when :date, :startDate, :dueDate+ DateEditField.new context, key, is_milestone: work_package.milestone?+ else+ EditField.new context, key+ end+ end+privatedef path