Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

show changes drop modal component

bsatarnejad0b7dfa2ce5a5
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index 7a706e5f703..001b3c0c46e 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -1340,7 +1340,11 @@ en:
current_project: 'This is the current project you are in.'
does_not_match_search: 'Project does not match the search criteria.'
no_results: 'No project matches your search criteria.'
-
+ show_changes:
+ toggle_title: 'Changes'
+ clear: 'Clear'
+ apply: 'Apply'
+ header_description: 'View changes made to work packages in the current view within a time period.'
forms:
submit_success_message: 'The form was successfully submitted'
load_error_message: 'There was an error loading the form'
diff --git a/frontend/src/app/shared/components/show-changes/show-changes.component.html b/frontend/src/app/shared/components/show-changes/show-changes.component.html
new file mode 100644
index 00000000000..fdf729ba668
--- /dev/null
+++ b/frontend/src/app/shared/components/show-changes/show-changes.component.html
@@ -0,0 +1,49 @@
+<spot-drop-modal
+ [opened]="opened"
+ alignment="bottom-right"
+ (closed)="opened = false"
+ class="op-show-changes-modal"
+>
+ <button
+ slot="trigger"
+ type="button"
+ class="button"
+ (click)="toggleOpen()"
+ [title]="text.toggle_title"
+ data-qa-selector="show-changes-button"
+ >
+ <span class="spot-icon spot-icon_baseline"></span>
+ {{ text.toggle_title }}
+
+ <span class="spot-icon spot-icon_pulldown"></span>
+ </button>
+
+ <ng-container slot="body">
+ <div class="op-show-changes-modal--header">
+ <span class="op-show-changes-modal--description spot-body-small">{{ text.header_description }}</span>
+ </div>
+ <form
+ (submit)="onSubmit($event)"
+ class="spot-container op-show-changes-modal--body"
+ >
+ <div class="spot-action-bar">
+
+ <div class="spot-action-bar--right">
+ <button
+ class="button spot-action-bar--action"
+ type="button"
+ (click)="clearSelection()"
+ >
+ {{ text.clear }}
+ </button>
+ <button
+ class="button -highlight spot-action-bar--action"
+ >
+ {{ text.apply }}
+ </button>
+ </div>
+ </div>
+ </form>
+ </ng-container>
+
+</spot-drop-modal>
diff --git a/frontend/src/app/shared/components/show-changes/show-changes.component.sass b/frontend/src/app/shared/components/show-changes/show-changes.component.sass
new file mode 100644
index 00000000000..75b88894a55
--- /dev/null
+++ b/frontend/src/app/shared/components/show-changes/show-changes.component.sass
@@ -0,0 +1,20 @@
+@import '../../../spot/styles/sass/variables'
+
+.op-show-changes-modal
+
+ &--header
+ display: flex
+ justify-content: space-between
+ align-items: center
+ margin: $spot-spacing-1 $spot-spacing-1 0 $spot-spacing-1
+ width: 265px
+ color: $spot-color-basic-gray-2
+
+ &--body
+ flex-shrink: 1
+ flex-basis: 100%
+ overflow: hidden
+
+ @media screen and #{$spot-mq-drop-modal-in-context}
+ width: 300px
+ max-height: 70vh
diff --git a/frontend/src/app/shared/components/show-changes/show-changes.component.ts b/frontend/src/app/shared/components/show-changes/show-changes.component.ts
new file mode 100644
index 00000000000..32ad54b7209
--- /dev/null
+++ b/frontend/src/app/shared/components/show-changes/show-changes.component.ts
@@ -0,0 +1,84 @@
+// -- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2023 the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See COPYRIGHT and LICENSE files for more details.
+//++
+
+import {
+ ChangeDetectionStrategy,
+ Component,
+ HostBinding,
+} from '@angular/core';
+
+import { I18nService } from 'core-app/core/i18n/i18n.service';
+import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
+import { WorkPackageViewFiltersService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service';
+import { HalResourceService } from 'core-app/features/hal/services/hal-resource.service';
+
+@Component({
+ selector: 'op-show-changes',
+ changeDetection: ChangeDetectionStrategy.OnPush,
+ templateUrl: './show-changes.component.html',
+ styleUrls: ['./show-changes.component.sass'],
+})
+export class OpShowChangesComponent extends UntilDestroyedMixin {
+ @HostBinding('class.op-show-changes') className = true;
+
+ public text = {
+ toggle_title: this.I18n.t('js.show_changes.toggle_title'),
+ header_description: this.I18n.t('js.show_changes.header_description'),
+ clear: this.I18n.t('js.show_changes.clear'),
+ apply: this.I18n.t('js.show_changes.apply'),
+ };
+
+ public opened = false;
+
+ public query$ = this.wpTableFilters.querySpace.query.values$();
+
+ constructor(
+ readonly I18n:I18nService,
+ readonly wpTableFilters:WorkPackageViewFiltersService,
+ readonly halResourceService:HalResourceService,
+ ) {
+ super();
+ }
+
+ public toggleOpen():void {
+ this.opened = !this.opened;
+ }
+
+ public clearSelection():void {
+ }
+
+ public onSubmit(e:Event):void {
+ e.preventDefault();
+
+ this.close();
+ }
+
+ public close():void {
+ this.opened = false;
+ }
+}