Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meetings with agenda tops prototype #12953

Closed
wants to merge 73 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
5f97d91
Add lookbook example
oliverguenther May 27, 2023
907795f
Convert docs
oliverguenther May 28, 2023
c647fa3
Add preview paths to view component
oliverguenther May 28, 2023
d1a1700
Add icon component / doc and separate spot bundle
oliverguenther May 28, 2023
0b6f980
Add logo
oliverguenther May 29, 2023
00e9dca
Add tooltip component
oliverguenther May 29, 2023
9fc4dd8
Advanced filters preview
oliverguenther May 29, 2023
f9da3fd
Toolbar preview
oliverguenther May 29, 2023
148ed8a
Font examples
oliverguenther May 29, 2023
0a01a5f
Remove unneeded lsgs
oliverguenther May 29, 2023
3ba4c7e
Add widget preview
oliverguenther May 29, 2023
498b666
Add switch component
oliverguenther May 29, 2023
75c8daa
Show notes first
oliverguenther May 29, 2023
208e46b
Add some padding to previews
oliverguenther May 29, 2023
4dead41
Try to include primer into lookbook
oliverguenther May 31, 2023
79d7c72
Try to load primer css
oliverguenther Jun 19, 2023
0d79b05
Load Primer CSS from external. Basic overwrite of Primer theme CSS vars.
wielinde Jun 20, 2023
2c7984f
Remove test Primer buttons
wielinde Jun 21, 2023
04c8b81
Primer themable content background
wielinde Jun 21, 2023
c864c1c
Replace CDN styles with vendored
oliverguenther Jun 21, 2023
c0b7aae
hotwire setup following hotwire spike branche from @oliverguenther
jjabari-op Jun 21, 2023
05c4fdd
fix error made while setting up hotwire according to @oliverguenter's…
jjabari-op Jun 21, 2023
99c83e3
basic agenda_tops setup with hotwire
jjabari-op Jun 21, 2023
dc0e43f
added drag and drop
jjabari-op Jun 22, 2023
0b10f60
renamed tops to items
jjabari-op Jun 22, 2023
d3678be
refactored in order to use view_components instead of partials, proto…
jjabari-op Jun 26, 2023
f20611d
Merge branch 'lookbook-primer' into meetings_with_agenda_tops
jjabari-op Jun 26, 2023
82d0572
fixed def name
jjabari-op Jun 26, 2023
cec27f5
Add personal theme switcher behind a feature flag
wielinde Jun 26, 2023
8a9256a
Merge remote-tracking branch 'origin/dev' into lookbook-primer
oliverguenther Jun 27, 2023
ff76d56
Add personal theme switcher behind a feature flag
wielinde Jun 26, 2023
1ca5f25
Activate feature flag personal_theme_selection on PullPreview
wielinde Jun 27, 2023
5c9f0a0
Merge branch 'lookbook-primer' into meetings_with_agenda_tops
jjabari-op Jun 27, 2023
f54230f
cleanup Gemfile
jjabari-op Jun 27, 2023
b0a7c45
Fix more background color difinitions
wielinde Jun 27, 2023
01f15f5
fixing hotwire imports as turbo streams stopped working
jjabari-op Jun 27, 2023
3676819
Merge branch 'lookbook-primer' into meetings_with_agenda_tops
jjabari-op Jun 27, 2023
7cbcd1c
refactored turbo import and setup, disabling turbo drive again as it …
jjabari-op Jun 29, 2023
cbb8091
enable turbo drive per DOM element as otherwise turbo streams are not…
jjabari-op Jun 29, 2023
564ea25
Merge branch 'meetings_with_agenda_tops' of github.com:opf/openprojec…
jjabari-op Jun 29, 2023
20c742e
evaluating usage of turbo-frames in angular rendered frontend with pr…
jjabari-op Jun 30, 2023
6c69e0e
added session storage based concept on how to persist turbo-frame src…
jjabari-op Jun 30, 2023
af6f5c1
added in and output per meeting agenda item
jjabari-op Jun 30, 2023
4227bc2
make duration optional
jjabari-op Jun 30, 2023
212e928
finetuned prototype in order to get some conceptual progress on the a…
jjabari-op Jun 30, 2023
086ca90
Merge branch 'dev' into meetings_with_agenda_tops
jjabari-op Jul 3, 2023
f3a96f6
Merge branch 'dev' into meetings_with_agenda_tops
jjabari-op Jul 3, 2023
1db90f8
Merge remote-tracking branch 'origin/dev' into meetings_with_agenda_tops
oliverguenther Jul 4, 2023
12203c5
Exclude stimulus controllers from compodoc build
oliverguenther Jul 4, 2023
5c32bb6
Merge branch 'dev' into meetings_with_agenda_tops
jjabari-op Jul 11, 2023
af39cd7
refactored prototypical implementation and moved to ruby only view_co…
jjabari-op Jul 17, 2023
28b83a9
Merge branch 'meetings_with_agenda_tops' of github.com:opf/openprojec…
jjabari-op Jul 17, 2023
62b9318
Merge branch 'primer-dev' into meetings_with_agenda_tops
jjabari-op Jul 18, 2023
b33c7ce
fixed merge error
jjabari-op Jul 19, 2023
0fb7f39
finetuning prototype based on product team input via screendesigns
jjabari-op Jul 19, 2023
afc9523
Merge branch 'dev' into meetings_with_agenda_tops
jjabari-op Jul 19, 2023
1d1ad0b
remove storybook from pullpreview to prevent timeout
machisuji Jul 20, 2023
8bdf5dd
Merge branch 'primer-dev' into meetings_with_agenda_tops
jjabari-op Jul 20, 2023
62da467
fixing minor bugs
jjabari-op Jul 20, 2023
d856ffb
Merge branch 'dev' into meetings_with_agenda_tops
jjabari-op Jul 20, 2023
9b05667
Merge branch 'dev' into meetings_with_agenda_tops
jjabari-op Jul 26, 2023
6867e89
fresh package-lock.json
jjabari-op Jul 26, 2023
60a76f6
fixed dropdown
jjabari-op Jul 26, 2023
cc69cf3
Merge branch 'meetings_with_agenda_tops' of github.com:opf/openprojec…
jjabari-op Jul 26, 2023
32dbae2
WIP: adding open/close state to agenda items
jjabari-op Jul 26, 2023
4cd1e00
copy latest abstraction layer code from PR #13218
jjabari-op Jul 27, 2023
cdc1d6e
using new concern instead of base component, using new controller con…
jjabari-op Jul 27, 2023
717338d
refactored meeting agenda state and implications
jjabari-op Jul 27, 2023
91b3e9b
fixed new section component
jjabari-op Jul 28, 2023
48096f3
cleanup
jjabari-op Jul 28, 2023
33028c7
raise error when component_wrapper is not used
jjabari-op Aug 1, 2023
acbaf7d
introduced standalone work_package issues on wp tab, proceeding with …
jjabari-op Aug 1, 2023
9c11cda
refactored meeting agenda UI towards new work_package issues
jjabari-op Aug 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pullpreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ jobs:
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
AWS_REGION: eu-central-1
OPENPROJECT_FEATURE_PERSONAL_THEME_SELECTION_ACTIVE: true
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ group :development do
gem 'livingstyleguide', '~> 2.1.0'
gem 'sassc-rails'

