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

Adds Livewire slack inputs #12446

Merged
merged 11 commits into from
Feb 15, 2023
Merged

Conversation

Godmartinz
Copy link
Collaborator

@Godmartinz Godmartinz commented Feb 2, 2023

Description

Updates the Slack Settings page to use Livewire.

  • this removes SlackSettingsRequest.php since the rules have been moved over to the livewire controller.
  • the ajax call from the API has been moved to the livewire controller as well.
  • the PostSlack() method has been removed from the SettingsController.

On Integration test:
image

on bad name of channel:
image

on updating the slack settings:
image

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • PHP version:
  • MySQL version
  • Webserver version
  • OS version

Checklist:

@what-the-diff
Copy link

what-the-diff bot commented Feb 2, 2023

  • Removed the slacktest function from SettingsController.php
  • Added SlackSettingsForm livewire component to handle all of this logic now
  • Created a new request for validation in Requests/SlackSettingsRequest (this is not used anymore)
  • Updated Setting model with 3 new fields: slack_endpoint,slack_channel and slack_botname
  • Removed the old slack settings form
  • Added a new livewire component for the slack settings form

Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some little things to change but overall 🤩

this is always good 😄
CleanShot 2023-02-02 at 15 56 27

resources/views/livewire/slack-settings-form.blade.php Outdated Show resolved Hide resolved
resources/views/livewire/slack-settings-form.blade.php Outdated Show resolved Hide resolved
resources/views/livewire/slack-settings-form.blade.php Outdated Show resolved Hide resolved
resources/views/livewire/slack-settings-form.blade.php Outdated Show resolved Hide resolved
app/Http/Livewire/SlackSettingsForm.php Outdated Show resolved Hide resolved
resources/views/livewire/slack-settings-form.blade.php Outdated Show resolved Hide resolved
@snipe snipe merged commit ff89573 into snipe:develop Feb 15, 2023
@snipe
Copy link
Owner

snipe commented Feb 15, 2023

Nice work on this, @Godmartinz. I did a little cleanup here #12522. One thing I noticed is that the submit button doesn't get greyed out if the test fails. The the previous (non-livewire) version, IIRC, if the test failed, we didn't allow the form to be submitted.

There are really only two scenarios where that button should be enabled:

  1. The test passed
  2. The admin has removed ALL fields, effectively disabling slack integration.

Also the test button shouldn't appear until there are values for each field and the fields have passed the livewire validation.

I'll open a SC for you. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants