mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-12 13:48:58 +02:00
style: restore mobile sign-in and compact access controls
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"core.min.js": "core.c5bd53363a.min.js",
|
||||
"vendor.min.js": "vendor.9b912f1d9e.min.js",
|
||||
"vendor.min.js": "vendor.0155114e4b.min.js",
|
||||
"mermaid.min.js": "mermaid.f848a72d16.min.js",
|
||||
"all.min.css": "all.f8e40e3668.min.css",
|
||||
"all.min.css": "all.6a5e0ae79b.min.css",
|
||||
"markdown.min.js": "markdown.ad7b1d71c3.min.js",
|
||||
"pdf.min.js": "pdf.eaa7573247.min.js",
|
||||
"notebook.min.js": "notebook.8844e2735f.min.js",
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+58
-2
@@ -5049,7 +5049,7 @@ textarea::selection {
|
||||
text-align: center;
|
||||
border-top: 1px solid var(--border-soft, var(--border-color));
|
||||
}
|
||||
.paper-table .paper-table-empty i { font-size: 1.6rem; color: var(--ink-faint); }
|
||||
.paper-table .paper-table-empty > i { font-size: 1.6rem; color: var(--ink-faint); }
|
||||
.paper-table .paper-table-empty-actions { display: flex; gap: 8px; margin-top: 8px; }
|
||||
|
||||
.bulk-bar {
|
||||
@@ -5268,7 +5268,7 @@ textarea::selection {
|
||||
gap: 8px;
|
||||
border-top: 1px solid var(--border-soft, var(--border-color));
|
||||
}
|
||||
.paper-table-empty i { font-size: 1.6rem; }
|
||||
.paper-table-empty > i { font-size: 1.6rem; }
|
||||
|
||||
/* ===== Queue dashboard (redesigned) ===== */
|
||||
.q-header {
|
||||
@@ -7099,3 +7099,59 @@ body {
|
||||
.connection-empty > a { margin-left: 40px; }
|
||||
.connection-resource-actions { flex-basis: 100%; }
|
||||
}
|
||||
|
||||
.paper-table-empty-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
|
||||
.paper-table-empty-actions .btn > i { font-size: 1em; line-height: 1; color: inherit; margin-right: 0 !important; }
|
||||
.auth-back { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-muted); margin-bottom: 48px; }
|
||||
.auth-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
|
||||
.auth-intro, .auth-options { padding-top: 28px; }
|
||||
.auth-title-mobile { display: none; }
|
||||
.auth-intro .paper-page-title { font-size: clamp(48px, 5vw, 76px); line-height: 1.06; margin: 18px 0 24px; }
|
||||
.auth-intro .paper-page-lede { max-width: 330px; }
|
||||
.auth-options { display: grid; gap: 28px; }
|
||||
.auth-options h2 { font-family: inherit; font-size: 21px; font-weight: 600; margin: 0 0 10px; }
|
||||
.auth-options p { font-size: 14px; line-height: 1.65; color: var(--ink-muted); }
|
||||
.auth-options .auth-existing { font-size: 12px; border-left: 2px solid var(--accent); padding-left: 14px; margin: 0; }
|
||||
.auth-permissions { padding: 6px 0 12px; list-style: none; font-size: 13px; line-height: 1.6; }
|
||||
.auth-permissions li { display: flex; gap: 10px; margin: 12px 0; }
|
||||
.auth-permissions i { color: var(--status-ready); margin-top: 4px; }
|
||||
.auth-continue { display: flex !important; align-items: center; justify-content: space-between; min-height: 48px; padding: 12px 16px !important; }
|
||||
.auth-options small { display: block; font-size: 12px; text-align: center; color: var(--ink-muted); margin-top: 12px; }
|
||||
.auth-legacy { border-top: 1px solid var(--border-color); padding-top: 24px; }
|
||||
.auth-legacy h2 { font-size: 16px; margin: 0; }
|
||||
.auth-legacy p { font-size: 13px; }
|
||||
.repo-access { max-width: 1036px; margin: 24px auto 0; border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
|
||||
.repo-access-main { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 0; flex-wrap: wrap; }
|
||||
.repo-access-heading { display: flex; align-items: center; gap: 12px; }
|
||||
.repo-access-heading > i { font-size: 22px; color: var(--ink-muted); }
|
||||
.repo-access-heading h2 { font-family: inherit; font-size: 13px; font-weight: 600; margin: 0 0 4px; }
|
||||
.repo-access-heading p { font-size: 12px; color: var(--ink-muted); margin: 0; }
|
||||
.repo-access-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
|
||||
.repo-access-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--border-color); border-radius: 7px; flex-wrap: wrap; }
|
||||
.repo-access-switch button { border: 0; border-radius: 4px; background: transparent; color: var(--ink-muted); padding: 7px 10px; font: inherit; font-size: 12px; cursor: pointer; }
|
||||
.repo-access-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); opacity: 1; cursor: default; font-weight: 600; }
|
||||
.repo-access-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
.repo-access .btn { font-size: 12px; padding: 8px 12px; }
|
||||
.repo-access-note { display: flex; gap: 6px 16px; flex-wrap: wrap; padding: 0 0 14px; color: var(--ink-muted); font-size: 11px; line-height: 1.6; }
|
||||
@media (max-width: 1100px) { .repo-access { margin-left: 24px; margin-right: 24px; } }
|
||||
@media (max-width: 767px) {
|
||||
.auth-page { max-width: 480px; }
|
||||
.auth-back, .auth-intro .paper-eyebrow, .auth-title-desktop { display: none; }
|
||||
.auth-title-mobile { display: inline; }
|
||||
.auth-layout { grid-template-columns: 1fr; gap: 24px; }
|
||||
.auth-intro, .auth-options { padding-top: 0; }
|
||||
.auth-intro .paper-page-title { font-size: 40px; line-height: 1.15; margin: 6px 0 12px; }
|
||||
.auth-intro .paper-page-lede { max-width: none; font-size: 14px; margin: 0; }
|
||||
.auth-options { gap: 24px; }
|
||||
.auth-options .connection-top { margin-bottom: 16px; }
|
||||
.auth-options h2 { font-size: 18px; }
|
||||
.auth-options p { font-size: 13px; margin-bottom: 12px; }
|
||||
.auth-permissions { padding: 0; margin: 14px 0 20px; font-size: 12px; }
|
||||
.auth-permissions li { margin: 8px 0; }
|
||||
.auth-continue { font-size: 14px; }
|
||||
.auth-legacy { padding-top: 20px; }
|
||||
.auth-legacy h2 { font-size: 15px; }
|
||||
.auth-legacy .connection-link { min-height: 44px; }
|
||||
.repo-access { margin: 16px 18px 0; }
|
||||
.repo-access-controls { width: 100%; gap: 12px; }
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
<div class="anonymize-page h-100">
|
||||
<div class="container py-3" v-if="githubConnections?.appEnabled">
|
||||
<span v-if="isUpdate">Connection: {{ githubConnection === 'github-app' ? 'GitHub App (read-only)' : 'Legacy OAuth' }}. <a href="/connections">Change connection</a></span>
|
||||
<span v-if="!isUpdate">Repository access:
|
||||
<button class="btn" :disabled="githubConnection === 'github-app'" @click="chooseGitHubConnection('github-app')">Read-only GitHub App</button>
|
||||
<button v-if="githubConnections?.oauthConnected" class="btn" :disabled="githubConnection === 'oauth'" @click="chooseGitHubConnection('oauth')">Use existing OAuth access</button>
|
||||
</span>
|
||||
<button class="btn btn-ink" @click="grantGitHubAccess()">{{ githubConnections?.appConnected ? 'Allow repository access on GitHub' : 'Connect read-only GitHub access' }}</button>
|
||||
<p class="mb-0"><small>Return here after confirming access on GitHub. Anonymization publishes the configured content, including content from private repositories. Gists currently use OAuth.</small></p>
|
||||
</div>
|
||||
<aside class="repo-access" aria-label="GitHub access" v-if="githubConnections?.appEnabled && githubConnections.appConnected && githubConnections.oauthConnected">
|
||||
<div class="repo-access-main">
|
||||
<div class="repo-access-heading"><i class="fab fa-github" aria-hidden="true"></i><div><h2>{{ detectedType === 'gist' ? 'Gist access' : 'Repository access' }}</h2><p>{{ detectedType === 'gist' ? 'Gists use your OAuth connection.' : 'Choose how we read your source code.' }}</p></div></div>
|
||||
<div class="repo-access-controls">
|
||||
<div class="repo-access-switch" role="group" aria-label="Repository connection" v-if="!isUpdate && detectedType !== 'gist'">
|
||||
<button type="button" :aria-pressed="githubConnection === 'github-app'" :disabled="githubConnection === 'github-app'" @click="chooseGitHubConnection('github-app')"><i class="fas fa-shield-alt" aria-hidden="true"></i> Read-only GitHub App</button>
|
||||
<button type="button" :aria-pressed="githubConnection === 'oauth'" :disabled="githubConnection === 'oauth'" @click="chooseGitHubConnection('oauth')">Legacy OAuth</button>
|
||||
</div>
|
||||
<span class="connection-badge" v-if="isUpdate || detectedType === 'gist'">{{ detectedType !== 'gist' && githubConnection === 'github-app' ? 'Read-only GitHub App' : 'Legacy OAuth' }}</span>
|
||||
<button type="button" class="btn btn-outline-ink" v-if="detectedType !== 'gist' && githubConnection !== 'oauth'" @click="grantGitHubAccess()">Manage access <i class="fas fa-external-link-alt" aria-hidden="true"></i></button>
|
||||
<a class="connection-link" href="/connections" v-if="isUpdate || detectedType === 'gist' || githubConnection === 'oauth'">{{ isUpdate ? 'Change connection' : 'Manage connections' }} →</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="repo-access-note"><span v-if="detectedType !== 'gist' && githubConnection !== 'oauth'">Select repositories on GitHub, then return here.</span><span><i class="fas fa-info-circle" aria-hidden="true"></i> Selected content will be published, including content from private repositories.</span></div>
|
||||
</aside>
|
||||
<!-- ===== STATE 1: No URL — centered input ===== -->
|
||||
<div class="anonymize-landing" v-show="!(sourceUrl)">
|
||||
<div class="anonymize-landing-inner">
|
||||
|
||||
+29
-12
@@ -1,13 +1,30 @@
|
||||
<div class="container page paper-page">
|
||||
<h1 class="paper-page-title">Connect to <em>GitHub</em></h1>
|
||||
<p>Sign in to manage your anonymizations. Both connections use the same Anonymous GitHub account.</p>
|
||||
<p class="alert alert-warning" role="note" v-if="site_options?.GITHUB_APP_ENABLED && site_options?.GITHUB_OAUTH_ENABLED">
|
||||
If you already have an Anonymous GitHub account, sign in with
|
||||
<a class="alert-link" target="_self" href="/github/login">legacy GitHub OAuth</a>
|
||||
to keep access to your existing anonymizations. You can connect the read-only GitHub App from GitHub connections after signing in.
|
||||
</p>
|
||||
<p v-if="site_options?.GITHUB_APP_ENABLED"><a class="btn btn-ink" target="_self" href="/github/app/login">Continue with read-only GitHub App</a></p>
|
||||
<p v-if="site_options?.GITHUB_APP_ENABLED">Choose which repositories to allow after signing in. Private repositories are accessed with read-only permissions.</p>
|
||||
<p v-if="site_options?.GITHUB_OAUTH_ENABLED"><a class="btn" target="_self" href="/github/login">Continue with legacy GitHub OAuth</a></p>
|
||||
<p v-if="site_options?.GITHUB_OAUTH_ENABLED">OAuth supports existing connections and gists. GitHub's private repository OAuth scope includes write access.</p>
|
||||
<div class="container paper-page auth-page">
|
||||
<a class="auth-back" href="/"><i class="fas fa-arrow-left" aria-hidden="true"></i> Anonymous GitHub</a>
|
||||
<div class="auth-layout">
|
||||
<header class="auth-intro">
|
||||
<div class="paper-eyebrow">Your research, ready for review</div>
|
||||
<h1 class="paper-page-title"><span class="auth-title-desktop">Your code.<br>Your identity,<br><em>protected.</em></span><span class="auth-title-mobile">Sign in to <em>GitHub</em></span></h1>
|
||||
<p class="paper-page-lede">Sign in to create and manage your anonymizations.</p>
|
||||
</header>
|
||||
<div class="auth-options">
|
||||
<p class="auth-existing" role="note" v-if="site_options?.GITHUB_APP_ENABLED && site_options?.GITHUB_OAUTH_ENABLED">Already have an account? Sign in with <a target="_self" href="/github/login">legacy GitHub OAuth</a> to keep access to your anonymizations. You can connect the read-only App from GitHub connections after signing in.</p>
|
||||
<section v-if="site_options?.GITHUB_APP_ENABLED">
|
||||
<div class="connection-top"><i class="fab fa-github" aria-hidden="true"></i><span class="connection-badge">Read-only access</span></div>
|
||||
<h2>Continue with GitHub</h2>
|
||||
<p>Connect through the GitHub App with read-only repository access.</p>
|
||||
<ul class="auth-permissions">
|
||||
<li><i class="fas fa-check" aria-hidden="true"></i> You choose which repositories to share</li>
|
||||
<li><i class="fas fa-check" aria-hidden="true"></i> No permission to write to your code</li>
|
||||
</ul>
|
||||
<a class="btn btn-ink auth-continue" target="_self" href="/github/app/login">Sign in with GitHub <i class="fas fa-arrow-right" aria-hidden="true"></i></a>
|
||||
<small>Select your repositories after signing in.</small>
|
||||
</section>
|
||||
<section class="auth-legacy" v-if="site_options?.GITHUB_OAUTH_ENABLED">
|
||||
<div class="connection-title"><h2>Legacy OAuth</h2><span class="connection-badge connection-badge-muted">For gists & existing accounts</span></div>
|
||||
<p>Use this connection for gists or your existing OAuth setup. GitHub's private repository scope includes write access.</p>
|
||||
<a class="connection-link" target="_self" href="/github/login">Continue with OAuth <i class="fas fa-arrow-right" aria-hidden="true"></i></a>
|
||||
</section>
|
||||
<p role="status" v-if="site_options && !site_options.GITHUB_APP_ENABLED && !site_options.GITHUB_OAUTH_ENABLED">GitHub sign-in is currently unavailable. Please try again later.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Vendored
+13
-13
File diff suppressed because one or more lines are too long
+9
-1
@@ -121,9 +121,17 @@ describe("Vue 3 UI", function () {
|
||||
});
|
||||
|
||||
|
||||
for (const [appConnected, oauthConnected] of [[true, false], [false, true], [false, false], [true, true]]) {
|
||||
it(`shows the access chooser only for two connections: ${appConnected}/${oauthConnected}`, async () => {
|
||||
ui = await browser("/anonymize", { "/github/connections": { appEnabled: true, appConnected, oauthConnected } });
|
||||
expect(Boolean(ui.window.document.querySelector(".repo-access"))).to.equal(appConnected && oauthConnected);
|
||||
expect(ui.errors).to.deep.equal([]);
|
||||
});
|
||||
}
|
||||
|
||||
it("preserves redactions, identifiers and pinned commits when switching connections", async () => {
|
||||
ui = await browser("/anonymize", {
|
||||
"/github/connections": { appEnabled: true, oauthConnected: true },
|
||||
"/github/connections": { appEnabled: true, appConnected: true, oauthConnected: true },
|
||||
"/api/repo/owner/repo/": { defaultBranch: "main", repo: "repo" },
|
||||
"/api/repo/owner/repo/branches": [{ name: "main", commit: "abcdef123" }],
|
||||
"/api/repo/owner/repo/readme": "",
|
||||
|
||||
Reference in New Issue
Block a user