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

Remove attempts on creating the frontend (not needed for now)

Klaus Zanders0d8f38a498bc
diff --git a/frontend/src/global_styles/content/_index.sass b/frontend/src/global_styles/content/_index.sass
index f6461890e47..5497c4a6765 100644
--- a/frontend/src/global_styles/content/_index.sass
+++ b/frontend/src/global_styles/content/_index.sass
@@ -76,7 +76,6 @@
@import sidebar
@import activity_list
@import activity_days
-@import meetings
@import menus/menu_blocks
@import editor/index
diff --git a/frontend/src/global_styles/content/_meetings.sass b/frontend/src/global_styles/content/_meetings.sass
deleted file mode 100644
index c24bf37fc25..00000000000
--- a/frontend/src/global_styles/content/_meetings.sass
+++ /dev/null
@@ -1,71 +0,0 @@
-//-- 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.
-//++
-
-form.meeting-filters
- display: none
- &.-expanded
- display: block
- .advanced-filters--filter-value
- // visibility based on operator type
- &.hidden
- visibility: hidden
- height: 55px
-
- // visibility for list value selectors
- .multi-select
- display: none
- .single-select
- display: block
- &.multi-value
- .multi-select
- display: block
- .single-select
- display: none
-
- // visibility for datetime_past value selectors
- &.between-dates
- >.on-date,
- >.days
- display: none
- &.on-date
- >.between-dates,
- >.days
- display: none
- &.days
- >.on-date,
- >.between-dates
- display: none
-
- // Special input field styles
- &.between-dates
- input[type="text"]
- display: inline-block
- max-width: 6rem
-
- .advanced-filters--controls
- margin-top: 1rem
diff --git a/frontend/src/stimulus/controllers/dynamic/meeting.controller.ts b/frontend/src/stimulus/controllers/dynamic/meeting.controller.ts
deleted file mode 100644
index e16bb4f3346..00000000000
--- a/frontend/src/stimulus/controllers/dynamic/meeting.controller.ts
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * -- copyright
- * OpenProject is an open source project management software.
- * Copyright (C) 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 { Controller } from '@hotwired/stimulus';
-
-export default class MeetingController extends Controller {
- static targets = [
- 'filterFormToggle',
- 'filterForm',
- 'filter',
- 'addFilterSelect',
- 'spacer',
- 'descriptionToggle',
- 'projectRow',
- 'descriptionRow',
- 'operator',
- 'filterValueContainer',
- 'filterValueSelect',
- 'days',
- 'singleDay',
- 'simpleValue',
- ];
-
- declare readonly filterFormToggleTarget:HTMLButtonElement;
- declare readonly filterFormTarget:HTMLFormElement;
- declare readonly filterTargets:HTMLElement[];
- declare readonly addFilterSelectTarget:HTMLSelectElement;
- declare readonly spacerTarget:HTMLElement;
- declare readonly descriptionToggleTargets:HTMLAnchorElement[];
- declare readonly projectRowTargets:HTMLTableRowElement[];
- declare readonly descriptionRowTargets:HTMLTableRowElement[];
- declare readonly operatorTargets:HTMLSelectElement[];
- declare readonly filterValueContainerTargets:HTMLElement[];
- declare readonly filterValueSelectTargets:HTMLSelectElement[];
- declare readonly daysTargets:HTMLInputElement[];
- declare readonly singleDayTargets:HTMLInputElement[];
- declare readonly simpleValueTargets:HTMLInputElement[];
-
- toggleFilterForm() {
- this.filterFormToggleTarget.classList.toggle('-active');
- this.filterFormTarget.classList.toggle('-expanded');
- }
- /*
- toggleMultiSelect({ params: { filterName } }: { params: { filterName: string } }) {
- const valueContainer = this.filterValueContainerTargets.find((filterValueContainer) => filterValueContainer.getAttribute('data-filter-name') === filterName);
- const singleSelect = this.filterValueSelectTargets.find((selectField) => !selectField.multiple && selectField.getAttribute('data-filter-name') === filterName);
- const multiSelect = this.filterValueSelectTargets.find((selectField) => selectField.multiple && selectField.getAttribute('data-filter-name') === filterName);
- if (valueContainer && singleSelect && multiSelect) {
- if (valueContainer.classList.contains('multi-value')) {
- const valueToSelect = this.getValueToSelect(multiSelect);
- this.setSelectOptions(singleSelect, valueToSelect);
- } else {
- const valueToSelect = this.getValueToSelect(singleSelect);
- this.setSelectOptions(multiSelect, valueToSelect);
- }
-
- valueContainer.classList.toggle('multi-value');
- }
- }
-
- private getValueToSelect(selectElement: HTMLSelectElement) {
- return selectElement.selectedOptions[0]?.value;
- }
-
- private setSelectOptions(selectElement: HTMLSelectElement, selectedValue: string) {
- Array.from(selectElement.options).forEach((option) => {
- option.selected = option.value === selectedValue;
- });
- }
-
- addFilter(event: Event) {
- const selectedFilterName = (event.target as HTMLSelectElement).value;
- const selectedFilter = this.filterTargets.find((filter) => filter.getAttribute('filter-name') === selectedFilterName);
-
- if (selectedFilter) {
- selectedFilter.classList.remove('hidden');
- }
-
- this.disableSelection();
- this.reselectPlaceholderOption();
- this.setSpacerVisibility();
- }
-
- private disableSelection() {
- this.addFilterSelectTarget.selectedOptions[0].setAttribute('disabled', 'disabled');
- }
-
- private reselectPlaceholderOption() {
- this.addFilterSelectTarget.options[0].setAttribute('selected', 'selected');
- }
-
- removeFilter({ params: { filterName } }: { params: { filterName: string } }) {
- const filterToRemove = this.filterTargets.find((filter) => filter.getAttribute('filter-name') === filterName);
- filterToRemove?.classList.add('hidden');
-
- const selectOptions = Array.from(this.addFilterSelectTarget.options);
- const removedFilterOption = selectOptions.find((option) => option.value === filterName);
- removedFilterOption?.removeAttribute('disabled');
-
- this.setSpacerVisibility();
- }
-
- private setSpacerVisibility() {
- if (this.anyFiltersStillVisible()) {
- this.spacerTarget.classList.remove('hidden');
- } else {
- this.spacerTarget.classList.add('hidden');
- }
- }
-
- private anyFiltersStillVisible() {
- return this.filterTargets.some((filter) => !filter.classList.contains('hidden'));
- }
-
- private readonly noValueOperators = ['*', '!*', 't', 'w'];
- private readonly daysOperators = ['>t-', '<t-', 't-', '<t+', '>t+', 't+'];
- private readonly onDateOperator = '=d';
- private readonly betweenDatesOperator = '<>d';
-
- setValueVisibility({ target, params: { filterName } }: { target: HTMLSelectElement, params: { filterName: string } }) {
- const selectedOperator = target.value;
- const valueContainer = this.filterValueContainerTargets.find((filterValueContainer) => filterValueContainer.getAttribute('data-filter-name') === filterName);
- if (valueContainer) {
- if (this.noValueOperators.includes(selectedOperator)) {
- valueContainer.classList.add('hidden');
- } else {
- valueContainer.classList.remove('hidden');
- }
-
- if (this.daysOperators.includes(selectedOperator)) {
- valueContainer.classList.add('days');
- valueContainer.classList.remove('on-date');
- valueContainer.classList.remove('between-dates');
- } else if (selectedOperator === this.onDateOperator) {
- valueContainer.classList.add('on-date');
- valueContainer.classList.remove('days');
- valueContainer.classList.remove('between-dates');
- } else if (selectedOperator === this.betweenDatesOperator) {
- valueContainer.classList.add('between-dates');
- valueContainer.classList.remove('days');
- valueContainer.classList.remove('on-date');
- }
- }
- }
-
- toggleDescription({ target, params: { projectId } }: { target: HTMLAnchorElement, params: { projectId: number } }) {
- const toggledTrigger = target;
- const otherTrigger = this.descriptionToggleTargets.find((trigger) => trigger !== toggledTrigger);
- // The projectId action parameter is automatically typecast to Number
- // and to compare it with a data attribute it needs to be converted to
- // a string.
- const clickedProjectRow = this.projectRowTargets.find((projectRow) => projectRow.getAttribute('data-project-id') === projectId.toString());
- const projectDescriptionRow = this.descriptionRowTargets.find((descriptionRow) => descriptionRow.getAttribute('data-project-id') === projectId.toString());
-
- if (clickedProjectRow && projectDescriptionRow) {
- clickedProjectRow.classList.toggle('-no-highlighting');
- clickedProjectRow.classList.toggle('-expanded');
- projectDescriptionRow.classList.toggle('-expanded');
-
- this.setAriaLive(projectDescriptionRow);
- }
-
- if (otherTrigger) {
- otherTrigger.focus();
- }
- }
-
- private setAriaLive(descriptionRow: HTMLElement) {
- if (descriptionRow.classList.contains('-expanded')) {
- descriptionRow.setAttribute('aria-live', 'polite');
- } else {
- descriptionRow.removeAttribute('aria-live');
- }
- }
-
- sendForm() {
- const ajaxIndicator = document.querySelector('#ajax-indicator') as HTMLElement;
- ajaxIndicator.style.display = '';
-
- const filters = this.parseFilters();
- const orderParam = this.getUrlParameter('sortBy');
- let queryString = `?filters=${encodeURIComponent(JSON.stringify(filters))}`;
- if (orderParam) {
- queryString = `${queryString}&sortBy=${encodeURIComponent(orderParam)}`;
- }
-
- window.location.href = window.location.pathname + queryString;
- }
-
- private parseFilters() {
- const advancedFilters = this.filterTargets.filter((filter) => !filter.classList.contains('hidden'));
- const filters: Filter[] = [];
-
- advancedFilters.forEach((filter) => {
- const filterName = filter.getAttribute('filter-name');
- const filterType = filter.getAttribute('filter-type');
- const parsedOperator = this.operatorTargets.find((operator) => operator.getAttribute('data-filter-name') === filterName)?.value;
-
- if (filterName && filterType && parsedOperator) {
- const parsedValue = this.parseFilterValue(filterName, filterType, parsedOperator);
-
- if (parsedValue) {
- const currentFilter: Filter = {
- [filterName]: { operator: parsedOperator, values: parsedValue as string[] },
- };
- filters.push(currentFilter);
- }
- }
- });
-
- return filters;
- }
-
- private readonly operatorsWithoutValues = ['*', '!*', 't', 'w'];
- private readonly selectFilterTypes = ['list', 'list_all', 'list_optional'];
- private readonly dateFilterTypes = ['datetime_past', 'date'];
-
- private parseFilterValue(filterName: string, filterType: string, operator: string) {
- const valueContainer = this.filterValueContainerTargets.find((filterValueContainer) => filterValueContainer.getAttribute('data-filter-name') === filterName);
-
- if (valueContainer) {
- const checkbox = valueContainer.querySelector('input[type="checkbox"]') as HTMLInputElement;
-
- if (checkbox) {
- return [checkbox.checked ? 't' : 'f'];
- }
-
- if (this.operatorsWithoutValues.includes(operator)) {
- return [];
- }
-
- if (this.selectFilterTypes.includes(filterType)) {
- return this.parseSelectFilterValue(valueContainer, filterName);
- }
-
- if (this.dateFilterTypes.includes(filterType)) {
- return this.parseDateFilterValue(valueContainer, filterName);
- }
-
- const value = this.simpleValueTargets.find((simpleValueInput) => simpleValueInput.getAttribute('data-filter-name') === filterName)?.value;
-
- if (value && value.length > 0) {
- return [value];
- }
- }
-
- return null;
- }
-
- private parseSelectFilterValue(valueContainer: HTMLElement, filterName: string) {
- let selectFields;
-
- if (valueContainer.classList.contains('multi-value')) {
- selectFields = this.filterValueSelectTargets.filter((selectField) => selectField.multiple && selectField.getAttribute('data-filter-name') === filterName);
- } else {
- selectFields = this.filterValueSelectTargets.filter((selectField) => !selectField.multiple && selectField.getAttribute('data-filter-name') === filterName);
- }
-
- const selectedValues = _.flatten(Array.from(selectFields).map((selectField) => Array.from(selectField.selectedOptions).map((option) => option.value)));
-
- if (selectedValues.length > 0) {
- return selectedValues;
- }
-
- return null;
- }
-
- private parseDateFilterValue(valueContainer: HTMLElement, filterName: string) {
- let value;
-
- if (valueContainer.classList.contains('days')) {
- const dateValue = this.daysTargets.find((daysField) => daysField.getAttribute('data-filter-name') === filterName)?.value;
-
- value = _.without([dateValue], '');
- } else if (valueContainer.classList.contains('on-date')) {
- const dateValue = this.singleDayTargets.find((dateInput) => dateInput.id === `on-date-value-${filterName}`)?.value;
-
- value = _.without([dateValue], '');
- } else if (valueContainer.classList.contains('between-dates')) {
- const fromValue = this.singleDayTargets.find((dateInput) => dateInput.id === `between-dates-from-value-${filterName}`)?.value;
- const toValue = this.singleDayTargets.find((dateInput) => dateInput.id === `between-dates-to-value-${filterName}`)?.value;
-
- value = [fromValue, toValue];
- }
-
- if (value && value.length > 0) {
- return value;
- }
-
- return null;
- }
-
- private getUrlParameter(sortParam: string) {
- const queryString = decodeURIComponent(window.location.search.substring(1));
- const queryParams = queryString.split('&');
-
- for (let i = 0; i < queryParams.length; i++) {
- const [key, value] = queryParams[i].split('=');
-
- if (key === sortParam) {
- return value || true;
- }
- }
-
- return null;
- }
- */
-}
diff --git a/modules/meeting/app/views/meetings/filters/_form.html.erb b/modules/meeting/app/views/meetings/filters/_form.html.erb
deleted file mode 100644
index 9bf31b5e48e..00000000000
--- a/modules/meeting/app/views/meetings/filters/_form.html.erb
+++ /dev/null
@@ -1,27 +0,0 @@
-<%= form_tag({},
- method: :get,
- class: "meeting-filters #{filter_set? ? '-expanded' : ''}",
- data: {
- 'meeting-target': 'filterForm',
- action: 'submit->meeting#sendForm:prevent'
- }) do %>
- <% operators_without_values = %w[* !* t w] %>
- <fieldset class="advanced-filters--container">
- <a title="<%= t('js.close_form_title') %>"
- class="advanced-filters--close icon-context icon-close"
- data-action="meeting#toggleFilterForm"></a>
- <legend><%= t(:label_filter_plural) %></legend>
- <ul class="advanced-filters--filters">
- <% allowed_filters(query).each do |filter| %>
- <% filter_active = query.find_active_filter(filter.name).present? %>
- <% filter_boolean = filter.is_a?(Queries::Filters::Shared::BooleanFilter) %>
- <li>
- <pre><%= filter %></pre>
- </li>
- <% end %>
- <li class="advanced-filters--controls">
- <%= submit_tag t('button_apply'), class: 'button -small -highlight', name: nil %>
- </li>
- </ul>
- </fieldset>
-<% end %>
diff --git a/modules/meeting/app/views/meetings/index.html.erb b/modules/meeting/app/views/meetings/index.html.erb
index c7bf4ed12dd..695d5574378 100644
--- a/modules/meeting/app/views/meetings/index.html.erb
+++ b/modules/meeting/app/views/meetings/index.html.erb
@@ -27,34 +27,22 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title t(:label_meeting_plural) %>
-<div data-controller="meeting"
- data-application-target="dynamic">
- <%= toolbar title: t(:label_meeting_plural) do %>
- <% if authorize_for(:meetings, :new) %>
- <li class="toolbar-item">
- <a href="<%= new_meeting_path %>"
+<%= toolbar title: t(:label_meeting_plural) do %>
+ <% if authorize_for(:meetings, :new) %>
+ <li class="toolbar-item">
+ <a href="<%= new_meeting_path %>"
id="add-meeting-button"
title="<%= I18n.t(:label_meeting_new) %>"
arial-label="<%= I18n.t(:label_meeting_new) %>"
class="button -alt-highlight">
- <%= op_icon('button--icon icon-add') %>
- <span class="button--text"><%= t(:label_meeting) %></span>
- </a>
- </li>
- <% end %>
- <li class="toolbar-item">
- <button title="<%= t(:label_filters_toggle) %>"
- class="button toolbar-icon <%= filter_set? ? '-active' : '' %>"
- data-meeting-target="filterFormToggle"
- data-action="meeting#toggleFilterForm">
- <%= op_icon("icon-filter button--icon") %>
- </button>
+ <%= op_icon('button--icon icon-add') %>
+ <span class="button--text"><%= t(:label_meeting) %></span>
+ </a>
</li>
<% end %>
- <% if @meetings.empty? -%>
- <%= no_results_box %>
- <% else -%>
- <%= render partial: 'meetings/filters/form', locals: { query: @query } %>
- <%= render Meetings::TableComponent.new(rows: @meetings, current_project: @project) %>
- <% end -%>
-</div>
+<% end %>
+<% if @meetings.empty? -%>
+ <%= no_results_box %>
+<% else -%>
+ <%= render Meetings::TableComponent.new(rows: @meetings, current_project: @project) %>
+<% end -%>