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
Add meeting autocompleter
Mir Bhatiaf7b6ba241a30
diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.tsindex 262bb763e71..76bc3461a30 100644--- a/frontend/src/app/app.module.ts+++ b/frontend/src/app/app.module.ts@@ -124,6 +124,9 @@ import {import {UserAutocompleterComponent,} from 'core-app/shared/components/autocompleter/user-autocompleter/user-autocompleter.component';+import {+ MeetingAutocompleterComponent,+} from 'core-app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter.component';import { AttributeValueMacroComponent } from 'core-app/shared/components/fields/macros/attribute-value-macro.component';import { AttributeLabelMacroComponent } from 'core-app/shared/components/fields/macros/attribute-label-macro.component';import {@@ -382,6 +385,7 @@ export class OpenProjectModule implements DoBootstrap {registerCustomElement('opce-project-autocompleter', ProjectAutocompleterComponent, { injector });registerCustomElement('opce-members-autocompleter', MembersAutocompleterComponent, { injector });registerCustomElement('opce-user-autocompleter', UserAutocompleterComponent, { injector });+ registerCustomElement('opce-meeting-autocompleter', MeetingAutocompleterComponent, { injector });registerCustomElement('opce-time-entries-work-package-autocompleter', TimeEntriesWorkPackageAutocompleterComponent, { injector });registerCustomElement('opce-macro-attribute-value', AttributeValueMacroComponent, { injector });registerCustomElement('opce-macro-attribute-label', AttributeLabelMacroComponent, { injector });diff --git a/frontend/src/app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter-template.component.html b/frontend/src/app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter-template.component.htmlnew file mode 100644index 00000000000..f6fbc2624eb--- /dev/null+++ b/frontend/src/app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter-template.component.html@@ -0,0 +1,4 @@+<ng-template #optionTemplate let-item>+ <div>{{ item.label }}</div>+ <div>ID: {{ item.value }}</div>+</ng-template>diff --git a/frontend/src/app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter-template.component.ts b/frontend/src/app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter-template.component.tsnew file mode 100644index 00000000000..ae5cdf8ede4--- /dev/null+++ b/frontend/src/app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter-template.component.ts@@ -0,0 +1,42 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 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, TemplateRef, ViewChild } from '@angular/core';+import {+ IAutocompleterTemplateComponent,+} from 'core-app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component';++@Component({+ templateUrl: './meeting-autocompleter-template.component.html',+ changeDetection: ChangeDetectionStrategy.OnPush,+ standalone: false,+})+export class MeetingAutocompleterTemplateComponent implements IAutocompleterTemplateComponent {+ // @ViewChild('labelTemplate') labelTemplate?:TemplateRef<Element>;+ @ViewChild('optionTemplate') optionTemplate:TemplateRef<Element>;+}diff --git a/frontend/src/app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter.component.ts b/frontend/src/app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter.component.tsnew file mode 100644index 00000000000..f43fbf89547--- /dev/null+++ b/frontend/src/app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter.component.ts@@ -0,0 +1,60 @@+//-- copyright+// OpenProject is an open source project management software.+// Copyright (C) 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 {+ Component,+ ChangeDetectionStrategy,+ OnInit,+} from '@angular/core';+import { ID } from '@datorama/akita';+import { OpAutocompleterComponent } from 'core-app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component';+import { MeetingAutocompleterTemplateComponent } from 'core-app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter-template.component';++export const meetingsAutocompleterSelector = 'op-meeting-autocompleter';++export interface IMeetingAutocompleteItem {+ id:ID;+ name:string;+ email?:string|null;+ href:string|null;+ avatar?:string|null;+}++@Component({+ templateUrl: '../op-autocompleter/op-autocompleter.component.html',+ selector: meetingsAutocompleterSelector,+ changeDetection: ChangeDetectionStrategy.OnPush,+ standalone: false,+})+export class MeetingAutocompleterComponent extends OpAutocompleterComponent<IMeetingAutocompleteItem> implements OnInit {+ ngOnInit():void {+ super.ngOnInit();++ this.applyTemplates(MeetingAutocompleterTemplateComponent);+ }+}diff --git a/frontend/src/app/shared/components/autocompleter/openproject-autocompleter.module.ts b/frontend/src/app/shared/components/autocompleter/openproject-autocompleter.module.tsindex 70c4254f351..c447052575c 100644--- a/frontend/src/app/shared/components/autocompleter/openproject-autocompleter.module.ts+++ b/frontend/src/app/shared/components/autocompleter/openproject-autocompleter.module.ts@@ -21,6 +21,9 @@ import {import {UserAutocompleterComponent,} from 'core-app/shared/components/autocompleter/user-autocompleter/user-autocompleter.component';+import {+ MeetingAutocompleterComponent,+} from 'core-app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter.component';import {ProjectAutocompleterComponent,} from 'core-app/shared/components/autocompleter/project-autocompleter/project-autocompleter.component';@@ -46,6 +49,9 @@ import { OpSearchHighlightDirective } from 'core-app/shared/directives/search-hiimport {UserAutocompleterTemplateComponent,} from 'core-app/shared/components/autocompleter/user-autocompleter/user-autocompleter-template.component';+import {+ MeetingAutocompleterTemplateComponent,+} from 'core-app/shared/components/autocompleter/meeting-autocompleter/meeting-autocompleter-template.component';import {ProjectAutocompleterTemplateComponent,} from 'core-app/shared/components/autocompleter/project-autocompleter/project-autocompleter-template.component';@@ -64,6 +70,8 @@ export const OPENPROJECT_AUTOCOMPLETE_COMPONENTS = [DraggableAutocompleteComponent,UserAutocompleterComponent,UserAutocompleterTemplateComponent,+ MeetingAutocompleterTemplateComponent,+ MeetingAutocompleterComponent,ProjectAutocompleterComponent,ProjectAutocompleterTemplateComponent,ProjectPhaseAutocompleterComponent,diff --git a/modules/meeting/app/forms/meeting_agenda_item/meeting_form.rb b/modules/meeting/app/forms/meeting_agenda_item/meeting_form.rbindex ee38c69cdd1..efb26304e5e 100644--- a/modules/meeting/app/forms/meeting_agenda_item/meeting_form.rb+++ b/modules/meeting/app/forms/meeting_agenda_item/meeting_form.rb@@ -38,6 +38,7 @@ class MeetingAgendaItem::MeetingForm < ApplicationFormlabel: I18n.t("label_meeting"),caption: I18n.t("label_meeting_selection_caption"),autocomplete_options: {+ component: "opce-meeting-autocompleter",multiple: false,decorated: true,append_to: append_to_container