Skip to content

Commit

Permalink
Updated addon feature links for browserrouter
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Kolstad committed May 7, 2021
1 parent 5330126 commit 13af1cf
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 22 deletions.
4 changes: 2 additions & 2 deletions snapshots/src/lib/addons/datadog.test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Generated by [AVA](https://avajs.dev).

> Snapshot 1
'{"text":"%%% \\n some@user.com created feature toggle [some-toggle](http://some-url.com/#/features/strategies/some-toggle)\\n**Enabled**: no | **Type**: undefined | **Project**: undefined\\n**Activation strategies**: ```- name: default\\n``` \\n %%% ","title":"Unleash notification update"}'
'{"text":"%%% \\n some@user.com created feature toggle [some-toggle](http://some-url.com/features/strategies/some-toggle)\\n**Enabled**: no | **Type**: undefined | **Project**: undefined\\n**Activation strategies**: ```- name: default\\n``` \\n %%% ","title":"Unleash notification update"}'

## Should call datadog webhook for archived toggle

> Snapshot 1
'{"text":"%%% \\n The feature toggle *[some-toggle](http://some-url.com/#/archive/strategies/some-toggle)* was *archived* by some@user.com. \\n %%% ","title":"Unleash notification update"}'
'{"text":"%%% \\n The feature toggle *[some-toggle](http://some-url.com/archive/strategies/some-toggle)* was *archived* by some@user.com. \\n %%% ","title":"Unleash notification update"}'
Binary file modified snapshots/src/lib/addons/datadog.test.js.snap
Binary file not shown.
4 changes: 2 additions & 2 deletions snapshots/src/lib/addons/slack.test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Generated by [AVA](https://avajs.dev).

> Snapshot 1
'{"username":"Unleash","icon_emoji":":unleash:","text":"some@user.com created feature toggle <http://some-url.com/#/features/strategies/some-toggle|some-toggle>\\n*Enabled*: no | *Type*: undefined | *Project*: undefined\\n*Activation strategies*: ```- name: default\\n```","channel":"#undefined","attachments":[{"actions":[{"name":"featureToggle","text":"Open in Unleash","type":"button","value":"featureToggle","style":"primary","url":"http://some-url.com/#/features/strategies/some-toggle"}]}]}'
'{"username":"Unleash","icon_emoji":":unleash:","text":"some@user.com created feature toggle <http://some-url.com/features/strategies/some-toggle|some-toggle>\\n*Enabled*: no | *Type*: undefined | *Project*: undefined\\n*Activation strategies*: ```- name: default\\n```","channel":"#undefined","attachments":[{"actions":[{"name":"featureToggle","text":"Open in Unleash","type":"button","value":"featureToggle","style":"primary","url":"http://some-url.com/features/strategies/some-toggle"}]}]}'

## Should call slack webhook for archived toggle

> Snapshot 1
'{"username":"Unleash","icon_emoji":":unleash:","text":"The feature toggle *<http://some-url.com/#/archive/strategies/some-toggle|some-toggle>* was *archived* by some@user.com.","channel":"#undefined","attachments":[{"actions":[{"name":"featureToggle","text":"Open in Unleash","type":"button","value":"featureToggle","style":"primary","url":"http://some-url.com/#/archive/strategies/some-toggle"}]}]}'
'{"username":"Unleash","icon_emoji":":unleash:","text":"The feature toggle *<http://some-url.com/archive/strategies/some-toggle|some-toggle>* was *archived* by some@user.com.","channel":"#undefined","attachments":[{"actions":[{"name":"featureToggle","text":"Open in Unleash","type":"button","value":"featureToggle","style":"primary","url":"http://some-url.com/archive/strategies/some-toggle"}]}]}'
Binary file modified snapshots/src/lib/addons/slack.test.js.snap
Binary file not shown.
16 changes: 2 additions & 14 deletions snapshots/src/lib/addons/teams.test.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,14 @@ The actual snapshot is saved in `teams.test.js.snap`.

Generated by [AVA](https://avajs.dev).

## Should call slack webhook

> Snapshot 1
'{"themeColor":"0076D7","summary":"Message","sections":[{"activityTitle":"Feature toggle some-toggle | *Type*: undefined | *Project*: undefined <br /> *Activation strategies*: \\n- name: default\\n","activitySubtitle":"Unleash notification update","facts":[{"name":"User","value":"some@user.com"},{"name":"Action","value":"Create"},{"name":"Enabled","value":"*no*"}]}],"potentialAction":[{"@type":"OpenUri","name":"Go to feature","targets":[{"os":"default","uri":"http://some-url.com/#/features/strategies/some-toggle"}]}]}'

## Should call slack webhook for archived toggle

> Snapshot 1
'{"themeColor":"0076D7","summary":"Message","sections":[{"activityTitle":"The feature toggle *some-toggle* was *archived*","activitySubtitle":"Unleash notification update","facts":[{"name":"User","value":"some@user.com"},{"name":"Action","value":"feature-archived"},{"name":"Enabled","value":"*no*"}]}],"potentialAction":[{"@type":"OpenUri","name":"Go to feature","targets":[{"os":"default","uri":"http://some-url.com/#/archive/strategies/some-toggle"}]}]}'

## Should call teams webhook

> Snapshot 1
'{"themeColor":"0076D7","summary":"Message","sections":[{"activityTitle":"Feature toggle some-toggle | *Type*: undefined | *Project*: undefined <br /> *Activation strategies*: \\n- name: default\\n","activitySubtitle":"Unleash notification update","facts":[{"name":"User","value":"some@user.com"},{"name":"Action","value":"Create"},{"name":"Enabled","value":"*no*"}]}],"potentialAction":[{"@type":"OpenUri","name":"Go to feature","targets":[{"os":"default","uri":"http://some-url.com/#/features/strategies/some-toggle"}]}]}'
'{"themeColor":"0076D7","summary":"Message","sections":[{"activityTitle":"Feature toggle some-toggle | *Type*: undefined | *Project*: undefined <br /> *Activation strategies*: \\n- name: default\\n","activitySubtitle":"Unleash notification update","facts":[{"name":"User","value":"some@user.com"},{"name":"Action","value":"Create"},{"name":"Enabled","value":"*no*"}]}],"potentialAction":[{"@type":"OpenUri","name":"Go to feature","targets":[{"os":"default","uri":"http://some-url.com/features/strategies/some-toggle"}]}]}'

## Should call teams webhook for archived toggle

> Snapshot 1
'{"themeColor":"0076D7","summary":"Message","sections":[{"activityTitle":"The feature toggle *some-toggle* was *archived*","activitySubtitle":"Unleash notification update","facts":[{"name":"User","value":"some@user.com"},{"name":"Action","value":"feature-archived"},{"name":"Enabled","value":"*no*"}]}],"potentialAction":[{"@type":"OpenUri","name":"Go to feature","targets":[{"os":"default","uri":"http://some-url.com/#/archive/strategies/some-toggle"}]}]}'
'{"themeColor":"0076D7","summary":"Message","sections":[{"activityTitle":"The feature toggle *some-toggle* was *archived*","activitySubtitle":"Unleash notification update","facts":[{"name":"User","value":"some@user.com"},{"name":"Action","value":"feature-archived"},{"name":"Enabled","value":"*no*"}]}],"potentialAction":[{"@type":"OpenUri","name":"Go to feature","targets":[{"os":"default","uri":"http://some-url.com/archive/strategies/some-toggle"}]}]}'
Binary file modified snapshots/src/lib/addons/teams.test.js.snap
Binary file not shown.
4 changes: 2 additions & 2 deletions src/lib/addons/datadog.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class DatadogAddon extends Addon {

featureLink(event) {
const path = event.type === FEATURE_ARCHIVED ? 'archive' : 'features';
return `${this.unleashUrl}/#/${path}/strategies/${event.data.name}`;
return `${this.unleashUrl}/${path}/strategies/${event.data.name}`;
}

generateStaleText(event) {
Expand All @@ -69,7 +69,7 @@ class DatadogAddon extends Addon {
const feature = `[${data.name}](${this.featureLink(event)})`;

if (isStale) {
return `The feature toggle *${feature}* is now *ready to be removed* from the code.
return `The feature toggle *${feature}* is now *ready to be removed* from the code.
This was changed by ${createdBy}.`;
}
return `The feature toggle *${feature}* was *unmarked as stale* by ${createdBy}.`;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/addons/jira-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class JiraAddon extends Addon {
{
type: 'link',
attrs: {
href: `${this.unleashUrl}/#/features/strategies/${featureName}`,
href: `${this.unleashUrl}/features/strategies/${featureName}`,
title: 'Visit Unleash Admin UI',
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/lib/addons/teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class TeamsAddon extends Addon {

featureLink(event) {
const path = event.type === FEATURE_ARCHIVED ? 'archive' : 'features';
return `${this.unleashUrl}/#/${path}/strategies/${event.data.name}`;
return `${this.unleashUrl}/${path}/strategies/${event.data.name}`;
}

generateStaleText(event) {
Expand Down

0 comments on commit 13af1cf

Please sign in to comment.