-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Extend messaging to applications #81
feat: Extend messaging to applications #81
Conversation
This reverts commit 7650b45.
{ | ||
$queryResponse = $this->handleQuery(Licence::create(['id' => $this->params()->fromRoute('licence')])); | ||
if (!$queryResponse->isOk()) { | ||
throw new ResourceNotFoundException('Not found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we throw something more generic for not OK? And pipe in the response code/body too? More things could go wrong with a response not OK other than not found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also worth noting that if the backend returns a 404, an exception is thrown anyways:
vendor/olcs/olcs-common/Common/src/Common/Service/Cqrs/Query/QueryService.php:132
That block catches things like 403, 400 and server exception too. And re-throws.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think instead? Having a look around for if \(\!.*isOk\(\)\)
yields various throws or flash error unknown error messages. There's a few that extend AbstractInternalController
and that has handleErrors
but that's not in the class hierarchy here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally, I'd throw new \Exception('Unexpected error when querying licence for organisation ID. Response: HTTP ' . $queryResponse->getStatusCode() . ' :: ' . $queryResponse->getBody());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
404, 400, 403 and 500 are already handled (thrown) in the query/command service. Thus, this is everything else, unexpected etc....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and that query handler (Licence) uses fetchById which will throw Exception\NotFoundException
which will HTTP 404.
\Dvsa\Olcs\Api\Controller\GenericController
} catch (Exception\NotFoundException $ex) {
return $this->response()->notFound();
* feat: OLCS packages to dev-project/messaging (#24) * feat: Internal messaging - Reply to a message - MVP (#18) * feat: Conversation Reply. Form complete with post to non functional BE. * feat: Dispatch reply to BE. Hide attachment. * feat: .phpstorm.meta.php for ocls-internal * fix: Alias Create for readability * fix: Remove strong type from close factory (#25) * fix: On successful message reply, clear the textarea (#33) * feat: Composer update for transfer/common after main merge * fix: After replying to a conversation, redirect to prevent re-submit (#41) * fix: After replying to a conversation, redirect to prevent re-submit * feat: Add flash message * feat: Messaging user level disable/enable (#37) * feat: Disable/enabling messaging * feat: Show/hide menu disable/enable commands. fix: Messaging around enable/disable * fix: Side navigation to work for all conversation section * fix: RouteParam added for all conversation controllers * feat: Unit tests for cotroller and route param * feat: Bump olcs-transfer * fix: Non local white screens when using strong types for the container (#45) * fix: Non local white screens when using strong types for the container (tests) (#47) * feat: Update messaging disable text for new AC. (#48) * feat: Create Conversation form & template (#6) * First Commit of form * Changed route to get add action * Organisation form list service * Added connection to query * modified category * Added organisatin and drop down sub category * added new controller form alter fn, removed organisation * removed broken query * Add usage of ByLicenceToOrganisation for licence list * Review suggestions * Remove extra case; Whitespace edits * Choose query based on param presence * Abstract & split controller * Review comments and housekeeping * Remove unused code for tweaking route match * Remove asserts; Whitespace * fix: Remove strong type from close factory * Fix inconsistent label * Renaming * Add data service and use in form * Update transfer * wip: so far * fix: introduced redirect by mistake for localtest * fix: reverted EnvironmentComplaintController to main * fix: remove dd * Redirection config * Whitespace * Remove unused from config * Use licence id from response to redirect * Bump transfer & common * Review suggestions --------- Co-authored-by: Jamie_gordon_1 <[email protected]> Co-authored-by: Saul Wilcox <[email protected]> Co-authored-by: wadedvsa <[email protected]> Co-authored-by: James Wragg <[email protected]> * fix: Listeners for Create Conversation controllers (#58) * Fix config to use listeners * Remove old class --------- Co-authored-by: Saul Wilcox <[email protected]> * fix: Add horizontal navgation to enable/disable messaging page (#72) * feat: Task messaging filter (home page) (#76) * feat: Task messaging filter (home page) * feat: olcs-transfer composer bump * chore: removed DataService and use one in common * Revert "chore: removed DataService and use one in common" This reverts commit 12898f1. * chore: moved dataservice for applicno to common (#80) * chore: removed DataService and use one in common * bump: olcs-common * chore: bump olcs-common and olcs-transfer * feat: Extend messaging to applications (#81) * feat: Extend support of messaging to application nav * feat: Extend support of messaging to application nav * feat: Strong type aliases * fix: Cleaner controller code * fix: declare strict_types * Revert "fix: Cleaner controller code" This reverts commit 7650b45. * fix: PR change to thrown exception * feat: Bump olcs-common * fix: Update route param test for application routes (#83) * fix: Add missing licence (and application) headers to a few messaging pages (#85) * fix: interop > psr for container and removal of createService for factories (#89) * fix: remove createService and interop for ApplicationCreateConversationControllerFactory * fix: removed interop container interface for LicenceCreateConversationControllerFactory and cleanup * fix: swap interop for psr for container in LicenceEnableDisableMessagingControllerFactory * fix: swap interop for psr for container in RouteParam/Conversation * fix: swap interop for psr for container in RouteParam/ConversationTest & cleanup imports * fix: swap interop for psr for container in ApplicationCloseConversationControllerFactory * fix: swap interop for psr for container in ApplicationConversationListControllerFactory * fix: swap interop for psr for container in ApplicationConversationMessagesControllerFactory * chore: revert composer.json/lock to use non-messaging project branches (#90) * chore: form annotation changes (#91) --------- Co-authored-by: Wade Womersley <[email protected]> Co-authored-by: Saul Wilcox <[email protected]> Co-authored-by: Jamie_gordon_1 <[email protected]> Co-authored-by: Saul Wilcox <[email protected]>
* feat: OLCS packages to dev-project/messaging (#24) * feat: Internal messaging - Reply to a message - MVP (#18) * feat: Conversation Reply. Form complete with post to non functional BE. * feat: Dispatch reply to BE. Hide attachment. * feat: .phpstorm.meta.php for ocls-internal * fix: Alias Create for readability * fix: Remove strong type from close factory (#25) * fix: On successful message reply, clear the textarea (#33) * feat: Composer update for transfer/common after main merge * fix: After replying to a conversation, redirect to prevent re-submit (#41) * fix: After replying to a conversation, redirect to prevent re-submit * feat: Add flash message * feat: Messaging user level disable/enable (#37) * feat: Disable/enabling messaging * feat: Show/hide menu disable/enable commands. fix: Messaging around enable/disable * fix: Side navigation to work for all conversation section * fix: RouteParam added for all conversation controllers * feat: Unit tests for cotroller and route param * feat: Bump olcs-transfer * fix: Non local white screens when using strong types for the container (#45) * fix: Non local white screens when using strong types for the container (tests) (#47) * feat: Update messaging disable text for new AC. (#48) * feat: Create Conversation form & template (#6) * First Commit of form * Changed route to get add action * Organisation form list service * Added connection to query * modified category * Added organisatin and drop down sub category * added new controller form alter fn, removed organisation * removed broken query * Add usage of ByLicenceToOrganisation for licence list * Review suggestions * Remove extra case; Whitespace edits * Choose query based on param presence * Abstract & split controller * Review comments and housekeeping * Remove unused code for tweaking route match * Remove asserts; Whitespace * fix: Remove strong type from close factory * Fix inconsistent label * Renaming * Add data service and use in form * Update transfer * wip: so far * fix: introduced redirect by mistake for localtest * fix: reverted EnvironmentComplaintController to main * fix: remove dd * Redirection config * Whitespace * Remove unused from config * Use licence id from response to redirect * Bump transfer & common * Review suggestions --------- Co-authored-by: Jamie_gordon_1 <[email protected]> Co-authored-by: Saul Wilcox <[email protected]> Co-authored-by: wadedvsa <[email protected]> Co-authored-by: James Wragg <[email protected]> * fix: Listeners for Create Conversation controllers (#58) * Fix config to use listeners * Remove old class --------- Co-authored-by: Saul Wilcox <[email protected]> * fix: Add horizontal navgation to enable/disable messaging page (#72) * feat: Task messaging filter (home page) (#76) * feat: Task messaging filter (home page) * feat: olcs-transfer composer bump * chore: removed DataService and use one in common * Revert "chore: removed DataService and use one in common" This reverts commit 12898f1. * chore: moved dataservice for applicno to common (#80) * chore: removed DataService and use one in common * bump: olcs-common * chore: bump olcs-common and olcs-transfer * feat: Extend messaging to applications (#81) * feat: Extend support of messaging to application nav * feat: Extend support of messaging to application nav * feat: Strong type aliases * fix: Cleaner controller code * fix: declare strict_types * Revert "fix: Cleaner controller code" This reverts commit 7650b45. * fix: PR change to thrown exception * feat: Bump olcs-common * fix: Update route param test for application routes (#83) * fix: Add missing licence (and application) headers to a few messaging pages (#85) * fix: Disable reply on closed conversations * fix: Merge bug * fix: Merge issues * fix: Merge bugs * fix: Merge error * chore: Factory cleanup --------- Co-authored-by: Saul Wilcox <[email protected]> Co-authored-by: Jamie_gordon_1 <[email protected]> Co-authored-by: Saul Wilcox <[email protected]> Co-authored-by: James Wragg <[email protected]> Co-authored-by: James Wragg <[email protected]>
* feat: OLCS packages to dev-project/messaging (dvsa/olcs-internal#24) * feat: Internal messaging - Reply to a message - MVP (dvsa/olcs-internal#18) * feat: Conversation Reply. Form complete with post to non functional BE. * feat: Dispatch reply to BE. Hide attachment. * feat: .phpstorm.meta.php for ocls-internal * fix: Alias Create for readability * fix: Remove strong type from close factory (dvsa/olcs-internal#25) * fix: On successful message reply, clear the textarea (dvsa/olcs-internal#33) * feat: Composer update for transfer/common after main merge * fix: After replying to a conversation, redirect to prevent re-submit (dvsa/olcs-internal#41) * fix: After replying to a conversation, redirect to prevent re-submit * feat: Add flash message * feat: Messaging user level disable/enable (dvsa/olcs-internal#37) * feat: Disable/enabling messaging * feat: Show/hide menu disable/enable commands. fix: Messaging around enable/disable * fix: Side navigation to work for all conversation section * fix: RouteParam added for all conversation controllers * feat: Unit tests for cotroller and route param * feat: Bump olcs-transfer * fix: Non local white screens when using strong types for the container (dvsa/olcs-internal#45) * fix: Non local white screens when using strong types for the container (tests) (dvsa/olcs-internal#47) * feat: Update messaging disable text for new AC. (dvsa/olcs-internal#48) * feat: Create Conversation form & template (dvsa/olcs-internal#6) * First Commit of form * Changed route to get add action * Organisation form list service * Added connection to query * modified category * Added organisatin and drop down sub category * added new controller form alter fn, removed organisation * removed broken query * Add usage of ByLicenceToOrganisation for licence list * Review suggestions * Remove extra case; Whitespace edits * Choose query based on param presence * Abstract & split controller * Review comments and housekeeping * Remove unused code for tweaking route match * Remove asserts; Whitespace * fix: Remove strong type from close factory * Fix inconsistent label * Renaming * Add data service and use in form * Update transfer * wip: so far * fix: introduced redirect by mistake for localtest * fix: reverted EnvironmentComplaintController to main * fix: remove dd * Redirection config * Whitespace * Remove unused from config * Use licence id from response to redirect * Bump transfer & common * Review suggestions --------- Co-authored-by: Jamie_gordon_1 <[email protected]> Co-authored-by: Saul Wilcox <[email protected]> Co-authored-by: wadedvsa <[email protected]> Co-authored-by: James Wragg <[email protected]> * fix: Listeners for Create Conversation controllers (dvsa/olcs-internal#58) * Fix config to use listeners * Remove old class --------- Co-authored-by: Saul Wilcox <[email protected]> * fix: Add horizontal navgation to enable/disable messaging page (dvsa/olcs-internal#72) * feat: Task messaging filter (home page) (dvsa/olcs-internal#76) * feat: Task messaging filter (home page) * feat: olcs-transfer composer bump * chore: removed DataService and use one in common * Revert "chore: removed DataService and use one in common" This reverts commit 12898f1a8d72d96f1cb448e0d0bbd1da45e8908b. * chore: moved dataservice for applicno to common (dvsa/olcs-internal#80) * chore: removed DataService and use one in common * bump: olcs-common * chore: bump olcs-common and olcs-transfer * feat: Extend messaging to applications (dvsa/olcs-internal#81) * feat: Extend support of messaging to application nav * feat: Extend support of messaging to application nav * feat: Strong type aliases * fix: Cleaner controller code * fix: declare strict_types * Revert "fix: Cleaner controller code" This reverts commit 7650b454036e4c1f2c1badae5b416434c5b82270. * fix: PR change to thrown exception * feat: Bump olcs-common * fix: Update route param test for application routes (dvsa/olcs-internal#83) * fix: Add missing licence (and application) headers to a few messaging pages (dvsa/olcs-internal#85) * fix: interop > psr for container and removal of createService for factories (dvsa/olcs-internal#89) * fix: remove createService and interop for ApplicationCreateConversationControllerFactory * fix: removed interop container interface for LicenceCreateConversationControllerFactory and cleanup * fix: swap interop for psr for container in LicenceEnableDisableMessagingControllerFactory * fix: swap interop for psr for container in RouteParam/Conversation * fix: swap interop for psr for container in RouteParam/ConversationTest & cleanup imports * fix: swap interop for psr for container in ApplicationCloseConversationControllerFactory * fix: swap interop for psr for container in ApplicationConversationListControllerFactory * fix: swap interop for psr for container in ApplicationConversationMessagesControllerFactory * chore: revert composer.json/lock to use non-messaging project branches (dvsa/olcs-internal#90) * chore: form annotation changes (dvsa/olcs-internal#91) --------- Co-authored-by: Wade Womersley <[email protected]> Co-authored-by: Saul Wilcox <[email protected]> Co-authored-by: Jamie_gordon_1 <[email protected]> Co-authored-by: Saul Wilcox <[email protected]>
* feat: OLCS packages to dev-project/messaging (dvsa/olcs-internal#24) * feat: Internal messaging - Reply to a message - MVP (dvsa/olcs-internal#18) * feat: Conversation Reply. Form complete with post to non functional BE. * feat: Dispatch reply to BE. Hide attachment. * feat: .phpstorm.meta.php for ocls-internal * fix: Alias Create for readability * fix: Remove strong type from close factory (dvsa/olcs-internal#25) * fix: On successful message reply, clear the textarea (dvsa/olcs-internal#33) * feat: Composer update for transfer/common after main merge * fix: After replying to a conversation, redirect to prevent re-submit (dvsa/olcs-internal#41) * fix: After replying to a conversation, redirect to prevent re-submit * feat: Add flash message * feat: Messaging user level disable/enable (dvsa/olcs-internal#37) * feat: Disable/enabling messaging * feat: Show/hide menu disable/enable commands. fix: Messaging around enable/disable * fix: Side navigation to work for all conversation section * fix: RouteParam added for all conversation controllers * feat: Unit tests for cotroller and route param * feat: Bump olcs-transfer * fix: Non local white screens when using strong types for the container (dvsa/olcs-internal#45) * fix: Non local white screens when using strong types for the container (tests) (dvsa/olcs-internal#47) * feat: Update messaging disable text for new AC. (dvsa/olcs-internal#48) * feat: Create Conversation form & template (dvsa/olcs-internal#6) * First Commit of form * Changed route to get add action * Organisation form list service * Added connection to query * modified category * Added organisatin and drop down sub category * added new controller form alter fn, removed organisation * removed broken query * Add usage of ByLicenceToOrganisation for licence list * Review suggestions * Remove extra case; Whitespace edits * Choose query based on param presence * Abstract & split controller * Review comments and housekeeping * Remove unused code for tweaking route match * Remove asserts; Whitespace * fix: Remove strong type from close factory * Fix inconsistent label * Renaming * Add data service and use in form * Update transfer * wip: so far * fix: introduced redirect by mistake for localtest * fix: reverted EnvironmentComplaintController to main * fix: remove dd * Redirection config * Whitespace * Remove unused from config * Use licence id from response to redirect * Bump transfer & common * Review suggestions --------- Co-authored-by: Jamie_gordon_1 <[email protected]> Co-authored-by: Saul Wilcox <[email protected]> Co-authored-by: wadedvsa <[email protected]> Co-authored-by: James Wragg <[email protected]> * fix: Listeners for Create Conversation controllers (dvsa/olcs-internal#58) * Fix config to use listeners * Remove old class --------- Co-authored-by: Saul Wilcox <[email protected]> * fix: Add horizontal navgation to enable/disable messaging page (dvsa/olcs-internal#72) * feat: Task messaging filter (home page) (dvsa/olcs-internal#76) * feat: Task messaging filter (home page) * feat: olcs-transfer composer bump * chore: removed DataService and use one in common * Revert "chore: removed DataService and use one in common" This reverts commit 12898f1a8d72d96f1cb448e0d0bbd1da45e8908b. * chore: moved dataservice for applicno to common (dvsa/olcs-internal#80) * chore: removed DataService and use one in common * bump: olcs-common * chore: bump olcs-common and olcs-transfer * feat: Extend messaging to applications (dvsa/olcs-internal#81) * feat: Extend support of messaging to application nav * feat: Extend support of messaging to application nav * feat: Strong type aliases * fix: Cleaner controller code * fix: declare strict_types * Revert "fix: Cleaner controller code" This reverts commit 7650b454036e4c1f2c1badae5b416434c5b82270. * fix: PR change to thrown exception * feat: Bump olcs-common * fix: Update route param test for application routes (dvsa/olcs-internal#83) * fix: Add missing licence (and application) headers to a few messaging pages (dvsa/olcs-internal#85) * fix: Disable reply on closed conversations * fix: Merge bug * fix: Merge issues * fix: Merge bugs * fix: Merge error * chore: Factory cleanup --------- Co-authored-by: Saul Wilcox <[email protected]> Co-authored-by: Jamie_gordon_1 <[email protected]> Co-authored-by: Saul Wilcox <[email protected]> Co-authored-by: James Wragg <[email protected]> Co-authored-by: James Wragg <[email protected]>
Description
Extend support of messaging to application routes
Related issue: VOL-4921
Before submitting (or marking as "ready for review")