Show success alert when new workspace user is created
This commit is contained in:
parent
908623a307
commit
1f26596b5f
@ -109,12 +109,12 @@ def create_member(workspace_id):
|
|||||||
form = NewMemberForm(http_request.form)
|
form = NewMemberForm(http_request.form)
|
||||||
|
|
||||||
if form.validate():
|
if form.validate():
|
||||||
Workspaces.create_member(g.current_user, workspace, form.data)
|
new_member = Workspaces.create_member(g.current_user, workspace, form.data)
|
||||||
return redirect(
|
return redirect(
|
||||||
url_for(
|
url_for(
|
||||||
"workspaces.workspace_members",
|
"workspaces.workspace_members",
|
||||||
workspace_id=workspace.id,
|
workspace_id=workspace.id,
|
||||||
memberCreated=True,
|
newMemberName=new_member.user.full_name
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{% extends "base_workspace.html" %}
|
{% extends "base_workspace.html" %}
|
||||||
|
|
||||||
{% from "components/empty_state.html" import EmptyState %}
|
{% from "components/empty_state.html" import EmptyState %}
|
||||||
|
{% from "components/alert.html" import Alert %}
|
||||||
|
|
||||||
{% block workspace_content %}
|
{% block workspace_content %}
|
||||||
|
|
||||||
@ -19,6 +20,19 @@
|
|||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
|
{% set new_member_name = request.args.get("newMemberName") %}
|
||||||
|
{% if new_member_name %}
|
||||||
|
{% set message -%}
|
||||||
|
<p>{{ new_member_name }} was successfully invited via email to this workspace. They do not yet have access to any environments.</p>
|
||||||
|
<p><a href="#">Add environment access.</a></p>
|
||||||
|
{%- endset %}
|
||||||
|
|
||||||
|
{{ Alert('Member added successfully',
|
||||||
|
message=message,
|
||||||
|
level='success'
|
||||||
|
) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<form class='search-bar'>
|
<form class='search-bar'>
|
||||||
<div class='usa-input search-input'>
|
<div class='usa-input search-input'>
|
||||||
<label for='members-search'>Search members by name</label>
|
<label for='members-search'>Search members by name</label>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user