# Lookbook
gem 'lookbook', '~> 2.0.3'

gem 'colored2'

# git hooks manager
Expand Down
25 changes: 24 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ GEM
crack (0.4.5)
rexml
crass (1.0.6)
css_parser (1.14.0)
addressable
cuprite (0.14.3)
capybara (~> 3.0)
ferrum (~> 0.13.0)
Expand Down Expand Up @@ -534,7 +536,9 @@ GEM
html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
htmlbeautifier (1.4.2)
htmldiff (0.0.1)
htmlentities (4.3.4)
http-accept (1.7.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
Expand Down Expand Up @@ -600,6 +604,18 @@ GEM
loofah (2.21.3)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lookbook (2.0.3)
activemodel
css_parser
htmlbeautifier (~> 1.3)
htmlentities (~> 4.3.4)
marcel (~> 1.0)
railties (>= 5.0)
redcarpet (~> 3.5)
rouge (>= 3.26, < 5.0)
view_component (>= 2.0)
yard (~> 0.9.25)
zeitwerk (~> 2.5)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
Expand Down Expand Up @@ -686,6 +702,11 @@ GEM
ttfunk (~> 1.7)
prawn-table (0.2.2)
prawn (>= 1.3.0, < 3.0.0)
primer_view_components (0.1.9)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
octicons (>= 18.0.0)
view_component (> 2.0, < 4.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -983,6 +1004,7 @@ GEM
activerecord (>= 4.2)
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.34)
zeitwerk (2.6.8)

PLATFORMS
Expand Down Expand Up @@ -1058,6 +1080,7 @@ DEPENDENCIES
listen (~> 3.8.0)
livingstyleguide (~> 2.1.0)
lograge (~> 0.12.0)
lookbook (~> 2.0.3)
mail (= 2.8.1)
matrix (~> 0.4.2)
md_to_pdf!
Expand Down Expand Up @@ -1174,4 +1197,4 @@ RUBY VERSION
ruby 3.2.1p31

BUNDLED WITH
2.4.7
2.4.6
56 changes: 56 additions & 0 deletions app/assets/images/icon_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions app/assets/images/icon_logo_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions app/components/concerns/op_turbo/streamable.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
#-- 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.
#++

module OpTurbo
module Streamable
extend ActiveSupport::Concern

class_methods do
def wrapper_key
name.underscore.gsub("/", "-").gsub("_", "-")
end
end

included do
def render_as_turbo_stream(view_context:, action: :update)
case action
when :update
@inner_html_only = true
template = render_in(view_context)
when :replace
template = render_in(view_context)
when :remove
template = nil
else
raise "Unsupported action #{action}"
end

unless @component_wrapper_used
raise "You need to wrap your component in a `component_wrapper` block in order to use the turbo-stream methods"
end

OpTurbo::StreamWrapperComponent.new(
action:,
target: wrapper_key,
template:
).render_in(view_context)
end

def insert_as_turbo_stream(component:, view_context:, action: :append)
template = component.render_in(view_context)

unless @component_wrapper_used
raise "You need to wrap your component in a `component_wrapper` block in order to use the turbo-stream methods"
end

OpTurbo::StreamWrapperComponent.new(
action:,
target: insert_target_modified? ? insert_target_modifier_id : wrapper_key,
template:
).render_in(view_context)
end

def component_wrapper(tag: "div", class: nil, data: nil, style: nil, &block)
@component_wrapper_used = true
if inner_html_only?
capture(&block)
else
content_tag(tag, id: wrapper_key, class:, data:, style:, &block)
end
end

def inner_html_only?
@inner_html_only == true
end

def wrapper_key
if wrapper_uniq_by.nil?
self.class.wrapper_key
else
"#{self.class.wrapper_key}-#{wrapper_uniq_by}"
end
end

def wrapper_uniq_by
# optionally implemented in subclass in order to make the wrapper key unique
end

def insert_target_modified?
# optionally overriden (returning true) in subclass in order to indicate thate the insert target
# is modified and should not be the root inner html element
# insert_target_container needs to be present on component's erb template then
false
end

def insert_target_container(tag: "div", class: nil, data: nil, style: nil, &block)
unless insert_target_modified?
raise "`insert_target_modified?` needs to be implemented and return true if `insert_target_container` is " \
"used in this component"
end

content_tag(tag, id: insert_target_modifier_id, class:, data:, style:, &block)
end

def insert_target_modifier_id
"#{wrapper_key}-insert-target-modifier"
end
end
end
end
12 changes: 12 additions & 0 deletions app/components/icon_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

class IconComponent < ViewComponent::Base
def initialize(name:, classnames: '')

Check warning on line 4 in app/components/icon_component.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] app/components/icon_component.rb#L4

