Skip to content

Commit

Permalink
refactored meeting agenda UI towards new work_package issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jjabari-op committed Aug 1, 2023
1 parent acbaf7d commit 9c11cda
Show file tree
Hide file tree
Showing 41 changed files with 746 additions and 906 deletions.
4 changes: 2 additions & 2 deletions app/models/work_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class WorkPackage < ApplicationRecord

has_many :storages, through: :project

has_many :meeting_agenda_items # should become through issue relation
has_many :issues, dependent: :destroy
has_many :issues, class_name: 'WorkPackageIssue', dependent: :destroy
has_many :meeting_agenda_items, through: :issues

has_and_belongs_to_many :changesets, -> { # rubocop:disable Rails/HasAndBelongsToMany
order("#{Changeset.table_name}.committed_on ASC, #{Changeset.table_name}.id ASC")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ export default class extends Controller {
}
declare cancelUrlValue: string

Check failure on line 38 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L37-L38 <@typescript-eslint/semi>(https://typescript-eslint.io/rules/semi)

Missing semicolon.
Raw output
{"ruleId":"@typescript-eslint/semi","severity":2,"message":"Missing semicolon.","line":37,"column":4,"nodeType":"PropertyDefinition","messageId":"missingSemi","endLine":38,"endColumn":1,"fix":{"range":[1425,1425],"text":";"}}

Check failure on line 38 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L38 <@typescript-eslint/lines-between-class-members>(https://typescript-eslint.io/rules/lines-between-class-members)

Expected blank line between class members.
Raw output
{"ruleId":"@typescript-eslint/lines-between-class-members","severity":2,"message":"Expected blank line between class members.","line":38,"column":3,"nodeType":"PropertyDefinition","messageId":"always","endLine":38,"endColumn":33,"fix":{"range":[1425,1425],"text":"\n"}}

Check failure on line 38 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L38 <@typescript-eslint/type-annotation-spacing>(https://typescript-eslint.io/rules/type-annotation-spacing)

Unexpected space after the ':'.
Raw output
{"ruleId":"@typescript-eslint/type-annotation-spacing","severity":2,"message":"Unexpected space after the ':'.","line":38,"column":25,"nodeType":"Punctuator","messageId":"unexpectedSpaceAfter","endLine":38,"endColumn":26,"fix":{"range":[1451,1452],"text":""}}

Check failure on line 39 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L38-L39 <@typescript-eslint/semi>(https://typescript-eslint.io/rules/semi)

Missing semicolon.
Raw output
{"ruleId":"@typescript-eslint/semi","severity":2,"message":"Missing semicolon.","line":38,"column":33,"nodeType":"PropertyDefinition","messageId":"missingSemi","endLine":39,"endColumn":1,"fix":{"range":[1458,1458],"text":";"}}
static targets = [ "titleInput", "clarificationNeedInput", "clarificationInput", "workPackageInput", "workPackageButton", "detailsInput"]
static targets = [ "titleInput", "issueInput", "issueButton", "detailsInput"]

Check failure on line 40 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L40 <array-bracket-spacing>(https://eslint.org/docs/latest/rules/array-bracket-spacing)

There should be no space after '['.
Raw output
{"ruleId":"array-bracket-spacing","severity":2,"message":"There should be no space after '['.","line":40,"column":21,"nodeType":"ArrayExpression","messageId":"unexpectedSpaceAfter","endLine":40,"endColumn":22,"fix":{"range":[1480,1481],"text":""}}

Check failure on line 40 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L40 <@typescript-eslint/quotes>(https://typescript-eslint.io/rules/quotes)

Strings must use singlequote.
Raw output
{"ruleId":"@typescript-eslint/quotes","severity":2,"message":"Strings must use singlequote.","line":40,"column":22,"nodeType":"Literal","messageId":"wrongQuotes","endLine":40,"endColumn":34,"fix":{"range":[1481,1493],"text":"'titleInput'"}}

Check failure on line 40 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L40 <@typescript-eslint/quotes>(https://typescript-eslint.io/rules/quotes)

Strings must use singlequote.
Raw output
{"ruleId":"@typescript-eslint/quotes","severity":2,"message":"Strings must use singlequote.","line":40,"column":36,"nodeType":"Literal","messageId":"wrongQuotes","endLine":40,"endColumn":48,"fix":{"range":[1495,1507],"text":"'issueInput'"}}

Check failure on line 40 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L40 <@typescript-eslint/quotes>(https://typescript-eslint.io/rules/quotes)

Strings must use singlequote.
Raw output
{"ruleId":"@typescript-eslint/quotes","severity":2,"message":"Strings must use singlequote.","line":40,"column":50,"nodeType":"Literal","messageId":"wrongQuotes","endLine":40,"endColumn":63,"fix":{"range":[1509,1522],"text":"'issueButton'"}}

Check failure on line 40 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L40 <@typescript-eslint/quotes>(https://typescript-eslint.io/rules/quotes)

Strings must use singlequote.
Raw output
{"ruleId":"@typescript-eslint/quotes","severity":2,"message":"Strings must use singlequote.","line":40,"column":65,"nodeType":"Literal","messageId":"wrongQuotes","endLine":40,"endColumn":79,"fix":{"range":[1524,1538],"text":"'detailsInput'"}}
declare readonly titleInputTarget: HTMLInputElement

Check failure on line 41 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L40-L41 <@typescript-eslint/semi>(https://typescript-eslint.io/rules/semi)

Missing semicolon.
Raw output
{"ruleId":"@typescript-eslint/semi","severity":2,"message":"Missing semicolon.","line":40,"column":80,"nodeType":"PropertyDefinition","messageId":"missingSemi","endLine":41,"endColumn":1,"fix":{"range":[1539,1539],"text":";"}}

Check failure on line 41 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L41 <@typescript-eslint/type-annotation-spacing>(https://typescript-eslint.io/rules/type-annotation-spacing)

Unexpected space after the ':'.
Raw output
{"ruleId":"@typescript-eslint/type-annotation-spacing","severity":2,"message":"Unexpected space after the ':'.","line":41,"column":36,"nodeType":"Punctuator","messageId":"unexpectedSpaceAfter","endLine":41,"endColumn":37,"fix":{"range":[1576,1577],"text":""}}
declare readonly clarificationNeedInputTarget: HTMLInputElement
declare readonly clarificationInputTarget: HTMLInputElement
declare readonly detailsInputTarget: HTMLInputElement

Check failure on line 42 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L41-L42 <@typescript-eslint/semi>(https://typescript-eslint.io/rules/semi)

Missing semicolon.
Raw output
{"ruleId":"@typescript-eslint/semi","severity":2,"message":"Missing semicolon.","line":41,"column":54,"nodeType":"PropertyDefinition","messageId":"missingSemi","endLine":42,"endColumn":1,"fix":{"range":[1593,1593],"text":";"}}

Check failure on line 42 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L42 <@typescript-eslint/type-annotation-spacing>(https://typescript-eslint.io/rules/type-annotation-spacing)

Unexpected space after the ':'.
Raw output
{"ruleId":"@typescript-eslint/type-annotation-spacing","severity":2,"message":"Unexpected space after the ':'.","line":42,"column":38,"nodeType":"Punctuator","messageId":"unexpectedSpaceAfter","endLine":42,"endColumn":39,"fix":{"range":[1632,1633],"text":""}}
declare readonly workPackageInputTarget: HTMLInputElement
declare readonly workPackageButtonTarget: HTMLInputElement
declare readonly issueInputTarget: HTMLInputElement

Check failure on line 43 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L42-L43 <@typescript-eslint/semi>(https://typescript-eslint.io/rules/semi)

Missing semicolon.
Raw output
{"ruleId":"@typescript-eslint/semi","severity":2,"message":"Missing semicolon.","line":42,"column":56,"nodeType":"PropertyDefinition","messageId":"missingSemi","endLine":43,"endColumn":1,"fix":{"range":[1649,1649],"text":";"}}

Check failure on line 43 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L43 <@typescript-eslint/type-annotation-spacing>(https://typescript-eslint.io/rules/type-annotation-spacing)

Unexpected space after the ':'.
Raw output
{"ruleId":"@typescript-eslint/type-annotation-spacing","severity":2,"message":"Unexpected space after the ':'.","line":43,"column":36,"nodeType":"Punctuator","messageId":"unexpectedSpaceAfter","endLine":43,"endColumn":37,"fix":{"range":[1686,1687],"text":""}}
declare readonly issueButtonTarget: HTMLInputElement

Check failure on line 44 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L43-L44 <@typescript-eslint/semi>(https://typescript-eslint.io/rules/semi)

Missing semicolon.
Raw output
{"ruleId":"@typescript-eslint/semi","severity":2,"message":"Missing semicolon.","line":43,"column":54,"nodeType":"PropertyDefinition","messageId":"missingSemi","endLine":44,"endColumn":1,"fix":{"range":[1703,1703],"text":";"}}

Check failure on line 44 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L44 <@typescript-eslint/type-annotation-spacing>(https://typescript-eslint.io/rules/type-annotation-spacing)

Unexpected space after the ':'.
Raw output
{"ruleId":"@typescript-eslint/type-annotation-spacing","severity":2,"message":"Unexpected space after the ':'.","line":44,"column":37,"nodeType":"Punctuator","messageId":"unexpectedSpaceAfter","endLine":44,"endColumn":38,"fix":{"range":[1741,1742],"text":""}}

Check failure on line 45 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L44-L45 <@typescript-eslint/semi>(https://typescript-eslint.io/rules/semi)

Missing semicolon.
Raw output
{"ruleId":"@typescript-eslint/semi","severity":2,"message":"Missing semicolon.","line":44,"column":55,"nodeType":"PropertyDefinition","messageId":"missingSemi","endLine":45,"endColumn":1,"fix":{"range":[1758,1758],"text":";"}}
connect(): void {

Check failure on line 46 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L46 <@typescript-eslint/type-annotation-spacing>(https://typescript-eslint.io/rules/type-annotation-spacing)

Unexpected space after the ':'.
Raw output
{"ruleId":"@typescript-eslint/type-annotation-spacing","severity":2,"message":"Unexpected space after the ':'.","line":46,"column":12,"nodeType":"Punctuator","messageId":"unexpectedSpaceAfter","endLine":46,"endColumn":13,"fix":{"range":[1772,1773],"text":""}}
this.focusInput();
Expand Down Expand Up @@ -76,26 +74,6 @@ export default class extends Controller {
}
}

async addClarificationNeed() {
this.clarificationNeedInputTarget.classList.remove("d-none");
const textarea = this.element.querySelector('textarea[name="meeting_agenda_item[input]"]');
setTimeout(() => {
if(textarea) {
(textarea as HTMLInputElement).focus();
}
}, 100);
}

async addClarification() {
this.clarificationInputTarget.classList.remove("d-none");
const textarea = this.element.querySelector('textarea[name="meeting_agenda_item[output]"]');
setTimeout(() => {
if(textarea) {
(textarea as HTMLInputElement).focus();
}
}, 100);
}

async addDetails() {
this.detailsInputTarget.classList.remove("d-none");

Check failure on line 78 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L78 <@typescript-eslint/quotes>(https://typescript-eslint.io/rules/quotes)

Strings must use singlequote.
Raw output
{"ruleId":"@typescript-eslint/quotes","severity":2,"message":"Strings must use singlequote.","line":78,"column":46,"nodeType":"Literal","messageId":"wrongQuotes","endLine":78,"endColumn":54,"fix":{"range":[2581,2589],"text":"'d-none'"}}
const textarea = this.element.querySelector('textarea[name="meeting_agenda_item[details]"]');
Expand All @@ -106,11 +84,11 @@ export default class extends Controller {
}, 100);
}

async addWorkPackage() {
async addIssue() {
this.titleInputTarget.classList.add("d-none");

Check failure on line 88 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L88 <@typescript-eslint/quotes>(https://typescript-eslint.io/rules/quotes)

Strings must use singlequote.
Raw output
{"ruleId":"@typescript-eslint/quotes","severity":2,"message":"Strings must use singlequote.","line":88,"column":41,"nodeType":"Literal","messageId":"wrongQuotes","endLine":88,"endColumn":49,"fix":{"range":[2869,2877],"text":"'d-none'"}}
this.workPackageButtonTarget.classList.add("d-none");
this.workPackageInputTarget.classList.remove("d-none");
const select = this.element.querySelector('select[name="meeting_agenda_item[work_package_id]"]');
this.issueButtonTarget.classList.add("d-none");

Check failure on line 89 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L89 <@typescript-eslint/quotes>(https://typescript-eslint.io/rules/quotes)

Strings must use singlequote.
Raw output
{"ruleId":"@typescript-eslint/quotes","severity":2,"message":"Strings must use singlequote.","line":89,"column":42,"nodeType":"Literal","messageId":"wrongQuotes","endLine":89,"endColumn":50,"fix":{"range":[2921,2929],"text":"'d-none'"}}
this.issueInputTarget.classList.remove("d-none");

Check failure on line 90 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L90 <@typescript-eslint/quotes>(https://typescript-eslint.io/rules/quotes)

Strings must use singlequote.
Raw output
{"ruleId":"@typescript-eslint/quotes","severity":2,"message":"Strings must use singlequote.","line":90,"column":44,"nodeType":"Literal","messageId":"wrongQuotes","endLine":90,"endColumn":52,"fix":{"range":[2975,2983],"text":"'d-none'"}}
const select = this.element.querySelector('select[name="meeting_agenda_item[work_package_issue_id]"]');
setTimeout(() => {
if(select) {

Check failure on line 93 in frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts

View workflow job for this annotation

GitHub Actions / eslint

[eslint] frontend/src/stimulus/controllers/dynamic/meeting-agenda-item-form.controller.ts#L93 <@typescript-eslint/keyword-spacing>(https://typescript-eslint.io/rules/keyword-spacing)

Expected space(s) after "if".
Raw output
{"ruleId":"@typescript-eslint/keyword-spacing","severity":2,"message":"Expected space(s) after \"if\".","line":93,"column":7,"nodeType":null,"messageId":"expectedAfter","endLine":93,"endColumn":9,"fix":{"range":[3125,3125],"text":" "}}
(select as HTMLInputElement).focus();
Expand Down
139 changes: 60 additions & 79 deletions modules/meeting/app/components/meeting_agenda_items/form_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ module MeetingAgendaItems
class FormComponent < Base::Component
include OpTurbo::Streamable

def initialize(meeting:, meeting_agenda_item:, method:, submit_path:, cancel_path:, active_work_package: nil)
def initialize(meeting:, meeting_agenda_item:, method:, submit_path:, cancel_path:)
super

@meeting = meeting
@meeting_agenda_item = meeting_agenda_item
@active_work_package = active_work_package
@method = method
@submit_path = submit_path
@cancel_path = cancel_path
Expand All @@ -45,65 +44,10 @@ def call
component_wrapper(data: wrapper_data_attributes) do
primer_form_with(
model: @meeting_agenda_item,
method: :post,
method: @method,
url: @submit_path
) do |f|
flex_layout do |flex|
flex.with_row do
hidden_field_tag :work_package_id, @active_work_package&.id
end
flex.with_row(flex_layout: true) do |flex|
flex.with_column(flex: 1, flex_layout: true, mr: 5) do |flex|
flex.with_column(flex: 1, data: { 'meeting-agenda-item-form-target': "titleInput" },
display: display_title_input_value) do
render(MeetingAgendaItem::New::Title.new(f, disabled: !@meeting.agenda_items_open?))
end
unless @active_work_package.present?
flex.with_column(flex: 1, data: { 'meeting-agenda-item-form-target': "workPackageInput" },
display: display_work_package_input_value) do
render(MeetingAgendaItem::New::WorkPackage.new(f, disabled: !@meeting.agenda_items_open?))
end
if @meeting.agenda_items_open?
flex.with_column(ml: 2, data: { 'meeting-agenda-item-form-target': "workPackageButton" },
display: display_work_package_button_value) do
render(Primer::Beta::Button.new(data: { action: 'click->meeting-agenda-item-form#addWorkPackage keydown.enter->meeting-agenda-item-form#addWorkPackage' })) do |_button|
"Reference work package instead"
end
end
end
end
end
unless @active_work_package.present?
flex.with_column(ml: 2) do
render(MeetingAgendaItem::New::Duration.new(f, disabled: !@meeting.agenda_items_open?))
end
flex.with_column(ml: 2) do
render(MeetingAgendaItem::New::Author.new(f, disabled: !@meeting.agenda_items_open?))
end
end
end
flex.with_row(mt: 2, data: { 'meeting-agenda-item-form-target': "detailsInput" },
display: display_details_input_value) do
render(MeetingAgendaItem::New::Details.new(f))
end
flex.with_row(mt: 2, data: { 'meeting-agenda-item-form-target': "clarificationNeedInput" },
display: display_clarification_need_input_value) do
render(MeetingAgendaItem::New::ClarificationNeed.new(f))
end
flex.with_row(mt: 2, data: { 'meeting-agenda-item-form-target': "clarificationInput" },
display: display_clarification_input_value) do
render(MeetingAgendaItem::New::Clarification.new(f))
end
flex.with_row(mt: 2) do
action_menu_partial
end
flex.with_row(flex_layout: true, justify_content: :flex_end, mt: 2) do |flex|
flex.with_column do
render(MeetingAgendaItem::New::Submit.new(f, preselected_work_package: @active_work_package))
end
end
end
form_content_partial(f)
end
end
end
Expand All @@ -118,32 +62,66 @@ def wrapper_data_attributes
}
end

def form_content_partial(f)

Check failure on line 65 in modules/meeting/app/components/meeting_agenda_items/form_component.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] modules/meeting/app/components/meeting_agenda_items/form_component.rb#L65

Metrics/AbcSize: Assignment Branch Condition size for form_content_partial is too high. [<4, 31, 1> 31.27/17]
Raw output
modules/meeting/app/components/meeting_agenda_items/form_component.rb:65:5: C: Metrics/AbcSize: Assignment Branch Condition size for form_content_partial is too high. [<4, 31, 1> 31.27/17]
    def form_content_partial(f) ...
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Check failure on line 65 in modules/meeting/app/components/meeting_agenda_items/form_component.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] modules/meeting/app/components/meeting_agenda_items/form_component.rb#L65

Naming/MethodParameterName: Method parameter must be at least 3 characters long.
Raw output
modules/meeting/app/components/meeting_agenda_items/form_component.rb:65:30: C: Naming/MethodParameterName: Method parameter must be at least 3 characters long.
    def form_content_partial(f)
                             ^
flex_layout do |flex|
flex.with_row(flex_layout: true) do |flex|

Check warning on line 67 in modules/meeting/app/components/meeting_agenda_items/form_component.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] modules/meeting/app/components/meeting_agenda_items/form_component.rb#L67

Lint/ShadowingOuterLocalVariable: Shadowing outer local variable - flex.
Raw output
modules/meeting/app/components/meeting_agenda_items/form_component.rb:67:46: W: Lint/ShadowingOuterLocalVariable: Shadowing outer local variable - flex.
        flex.with_row(flex_layout: true) do |flex|
                                             ^^^^
flex.with_column(flex: 1, flex_layout: true, mr: 5) do |flex|

Check warning on line 68 in modules/meeting/app/components/meeting_agenda_items/form_component.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] modules/meeting/app/components/meeting_agenda_items/form_component.rb#L68

Lint/ShadowingOuterLocalVariable: Shadowing outer local variable - flex.
Raw output
modules/meeting/app/components/meeting_agenda_items/form_component.rb:68:67: W: Lint/ShadowingOuterLocalVariable: Shadowing outer local variable - flex.
          flex.with_column(flex: 1, flex_layout: true, mr: 5) do |flex|
                                                                  ^^^^
flex.with_column(flex: 1, data: { 'meeting-agenda-item-form-target': "titleInput" },
display: display_title_input_value) do
render(MeetingAgendaItem::Title.new(f, disabled: !@meeting.agenda_items_open?))
end
flex.with_column(flex: 1, data: { 'meeting-agenda-item-form-target': "issueInput" },
display: display_issue_input_value) do
render(MeetingAgendaItem::Issue.new(f, disabled: !@meeting.agenda_items_open?))
end
if @meeting.agenda_items_open?
flex.with_column(ml: 2, data: { 'meeting-agenda-item-form-target': "issueButton" },
display: display_issue_button_value) do
render(Primer::Beta::Button.new(data: { action: 'click->meeting-agenda-item-form#addIssue keydown.enter->meeting-agenda-item-form#addIssue' })) do |_button|

Check failure on line 80 in modules/meeting/app/components/meeting_agenda_items/form_component.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] modules/meeting/app/components/meeting_agenda_items/form_component.rb#L80

Layout/LineLength: Line is too long. [172/130]
Raw output
modules/meeting/app/components/meeting_agenda_items/form_component.rb:80:131: C: Layout/LineLength: Line is too long. [172/130]
                render(Primer::Beta::Button.new(data: { action: 'click->meeting-agenda-item-form#addIssue keydown.enter->meeting-agenda-item-form#addIssue' })) do |_button|
                                                                                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"Reference issue instead"
end
end
end
end
flex.with_column(ml: 2) do
render(MeetingAgendaItem::Duration.new(f, disabled: !@meeting.agenda_items_open?))
end
# flex.with_column(ml: 2) do
# render(MeetingAgendaItem::Author.new(f, disabled: [email protected]_items_open?))
# end
end
# flex.with_row(mt: 2) do
# action_menu_partial
# end
flex.with_row(flex_layout: true, justify_content: :flex_end, mt: 2) do |flex|

Check warning on line 96 in modules/meeting/app/components/meeting_agenda_items/form_component.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] modules/meeting/app/components/meeting_agenda_items/form_component.rb#L96

Lint/ShadowingOuterLocalVariable: Shadowing outer local variable - flex.
Raw output
modules/meeting/app/components/meeting_agenda_items/form_component.rb:96:81: W: Lint/ShadowingOuterLocalVariable: Shadowing outer local variable - flex.
        flex.with_row(flex_layout: true, justify_content: :flex_end, mt: 2) do |flex|
                                                                                ^^^^
flex.with_column(mr: 2) do
back_link_partial
end
flex.with_column do
render(MeetingAgendaItem::Submit.new(f))
end
end
end
end

def display_title_input_value
@meeting_agenda_item.work_package.present? ? :none : :block
@meeting_agenda_item.work_package_issue.present? ? :none : :block
end

def display_work_package_button_value
def display_issue_button_value
display_title_input_value
end

def display_work_package_input_value
@meeting_agenda_item.work_package.nil? ? :none : nil
def display_issue_input_value
@meeting_agenda_item.work_package_issue.nil? ? :none : nil
end

def display_details_input_value
@meeting_agenda_item.details.blank? ? :none : nil
end

def display_clarification_need_input_value
@meeting_agenda_item.input.blank? ? :none : nil
end

def display_clarification_input_value
@meeting_agenda_item.output.blank? ? :none : nil
end

def action_menu_partial
if @meeting_agenda_item.details.blank? || @meeting_agenda_item.input.blank? || @meeting_agenda_item.output.blank?
if @meeting_agenda_item.details.blank?
render(Primer::Alpha::ActionMenu.new(menu_id: "meeting-agenda-item-additional-fields-menu-#{@meeting_agenda_item.id || 'new'}")) do |menu|

Check failure on line 125 in modules/meeting/app/components/meeting_agenda_items/form_component.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] modules/meeting/app/components/meeting_agenda_items/form_component.rb#L125

Layout/LineLength: Line is too long. [146/130]
Raw output
modules/meeting/app/components/meeting_agenda_items/form_component.rb:125:131: C: Layout/LineLength: Line is too long. [146/130]
        render(Primer::Alpha::ActionMenu.new(menu_id: "meeting-agenda-item-additional-fields-menu-#{@meeting_agenda_item.id || 'new'}")) do |menu|
                                                                                                                                  ^^^^^^^^^^^^^^^^
menu.with_show_button do |button|
button.with_trailing_action_icon(icon: :'triangle-down')
Expand All @@ -153,16 +131,19 @@ def action_menu_partial
menu.with_item(label: "Details",
data: { action: 'click->meeting-agenda-item-form#addDetails keydown.enter->meeting-agenda-item-form#addDetails' })

Check failure on line 132 in modules/meeting/app/components/meeting_agenda_items/form_component.rb

View workflow job for this annotation

GitHub Actions / rubocop

[rubocop] modules/meeting/app/components/meeting_agenda_items/form_component.rb#L132

Layout/LineLength: Line is too long. [141/130]
Raw output
modules/meeting/app/components/meeting_agenda_items/form_component.rb:132:131: C: Layout/LineLength: Line is too long. [141/130]
                           data: { action: 'click->meeting-agenda-item-form#addDetails keydown.enter->meeting-agenda-item-form#addDetails' })
                                                                                                                                  ^^^^^^^^^^^
end
if @meeting_agenda_item.input.blank?
menu.with_item(label: "Clarification need",
data: { action: 'click->meeting-agenda-item-form#addClarificationNeed keydown.enter->meeting-agenda-item-form#addClarificationNeed' })
end
if @meeting_agenda_item.output.blank?
menu.with_item(label: "Clarification",
data: { action: 'click->meeting-agenda-item-form#addClarification keydown.enter->meeting-agenda-item-form#addClarifciation' })
end
end
end
end

def back_link_partial
render(Primer::Beta::Button.new(
scheme: :secondary,
tag: :a,
href: @cancel_path,
data: { confirm: 'Are you sure?', 'turbo-stream': true }
)) do |_c|
"Cancel"
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ module MeetingAgendaItems
class ItemComponent < Base::Component
include OpTurbo::Streamable

def initialize(meeting_agenda_item:, active_work_package: nil, state: :show)
def initialize(meeting_agenda_item:, state: :show)
super

@meeting_agenda_item = meeting_agenda_item
@active_work_package = active_work_package
@state = state
end

Expand All @@ -57,8 +56,7 @@ def call

def child_component_params
{
meeting_agenda_item: @meeting_agenda_item,
active_work_package: @active_work_package
meeting_agenda_item: @meeting_agenda_item
}
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,16 @@

module MeetingAgendaItems
class ItemComponent::EditComponent < Base::Component
def initialize(meeting_agenda_item:, active_work_package: nil)
def initialize(meeting_agenda_item:)
super

@meeting_agenda_item = meeting_agenda_item
@active_work_package = active_work_package
end

def call
render(MeetingAgendaItems::FormComponent.new(
meeting: @meeting_agenda_item.meeting,
meeting_agenda_item: @meeting_agenda_item,
active_work_package: @active_work_package,
method: :put,
submit_path: meeting_agenda_item_path(@meeting_agenda_item.meeting, @meeting_agenda_item),
cancel_path: cancel_edit_meeting_agenda_item_path(@meeting_agenda_item.meeting, @meeting_agenda_item)
Expand Down
Loading

0 comments on commit 9c11cda

Please sign in to comment.