feat: G15Office job, widget settings and submissions admin, embed.js and the settings importer

- SyncG15Office files each submission as a G15Office task with its screenshot through a fetchguard client limited to the configured host; a River job with 3 attempts, PHP's messages on failure, nothing sent when unconfigured
- the replay of PHP's recorded G15Office exchange (classes/testdata) asserts the task JSON, headers and the screenshot part
- settings screen (cabana field types only), read-only submissions list, manage_settings permission and navigation
- embed.js served byte for byte at /plugins/golem15/feedback/assets/js/embed.js
- feedback:import-settings copies the WinterCMS settings row once
This commit is contained in:
Jakub Zych
2026-10-04 00:22:08 +02:00
parent 92e1b4e09c
commit af5d77c997
19 changed files with 2285 additions and 6 deletions

108
models/settings/fields.yaml Normal file
View File

@@ -0,0 +1,108 @@
# The WinterCMS settings form with cabana's field types only: the colors
# are text fields and the widget key is made read-only through its input
# attributes. Defaults are initSettingsData.
fields:
enabled:
tab: golem15.feedback::lang.settings.tab_general
label: golem15.feedback::lang.settings.enabled
type: switch
default: 1
span: full
widget_key:
tab: golem15.feedback::lang.settings.tab_general
label: golem15.feedback::lang.settings.widget_key
comment: golem15.feedback::lang.settings.widget_key_comment
type: text
span: left
attributes:
readonly: true
allow_hide:
tab: golem15.feedback::lang.settings.tab_general
label: golem15.feedback::lang.settings.allow_hide
comment: golem15.feedback::lang.settings.allow_hide_comment
type: switch
default: 0
span: full
position:
tab: golem15.feedback::lang.settings.tab_general
label: golem15.feedback::lang.settings.position
type: dropdown
default: bottom-right
options:
bottom-right: golem15.feedback::lang.settings.position_bottom_right
bottom-left: golem15.feedback::lang.settings.position_bottom_left
middle-right: golem15.feedback::lang.settings.position_middle_right
middle-left: golem15.feedback::lang.settings.position_middle_left
span: right
allowed_origins:
tab: golem15.feedback::lang.settings.tab_general
label: golem15.feedback::lang.settings.allowed_origins
comment: golem15.feedback::lang.settings.allowed_origins_comment
type: textarea
size: small
span: full
color_primary:
tab: golem15.feedback::lang.settings.tab_appearance
label: golem15.feedback::lang.settings.color_primary
comment: golem15.feedback::lang.settings.color_primary_comment
type: text
span: left
color_accent:
tab: golem15.feedback::lang.settings.tab_appearance
label: golem15.feedback::lang.settings.color_accent
comment: golem15.feedback::lang.settings.color_accent_comment
type: text
span: right
label_title_pl:
tab: golem15.feedback::lang.settings.tab_appearance
label: golem15.feedback::lang.settings.label_title_pl
type: text
default: Zgłoś opinię
span: left
label_title_en:
tab: golem15.feedback::lang.settings.tab_appearance
label: golem15.feedback::lang.settings.label_title_en
type: text
default: Send feedback
span: right
label_placeholder_pl:
tab: golem15.feedback::lang.settings.tab_appearance
label: golem15.feedback::lang.settings.label_placeholder_pl
type: text
default: Co poszło nie tak?
span: left
label_placeholder_en:
tab: golem15.feedback::lang.settings.tab_appearance
label: golem15.feedback::lang.settings.label_placeholder_en
type: text
default: What went wrong?
span: right
label_success_pl:
tab: golem15.feedback::lang.settings.tab_appearance
label: golem15.feedback::lang.settings.label_success_pl
type: text
default: Dzięki za zgłoszenie!
span: left
label_success_en:
tab: golem15.feedback::lang.settings.tab_appearance
label: golem15.feedback::lang.settings.label_success_en
type: text
default: Thanks for the feedback!
span: right
g15office_task_status:
tab: golem15.feedback::lang.settings.tab_g15office
label: golem15.feedback::lang.settings.g15office_task_status
comment: golem15.feedback::lang.settings.g15office_task_status_comment
type: text
span: right
g15office_task_priority:
tab: golem15.feedback::lang.settings.tab_g15office
label: golem15.feedback::lang.settings.g15office_task_priority
type: dropdown
default: normal
options:
low: golem15.feedback::lang.settings.priority_low
normal: golem15.feedback::lang.settings.priority_normal
high: golem15.feedback::lang.settings.priority_high
urgent: golem15.feedback::lang.settings.priority_urgent
span: full

View File

@@ -0,0 +1,32 @@
# Read-only list of the widget's submissions. Every column is plain text:
# the message and the other visitor-supplied values are never rendered as
# HTML.
columns:
id:
label: golem15.feedback::lang.submissions.id
sortable: true
type:
label: golem15.feedback::lang.submissions.type
type: text
status:
label: golem15.feedback::lang.submissions.status
type: text
email:
label: golem15.feedback::lang.submissions.email
type: text
searchable: true
page_url:
label: golem15.feedback::lang.submissions.page_url
type: text
searchable: true
message:
label: golem15.feedback::lang.submissions.message
type: text
searchable: true
g15office_task_id:
label: golem15.feedback::lang.submissions.g15office_task_id
type: text
created_at:
label: golem15.feedback::lang.submissions.created_at
type: datetime
sortable: true