Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Update design to allow custom attributes in call to Notification service #51

Merged
merged 14 commits into from
Dec 22, 2017

Conversation

sbose78
Copy link
Member

@sbose78 sbose78 commented Dec 18, 2017

Added support for passing a custom parameter to the notify API.
This would be used to pass the verifyCode for an updated email.

Part of fabric8-services/fabric8-auth#62

main.go Outdated
@@ -78,6 +78,7 @@ func main() {
resolvers.Register("workitem.update", collector.ConfiguredVars(config, collector.NewWorkItemResolver(witClient)))
resolvers.Register("comment.create", collector.ConfiguredVars(config, collector.NewCommentResolver(witClient)))
resolvers.Register("comment.update", collector.ConfiguredVars(config, collector.NewCommentResolver(witClient)))
resolvers.Register("user.email.update", collector.ConfiguredVars(config, collector.NewUserResolver(witClient)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing template ?

Copy link
Member Author

Choose a reason for hiding this comment

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

added a fork of workitem.update template where I stripped out almost everything. Will make it look pretty 8f42085

@sbose78 sbose78 changed the title WIP : update design to allow custom attr WIP : update design to allow custom attributes in call to Notification service Dec 18, 2017
@sbose78
Copy link
Member Author

sbose78 commented Dec 18, 2017

Used the workitem.update template to have a super simple email verification template till have something nicer done ( by myself or UX :) )

screenshot from 2017-12-18 20-33-50

@sbose78 sbose78 changed the title WIP : update design to allow custom attributes in call to Notification service Update design to allow custom attributes in call to Notification service Dec 19, 2017
@@ -80,6 +81,13 @@ func (a *AsyncWorkerNotifier) do(cn contextualNotification) {

return
}

if vars == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't assume vars is null here..

Copy link
Member Author

Choose a reason for hiding this comment

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

right, my bad..

max-width: 700px;
text-align: left;">
<h3 style="margin-bottom: 5px;">
<a href="{{.custom.VerifyURL }}" style="
Copy link
Contributor

Choose a reason for hiding this comment

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

Normal would be a camelcase style variable..

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -0,0 +1,2 @@
In-Reply-To: <workitems/{{.workitem.Data.ID}}@notify.openshift.io>
Copy link
Contributor

Choose a reason for hiding this comment

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

No workitem in the auth context. None of these headers make any sense.. ?

Copy link
Member Author

Choose a reason for hiding this comment

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

removed it :)

@sbose78
Copy link
Member Author

sbose78 commented Dec 19, 2017

@aslakknutsen , thank you for the review - I've addressed the comments.

Copy link
Contributor

@aslakknutsen aslakknutsen left a comment

Choose a reason for hiding this comment

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

A test case to cover just custom vars?

@sbose78
Copy link
Member Author

sbose78 commented Dec 21, 2017

Thanks @aslakknutsen

added some more tests

@sbose78
Copy link
Member Author

sbose78 commented Dec 21, 2017

Added a validator of the optional custom param.
3d55bbf

@aslakknutsen aslakknutsen merged commit 354d927 into fabric8-services:master Dec 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants