From 13af1cf9ab8a544e9d1ff13b097002d67a0bc949 Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Fri, 7 May 2021 14:05:42 +0200 Subject: [PATCH] Updated addon feature links for browserrouter --- snapshots/src/lib/addons/datadog.test.js.md | 4 ++-- snapshots/src/lib/addons/datadog.test.js.snap | Bin 378 -> 376 bytes snapshots/src/lib/addons/slack.test.js.md | 4 ++-- snapshots/src/lib/addons/slack.test.js.snap | Bin 459 -> 447 bytes snapshots/src/lib/addons/teams.test.js.md | 16 ++-------------- snapshots/src/lib/addons/teams.test.js.snap | Bin 569 -> 499 bytes src/lib/addons/datadog.js | 4 ++-- src/lib/addons/jira-comment.js | 2 +- src/lib/addons/teams.js | 2 +- 9 files changed, 10 insertions(+), 22 deletions(-) diff --git a/snapshots/src/lib/addons/datadog.test.js.md b/snapshots/src/lib/addons/datadog.test.js.md index 8844ec68a7..ccff468334 100644 --- a/snapshots/src/lib/addons/datadog.test.js.md +++ b/snapshots/src/lib/addons/datadog.test.js.md @@ -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"}' diff --git a/snapshots/src/lib/addons/datadog.test.js.snap b/snapshots/src/lib/addons/datadog.test.js.snap index da521e2b0916e334349828bdbae65c18ec27d72c..cc5663f2b2eb49181f273c681d20ec71f7e1b105 100644 GIT binary patch literal 376 zcmV-;0f+uURzV=v1SJ6x7na$1``*mX+mJC=`yUWI3~Jp|s+hyM$-thOXy%P*ad+9o#B%)RidfK%`L+#?UgM z&Z+bP14W%;9|zM2qq!yp)9g-)$77z^?sCv7UUr9J+L)@q9L9VMD6#+-+sGPnTF ztNkw8v`{g&q%w^yx~H>ajA-J*>bE13JwY-vum0|0S&c@+2PHZff}x8drJ6FB9nVhb zZnz{VMKkn)N>SvA=})pHqfxP<8=GS8<%ClMHtke3!D(Ok-^K_XC9;RV`NH8;?t-gU^&xluCU~sx`Zd>25zZTf|`OX?che9p{|5!2SSa4FoKo| zxkjM0-A)h=EXx}v^_7^Y8~FYJ%XMOf{<1%kWPV24)M!h4{E@BJ6z5w?G!u+C4?v}G z2Ao&>U9@SgB5X-zT3d8Sr-vBQ*oD<^h9rA}WNP01-NmvRjfMwGbT9xz7kNT8WiUIS zozpG5Bq>2N_MS>mWU=W_vL(Y|vAi3ZV($5vS9fgEt7?ps&hWojBXk(c9{%PGhhvce YAF(11&HnheRQ@~17Xov_tS$lo09n+nga7~l diff --git a/snapshots/src/lib/addons/slack.test.js.md b/snapshots/src/lib/addons/slack.test.js.md index fca1f23fcb..75384818fa 100644 --- a/snapshots/src/lib/addons/slack.test.js.md +++ b/snapshots/src/lib/addons/slack.test.js.md @@ -8,10 +8,10 @@ Generated by [AVA](https://avajs.dev). > Snapshot 1 - '{"username":"Unleash","icon_emoji":":unleash:","text":"some@user.com created feature 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 \\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 ** 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 ** 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"}]}]}' diff --git a/snapshots/src/lib/addons/slack.test.js.snap b/snapshots/src/lib/addons/slack.test.js.snap index 5f6729f149f0b9fee6d56231c3375a87f80ad758..b6ea01603f972470b618b295bae4c7719a305d9e 100644 GIT binary patch literal 447 zcmV;w0YLsiRzV9m7ng1t{fIEW*Mb@H{nJ!Pk5rhC&}v#hTlz{$UGb@U_r0T*s0 z?p#&xZY&}qZe|W$_4-wH*L$5X#s=81O>b`=S9V6D^M|R4`^kuf@0FIbqvx41{~{IK zU5V?}?WluZ4l*{#Mmnr$h>Z_CMaQD_;EXIlBx1wlAblogg;v(=LSgqc!AaT06WTyH zM1s66U@272D_d~oKq91kkCxH_N84!Rz!x&aW>TpH@?7ciz^(K+zT(kQQA39?5V}Pt zAL7L=6R#Lq&moNyZY)3Hakbq9N=lQ$o;GwQVe8KBgTjw6RW2*kEs5G1-am>swOVbC zhk+ALWLf68WeB6$R3?pqoW`4eZ$z*}lqxI0pcl#Jv5+b>?Z!RfdP7w^*Y2yd)&#?~ z;eB0^u1_2F644sUTQV=dYv8e+2fXQYAzhmg(vR{#C@N03>HlQ=#b0f&X7JVI_*<8y pQ<-kTZ%mH)f%H7?RirVmxA~{%HUEFD`B{dpGjB`-wHnI<003T<)?oku literal 459 zcmV;+0W|(WRzV6a8dSHy?`#00000000Bk zQax`JF%b3MiBLrm)QMy{MWj_O+pkar#fcJ%qsj;8^GiSKcG#S zACW(hCUhx6O+&-@cEu%8Kg@nE8g8Vao@;M0a=`KWBCb>2eS$&sZ9n)+R&+ly>@m23U9+y`9h(d zO4Qcy#Zkl=4u?G+Mou}AWnJLDA&jO|xikg}8gTP>BZ4KORCx&oy-4?tg;b$w6SvZ} zLk;HFUg-3y0>ic83uTe6PaC5e(HhF9vZx3Q5%WHBGj_?<_#^FQ13cOe>gegVlVjjYoH004>M B(vScE diff --git a/snapshots/src/lib/addons/teams.test.js.md b/snapshots/src/lib/addons/teams.test.js.md index e37e533fad..578272830e 100644 --- a/snapshots/src/lib/addons/teams.test.js.md +++ b/snapshots/src/lib/addons/teams.test.js.md @@ -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
*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
*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
*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"}]}]}' diff --git a/snapshots/src/lib/addons/teams.test.js.snap b/snapshots/src/lib/addons/teams.test.js.snap index 73e21a6dc2ce8b76877c48059777d4e41f38a83d..f441beecb951c172dc97f9103e2b653e8200f181 100644 GIT binary patch literal 499 zcmVw1boT<<7`wpZq6P8X_S!_!10! z6yS3(BN&hvSo!(lz;$6lf?Ljh_ulin_j67N>652hFMlkyPcH7f-a0<|{^77k;&ZD{ z$nm$g{MDNqn_u$ncV9ofzwEW>=M6$O$n}=h+ax#p*ZK?QE2!bXC}Ua9c6N5}KGP!v8w0=SPXx;$N zY0w2srG_G6kF9x*j#uD&V@tF9lATMmBl_S*(J z%mWM2vO_u4VyvL(aJV*{Ezg(d1J)Q1+DoC5QH-$Xu^gnGG@wtdL}7AzXs}H>T@{P4 z7q*0y+u)0(4)9YzUCt`+n>@?f?t@h^e3s-c``u&K8BUvPdF4`k?ESS%F{)sle|<4{ p=WtFhgri*8NhN1c@P9kX6m+=G8RzVKhB;@FjV*+4c(b^9(}w7N2|{E^Y5!d$zc>@%3%fE6~|_ zgtopsr%w+~&m9L#FFqZ;+4ltiv`{E}bLd>{RBcFf3>mD8R7et#<>i&@w^m4< zD3fJO4lHyVlwv(_7=$_zT#?}ZkTARMCwkCIbPATX0ZbbSSc_gS1*}8{jdJ}6)7Bsd z8eqdC=q4N@hux9lp;bHq-{?r}-^6sysWZ15R$4L*y#$nH?(zoaEQ0{s3T9Hh%dN4A zm%FB;OFKI}1*T%mg-*IjIF>SbWTk9D*H(;=;lvzWfwXv^rN(_a_p8QYS3{AJQT-=x ztw^B4T$kV^E0iW@ofM)9hjKy5s6A@eNiH;Sov^eNau!y#4ad^9bKpBNv4y45rm$(^ z?l@QrYbJY8`WE&@$_(r;W9tGEYn=zaUu17&>dgC>{Zc^rzmoJT?J1m%PF#z3-XFUb ztr#XJm|P87*_`4%rZ8nPjFUb@^zSyaG}@Th`KQ}jn*9B)PKSLu?9*ZYe~0}C4?nc2 HNC*G`$3qU& diff --git a/src/lib/addons/datadog.js b/src/lib/addons/datadog.js index c7acc0c5d4..77f1aeabd8 100644 --- a/src/lib/addons/datadog.js +++ b/src/lib/addons/datadog.js @@ -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) { @@ -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}.`; diff --git a/src/lib/addons/jira-comment.js b/src/lib/addons/jira-comment.js index 1ec7942515..4b9f9818bf 100644 --- a/src/lib/addons/jira-comment.js +++ b/src/lib/addons/jira-comment.js @@ -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', }, }, diff --git a/src/lib/addons/teams.js b/src/lib/addons/teams.js index 13d1c07248..7d24575510 100644 --- a/src/lib/addons/teams.js +++ b/src/lib/addons/teams.js @@ -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) {