Page MenuHomePhorge

Conditionally show the support form if SUPPORT_EMAIL is set.
ClosedPublic

Authored by mollekopf on Mar 27 2023, 11:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 11:24 AM
Unknown Object (File)
Thu, Nov 21, 11:24 AM
Unknown Object (File)
Thu, Nov 21, 11:23 AM
Unknown Object (File)
Thu, Nov 21, 11:23 AM
Unknown Object (File)
Thu, Nov 21, 11:22 AM
Unknown Object (File)
Thu, Nov 21, 11:22 AM
Unknown Object (File)
Thu, Nov 21, 11:22 AM
Unknown Object (File)
Thu, Nov 21, 11:22 AM
Subscribers

Diff Detail

Repository
rK kolab
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mollekopf created this revision.
mollekopf added a reviewer: Restricted Project.Mar 27 2023, 11:10 PM

I could extract the original test and put it into the kolabnow deployment config if we wanted that.

FWIW; I'm still facing failing tests in some payment tests as well as Tests\Browser\SignupTest and Tests\Browser\WalletTest. I couldn't figure those out just yet.

I fixed SignupTest in master, WalletTest works for me. Mollie payment tests fail because of https://github.com/mollie/mollie-api-php/issues/649 and I'm not sure what to do about it.

As for the diff... How about we make the support page to look like https://kolabnow.com/support, but hide the right-side box if app.support_email is not set? If you're a company that installs Kolab for your employees only, you still might find this support channel useful. That means that we'd have to set this option to something (like john@kolab.org for config.dev) to keep the test.

I fixed SignupTest in master, WalletTest works for me. Mollie payment tests fail because of https://github.com/mollie/mollie-api-php/issues/649 and I'm not sure what to do about it.

As for the diff... How about we make the support page to look like https://kolabnow.com/support, but hide the right-side box if app.support_email is not set? If you're a company that installs Kolab for your employees only, you still might find this support channel useful. That means that we'd have to set this option to something (like john@kolab.org for config.dev) to keep the test.

Good idea, I'll work on that this week.

mollekopf retitled this revision from The support contact form is only available in kolabnow. to Conditionally show the support form if SUPPORT_EMAIL is set..

As discussed. I fail to test disabling the support form currently (no idea why), but it seems to work fine in practice.

Removed the toast check because this passes now

Changing the config in browser tests doesn't work because we're testing code served via octane...
Soo, not sure how to test this.

Updated commented test with comment why we can't currently test this.

There seem to be some fairly elaborate workarounds possible in principle at least:
https://stackoverflow.com/questions/58450836/how-to-override-env-variables-in-laravel-dusk

We already have a way to set config options:

$browser->execScript(sprintf('Object.assign(window.config, %s)', \json_encode($config)));

For payment providers we have an additional mechanism that passes the setting to the backend via headers. See https://git.kolab.org/source/kolab/browse/master/src/resources/js/app.js$371 I suppose we could make it a bit more universal mechanism. See also App\Http\Middleware\DevelConfig.

After trying various approaches I've settled on using the cache to propagate the values.
I suppose the javascript approach would also be doable, but it seems more complex to me.

If you prefer the javascript approach, I can give it another go.

This revision is now accepted and ready to land.Mar 30 2023, 8:07 AM
This revision was landed with ongoing or failed builds.Apr 3 2023, 9:42 AM
This revision was automatically updated to reflect the committed changes.