Lint/MissingSuper: Call super to initialize state of the parent class.
Raw output
app/components/icon_component.rb:4:3: W: Lint/MissingSuper: Call super to initialize state of the parent class.
  def initialize(name:, classnames: '') ...
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@name = name
@classnames = classnames
end

def call
helpers.spot_icon @name, classnames: @classnames
end
end
36 changes: 36 additions & 0 deletions app/components/op_turbo/stream_wrapper_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<%#-- 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.

++#%>
<turbo-stream action="<%=@action%>" target="<%=@target%>">
<% if @template %>
<template>
<%= @template %>
</template>
<% end %>
</turbo-stream>

39 changes: 39 additions & 0 deletions app/components/op_turbo/stream_wrapper_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#-- 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.
#++

module OpTurbo
class StreamWrapperComponent < ApplicationComponent
def initialize(template:, action:, target:)
super()

@template = template
@action = action
@target = target
end
end
end
8 changes: 8 additions & 0 deletions app/components/switch_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<%= helpers.angular_component_tag(
'spot-switch',
inputs: {
name: @name,
checked: @checked,
disabled: @disabled
}.compact
) -%>
9 changes: 9 additions & 0 deletions app/components/switch_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

class SwitchComponent < ViewComponent::Base
def initialize(checked: false, disabled: false, name: nil)

Check warning on line 4 in app/components/switch_component.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] app/components/switch_component.rb#L4

Lint/MissingSuper: Call super to initialize state of the parent class.
Raw output
app/components/switch_component.rb:4:3: W: Lint/MissingSuper: Call super to initialize state of the parent class.
  def initialize(checked: false, disabled: false, name: nil) ...
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@checked = checked
@disabled = disabled
@name = name
end
end
6 changes: 6 additions & 0 deletions app/components/tooltip_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<span class="spot-tooltip">
<%= trigger %>
<div class="spot-tooltip--body spot-container spot-tooltip--body_<%= @alignment %>">
<%= body %>
</div>
</span>
Loading
Loading