Skip to content

Commit f614f83

Browse files
authored
GitHub App: open beta (#603)
The revoke and disconnect options are not available during the beta, so users can use the old button to log in without any problems. They can still do this from the social accounts list, but if they do so, next time they log in will be redirected to the correct login page, so. Ref readthedocs/meta#187
1 parent 57bd5a9 commit f614f83

File tree

3 files changed

+45
-27
lines changed

3 files changed

+45
-27
lines changed

readthedocsext/theme/templates/profiles/partials/github_oauth_disconnect_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
action="{% url 'socialaccount_connections' %}">
2424
{% csrf_token %}
2525
<input type="hidden" name="account" value="{{ object.id }}" />
26-
<button class="ui button" type="submit">
26+
<button class="ui disabled button" type="submit">
2727
<i class="fa-brands fa-github icon"></i>
2828
{% trans "Disconnect" %}
2929
</button>

readthedocsext/theme/templates/profiles/partials/github_oauth_revoke_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
{% else %}
4444
<a href="{{ old_application_link }}"
4545
target="_blank"
46-
class="ui button"
46+
class="ui disabled button"
4747
data-bind="click: trackLinkClick">
4848
<i class="fa-brands fa-github icon"></i>
4949
{% trans "Revoke" %}

readthedocsext/theme/templates/profiles/private/migrate_to_gh_app.html

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -217,44 +217,62 @@ <h3 class="ui small header">{% trans "Migrate all projects" %}</h3>
217217

218218
<a class="ui button" href="?step=revoke">{% trans "Next" %}</a>
219219
{% elif step == "revoke" %}
220-
<p>
220+
<div class="ui small warning message">
221+
<i class="fad fa-warning icon"></i>
221222
{% blocktrans trimmed %}
222-
Revoke access to our old GitHub OAuth app.
223-
You'll be redirected to GitHub, where you need to click on "Revoke access".
223+
During the beta period, we don't recommend revoking access to our old GitHub OAuth app.
224+
You will be reminded to complete this step after the beta period ends.
224225
{% endblocktrans %}
225-
</p>
226-
227-
{% if has_projects_pending_migration and not step_revoke_completed %}
228-
<div class="ui small warning message">
229-
<i class="fad fa-warning icon"></i>
230-
{% blocktrans trimmed with migrate_step="?step=migrate" manual_migration_docs="https://docs.readthedocs.com/platform/stable/reference/git-integration.html#manually-migrating-a-project" %}
231-
You have projects that need to be <a href="{{ migrate_step }}">migrated</a>.
232-
If you revoke access now, you'll need to <a href="{{ manual_migration_docs }}">manually migrate</a> them.
226+
</div>
227+
<div class="ui disabled basic segment">
228+
<p>
229+
{% blocktrans trimmed %}
230+
Revoke access to our old GitHub OAuth app.
231+
You'll be redirected to GitHub, where you need to click on "Revoke access".
233232
{% endblocktrans %}
234-
</div>
235-
{% endif %}
233+
</p>
236234

237-
{% include "profiles/partials/github_oauth_revoke_list.html" with objects=old_github_accounts current_page=request.get_full_path %}
235+
{% if has_projects_pending_migration and not step_revoke_completed %}
236+
<div class="ui small warning message">
237+
<i class="fad fa-warning icon"></i>
238+
{% blocktrans trimmed with migrate_step="?step=migrate" manual_migration_docs="https://docs.readthedocs.com/platform/stable/reference/git-integration.html#manually-migrating-a-project" %}
239+
You have projects that need to be <a href="{{ migrate_step }}">migrated</a>.
240+
If you revoke access now, you'll need to <a href="{{ manual_migration_docs }}">manually migrate</a> them.
241+
{% endblocktrans %}
242+
</div>
243+
{% endif %}
244+
245+
{% include "profiles/partials/github_oauth_revoke_list.html" with objects=old_github_accounts current_page=request.get_full_path %}
246+
</div>
238247

239248
<div class="ui divider"></div>
240249
<a class="ui button {% if not step_revoke_completed %}disabled{% endif %}"
241250
href="?step=disconnect">{% trans "Next" %}</a>
242251
{% elif step == "disconnect" %}
243-
<p>
252+
<div class="ui small warning message">
253+
<i class="fad fa-warning icon"></i>
244254
{% blocktrans trimmed %}
245-
Disconnect the old GitHub OAuth app from your Read the Docs account.
246-
{% endblocktrans %}
247-
</p>
248-
249-
<div class="ui message info">
250-
<i class="fad fa-info-circle icon"></i>
251-
{% blocktrans trimmed with manual_migration_docs="https://docs.readthedocs.com/platform/stable/reference/git-integration.html#manually-migrating-a-project" %}
252-
After disconnecting the old GitHub OAuth app, you won't be able to see this page again.
253-
If you have projects that need to be migrated, you'll need to <a href="{{ manual_migration_docs }}">manually migrate</a> them.
255+
During the beta period, we don't recommend disconnecting your account from our old GitHub OAuth app.
256+
You will be reminded to complete this step after the beta period ends.
254257
{% endblocktrans %}
255258
</div>
259+
<div class="ui disabled basic segment">
260+
<p>
261+
{% blocktrans trimmed %}
262+
Disconnect the old GitHub OAuth app from your Read the Docs account.
263+
{% endblocktrans %}
264+
</p>
256265

257-
{% include "profiles/partials/github_oauth_disconnect_list.html" with objects=old_github_accounts %}
266+
<div class="ui message info">
267+
<i class="fad fa-info-circle icon"></i>
268+
{% blocktrans trimmed with manual_migration_docs="https://docs.readthedocs.com/platform/stable/reference/git-integration.html#manually-migrating-a-project" %}
269+
After disconnecting the old GitHub OAuth app, you won't be able to see this page again.
270+
If you have projects that need to be migrated, you'll need to <a href="{{ manual_migration_docs }}">manually migrate</a> them.
271+
{% endblocktrans %}
272+
</div>
273+
274+
{% include "profiles/partials/github_oauth_disconnect_list.html" with objects=old_github_accounts %}
275+
</div>
258276
{% endif %}
259277
</div>
260278
</div>

0 commit comments

Comments
 (0)