Skip to content

Commit

Permalink
Remove "Refresh codename" feature
Browse files Browse the repository at this point in the history
In practice, this feature has potential for user confusion, as a critical
step of the submission process while delivering minimal end user value.

One key motivation for this feature has been the occasional generation
of problematic words in codenames. We have already iterated over
the wordlists several times, and will continue to do so.

Reloading will also continue to work just fine.
  • Loading branch information
eloquence committed Dec 10, 2021
1 parent 0ebd564 commit 365755f
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@
/var/www/securedrop/static/i/font-awesome/info-circle-black.png r,
/var/www/securedrop/static/i/font-awesome/lock-black.png r,
/var/www/securedrop/static/i/font-awesome/refresh-blue.png r,
/var/www/securedrop/static/i/font-awesome/refresh-white.png r,
/var/www/securedrop/static/i/font-awesome/times-white.png r,
/var/www/securedrop/static/i/font-awesome/white/exclamation-circle.svg r,
/var/www/securedrop/static/i/font-awesome/white/guard.svg r,
Expand Down
18 changes: 1 addition & 17 deletions securedrop/sass/source.sass
Original file line number Diff line number Diff line change
Expand Up @@ -276,22 +276,6 @@ p#max-file-size
margin-bottom: 10px
margin-top: 5px

#regenerate-submit
span
font-size: 0

&:after
content: ""
display: inline-block
background:
image: url(/static/i/font-awesome/refresh-white.png)
position: center
repeat: no-repeat
size: contain
opacity: 0.9
height: 20px
width: 20px

#cancel
&:before
content: ""
Expand Down Expand Up @@ -323,4 +307,4 @@ p#max-file-size

background:
image: url(/static/icons/chevron-left.png)
size: contain
size: contain
2 changes: 1 addition & 1 deletion securedrop/source_app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def make_blueprint(config: SDConfig) -> Blueprint:
def index() -> str:
return render_template('index.html')

@view.route('/generate', methods=('GET', 'POST'))
@view.route('/generate', methods=('GET',))
def generate() -> Union[str, werkzeug.Response]:
if SessionManager.is_user_logged_in(db_session=db.session):
flash(gettext(
Expand Down
10 changes: 1 addition & 9 deletions securedrop/source_templates/generate.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ <h1>{{ gettext('Welcome') }}</h1>
<h2 id="codename-heading" class="visually-hidden">{{ gettext('Codename') }}</h2>
<mark id="codename" class="codename"
aria-describedby="codename-instructions codename-explanation">{{ codename }}</mark>
<div class="pull-right">
<form id="regenerate-form" method="post">
<input name="csrf_token" type="hidden" value="{{ csrf_token() }}">
<button type="submit" id="regenerate-submit" class="small">
<span>{{ gettext('Refresh codename') }}</span>
</button>
</form>
</div>
</section>

<p class="explanation">
Expand All @@ -38,4 +30,4 @@ <h2 id="codename-heading" class="visually-hidden">{{ gettext('Codename') }}</h2>
{{ gettext('SUBMIT DOCUMENTS') }}
</button>
</form>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion securedrop/source_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ <h2 id="return-visit-heading" class="welcome-text">

</body>

</html>
</html>
Binary file removed securedrop/static/i/font-awesome/refresh-white.png
Binary file not shown.
2 changes: 1 addition & 1 deletion securedrop/tests/functional/source_navigation_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _source_clicks_submit_documents_on_homepage(self):
assert self._is_on_generate_page()

def _source_regenerates_codename(self):
self.safe_click_by_id("regenerate-submit")
self.driver.refresh()

def _source_chooses_to_submit_documents(self):
self._source_clicks_submit_documents_on_homepage()
Expand Down
2 changes: 1 addition & 1 deletion securedrop/tests/functional/test_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test_duplicate_generate_pages(self):

def test_refreshed_duplicate_generate_pages(self):
# Test generation of multiple codenames in different browser tabs, including behavior
# of refreshing the codemae in each tab. Ref. issue 4458.
# of refreshing the codename in each tab. Ref. issue 4458.

# Generate a codename in Tab A
assert len(self.driver.window_handles) == 1
Expand Down

0 comments on commit 365755f

Please sign in to comment.