Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amundsen_dev
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Surendar Reddy Mangannagari
amundsen_dev
Commits
15d9c3ca
Unverified
Commit
15d9c3ca
authored
Oct 16, 2019
by
Tamika Tannis
Committed by
GitHub
Oct 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add source for notification email links (#312)
* Add source for notification email links * Update TableDetail logic
parent
97678d63
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
notification_utils.py
amundsen_application/api/utils/notification_utils.py
+2
-2
index.tsx
...en_application/static/js/components/TableDetail/index.tsx
+1
-1
test_utils.py
tests/unit/utils/notification/test_utils.py
+8
-8
No files found.
amundsen_application/api/utils/notification_utils.py
View file @
15d9c3ca
...
@@ -86,8 +86,8 @@ def get_notification_html(*, notification_type: str, options: Dict, sender: str)
...
@@ -86,8 +86,8 @@ def get_notification_html(*, notification_type: str, options: Dict, sender: str)
validate_options
(
options
=
options
)
validate_options
(
options
=
options
)
url_base
=
app
.
config
[
'FRONTEND_BASE'
]
url_base
=
app
.
config
[
'FRONTEND_BASE'
]
resource_url
=
'{url_base}{resource_path}'
.
format
(
resource_path
=
options
.
get
(
'resource_path'
),
resource_url
=
'{url_base}{resource_path}
?source=notification
'
.
format
(
resource_path
=
options
.
get
(
'resource_path'
),
url_base
=
url_base
)
url_base
=
url_base
)
joined_chars
=
resource_url
[
len
(
url_base
)
-
1
:
len
(
url_base
)
+
1
]
joined_chars
=
resource_url
[
len
(
url_base
)
-
1
:
len
(
url_base
)
+
1
]
if
joined_chars
.
count
(
'/'
)
!=
1
:
if
joined_chars
.
count
(
'/'
)
!=
1
:
raise
Exception
(
'Configured "FRONTEND_BASE" and "resource_path" do not form a valid url'
)
raise
Exception
(
'Configured "FRONTEND_BASE" and "resource_path" do not form a valid url'
)
...
...
amundsen_application/static/js/components/TableDetail/index.tsx
View file @
15d9c3ca
...
@@ -123,7 +123,7 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone
...
@@ -123,7 +123,7 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone
const
searchIndex
=
params
[
'index'
];
const
searchIndex
=
params
[
'index'
];
const
source
=
params
[
'source'
];
const
source
=
params
[
'source'
];
/* update the url stored in the browser history to remove params used for logging purposes */
/* update the url stored in the browser history to remove params used for logging purposes */
if
(
searchIndex
!==
undefined
)
{
if
(
searchIndex
!==
undefined
||
source
!==
undefined
)
{
window
.
history
.
replaceState
({},
''
,
`
${
window
.
location
.
origin
}${
window
.
location
.
pathname
}
`
);
window
.
history
.
replaceState
({},
''
,
`
${
window
.
location
.
origin
}${
window
.
location
.
pathname
}
`
);
}
}
...
...
tests/unit/utils/notification/test_utils.py
View file @
15d9c3ca
...
@@ -110,7 +110,7 @@ class NotificationUtilsTest(unittest.TestCase):
...
@@ -110,7 +110,7 @@ class NotificationUtilsTest(unittest.TestCase):
options
=
test_options
,
options
=
test_options
,
sender
=
test_sender
)
sender
=
test_sender
)
expectedHTML
=
(
'Hello,<br/><br/>You have been added to the owners list of the '
expectedHTML
=
(
'Hello,<br/><br/>You have been added to the owners list of the '
'<a href="http://0.0.0.0:5000/testpath">testtable</a>'
'<a href="http://0.0.0.0:5000/testpath
?source=notification
">testtable</a>'
' dataset by test@test.com.<br/><br/>What is expected of you?<br/>As an owner, you take an '
' dataset by test@test.com.<br/><br/>What is expected of you?<br/>As an owner, you take an '
'important part in making sure that the datasets you own can be used as swiftly as possible '
'important part in making sure that the datasets you own can be used as swiftly as possible '
'across the company.<br/>Make sure the metadata is correct and up to date.<br/><br/>If you '
'across the company.<br/>Make sure the metadata is correct and up to date.<br/><br/>If you '
...
@@ -132,9 +132,9 @@ class NotificationUtilsTest(unittest.TestCase):
...
@@ -132,9 +132,9 @@ class NotificationUtilsTest(unittest.TestCase):
options
=
test_options
,
options
=
test_options
,
sender
=
test_sender
)
sender
=
test_sender
)
expectedHTML
=
(
'Hello,<br/><br/>You have been removed from the owners list of the '
expectedHTML
=
(
'Hello,<br/><br/>You have been removed from the owners list of the '
'<a href="http://0.0.0.0:5000/testpath
">testtable</a> dataset by test@test.com.<br/><br/>If you
'
'<a href="http://0.0.0.0:5000/testpath
?source=notification">testtable</a> dataset by
'
' t
hink you have been incorrectly removed as an owner, add yourself back to the owners list.
'
' t
est@test.com.<br/><br/>If you think you have been incorrectly removed as an owner,
'
'<br/><br/>Thanks,<br/>Amundsen Team'
)
'
add yourself back to the owners list.
<br/><br/>Thanks,<br/>Amundsen Team'
)
self
.
assertEqual
(
html
,
expectedHTML
)
self
.
assertEqual
(
html
,
expectedHTML
)
def
test_get_notification_html_requested_success_all_fields
(
self
)
->
None
:
def
test_get_notification_html_requested_success_all_fields
(
self
)
->
None
:
...
@@ -156,7 +156,7 @@ class NotificationUtilsTest(unittest.TestCase):
...
@@ -156,7 +156,7 @@ class NotificationUtilsTest(unittest.TestCase):
options
=
test_options
,
options
=
test_options
,
sender
=
test_sender
)
sender
=
test_sender
)
expectedHTML
=
(
'Hello,<br/><br/>test@test.com is trying to use '
expectedHTML
=
(
'Hello,<br/><br/>test@test.com is trying to use '
'<a href="http://0.0.0.0:5000/testpath">testtable</a>, '
'<a href="http://0.0.0.0:5000/testpath
?source=notification
">testtable</a>, '
'and requests improved table and column descriptions.<br/><br/>test@test.com has included the '
'and requests improved table and column descriptions.<br/><br/>test@test.com has included the '
'following information with their request:<br/>Test Comment<br/><br/>Please visit the provided '
'following information with their request:<br/>Test Comment<br/><br/>Please visit the provided '
'link and improve descriptions on that resource.<br/><br/>Thanks,<br/>Amundsen Team'
)
'link and improve descriptions on that resource.<br/><br/>Thanks,<br/>Amundsen Team'
)
...
@@ -180,7 +180,7 @@ class NotificationUtilsTest(unittest.TestCase):
...
@@ -180,7 +180,7 @@ class NotificationUtilsTest(unittest.TestCase):
options
=
test_options
,
options
=
test_options
,
sender
=
test_sender
)
sender
=
test_sender
)
expectedHTML
=
(
'Hello,<br/><br/>test@test.com is trying to use '
expectedHTML
=
(
'Hello,<br/><br/>test@test.com is trying to use '
'<a href="http://0.0.0.0:5000/testpath">testtable</a>, and requests '
'<a href="http://0.0.0.0:5000/testpath
?source=notification
">testtable</a>, and requests '
'an improved table description.<br/><br/>Please visit the provided link and improve '
'an improved table description.<br/><br/>Please visit the provided link and improve '
'descriptions on that resource.<br/><br/>Thanks,<br/>Amundsen Team'
)
'descriptions on that resource.<br/><br/>Thanks,<br/>Amundsen Team'
)
self
.
assertEqual
(
html
,
expectedHTML
)
self
.
assertEqual
(
html
,
expectedHTML
)
...
@@ -203,7 +203,7 @@ class NotificationUtilsTest(unittest.TestCase):
...
@@ -203,7 +203,7 @@ class NotificationUtilsTest(unittest.TestCase):
options
=
test_options
,
options
=
test_options
,
sender
=
test_sender
)
sender
=
test_sender
)
expectedHTML
=
(
'Hello,<br/><br/>test@test.com is trying to use '
expectedHTML
=
(
'Hello,<br/><br/>test@test.com is trying to use '
'<a href="http://0.0.0.0:5000/testpath">testtable</a>, and requests '
'<a href="http://0.0.0.0:5000/testpath
?source=notification
">testtable</a>, and requests '
'improved column descriptions.<br/><br/>Please visit the provided link and improve '
'improved column descriptions.<br/><br/>Please visit the provided link and improve '
'descriptions on that resource.<br/><br/>Thanks,<br/>Amundsen Team'
)
'descriptions on that resource.<br/><br/>Thanks,<br/>Amundsen Team'
)
self
.
assertEqual
(
html
,
expectedHTML
)
self
.
assertEqual
(
html
,
expectedHTML
)
...
@@ -225,7 +225,7 @@ class NotificationUtilsTest(unittest.TestCase):
...
@@ -225,7 +225,7 @@ class NotificationUtilsTest(unittest.TestCase):
options
=
test_options
,
options
=
test_options
,
sender
=
test_sender
)
sender
=
test_sender
)
expectedHTML
=
(
'Hello,<br/><br/>test@test.com is trying to use '
expectedHTML
=
(
'Hello,<br/><br/>test@test.com is trying to use '
'<a href="http://0.0.0.0:5000/testpath">testtable</a>, and requests '
'<a href="http://0.0.0.0:5000/testpath
?source=notification
">testtable</a>, and requests '
'more information about that resource.<br/><br/>Please visit the provided link and improve '
'more information about that resource.<br/><br/>Please visit the provided link and improve '
'descriptions on that resource.<br/><br/>Thanks,<br/>Amundsen Team'
)
'descriptions on that resource.<br/><br/>Thanks,<br/>Amundsen Team'
)
self
.
assertEqual
(
html
,
expectedHTML
)
self
.
assertEqual
(
html
,
expectedHTML
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment