Skip to content

Commit 8ce0940

Browse files
committed
feat(auth): account scopes and expired pat workflow
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent 349113c commit 8ce0940

4 files changed

Lines changed: 32 additions & 14 deletions

File tree

src/renderer/App.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
/** Tailwind CSS Configuration */
88
@config "../../tailwind.config.mts";
99

10-
@layer components {
11-
.gitify-scope-row {
12-
@apply rounded-md py-1.5 px-4 bg-gitify-accounts;
13-
}
14-
}
15-
1610
html,
1711
body,
1812
#root {

src/renderer/components/settings/NotificationSettings.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { type FC, type MouseEvent, useEffect, useState } from 'react';
2+
import { useNavigate } from 'react-router-dom';
23

34
import {
45
AlertFillIcon,
@@ -38,6 +39,8 @@ import {
3839
import { openGitHubParticipatingDocs } from '../../utils/links';
3940

4041
export const NotificationSettings: FC = () => {
42+
const navigate = useNavigate();
43+
4144
const { auth, settings, updateSetting } = useAppContext();
4245

4346
const [fetchInterval, setFetchInterval] = useState<number>(
@@ -251,11 +254,24 @@ export const NotificationSettings: FC = () => {
251254
gap="condensed"
252255
>
253256
<AlertFillIcon className="text-gitify-warning" size={14} />
254-
<Text>
255-
One or more accounts are missing enrichment scopes — detailed
256-
notifications may be incomplete. Visit{' '}
257-
<Text as="strong">Accounts → Scopes</Text> to review.
258-
</Text>
257+
<Stack direction="vertical" gap="condensed">
258+
<Text>
259+
One or more accounts are missing scopes required for
260+
notification enrichment. Notification details may be
261+
incomplete.
262+
</Text>
263+
<Text>
264+
Visit{' '}
265+
<button
266+
className="text-gitify-link cursor-pointer"
267+
onClick={() => navigate('/accounts')}
268+
type="button"
269+
>
270+
Accounts → Scopes
271+
</button>{' '}
272+
to review.
273+
</Text>
274+
</Stack>
259275
</Stack>
260276
)}
261277

src/renderer/routes/AccountScopes.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export const AccountScopesRoute: FC = () => {
9393
direction="horizontal"
9494
justify="space-between"
9595
key={name}
96+
padding="condensed"
9697
>
9798
<Stack direction="vertical" gap="none">
9899
<Text className="text-xs font-mono">{name}</Text>
@@ -128,6 +129,7 @@ export const AccountScopesRoute: FC = () => {
128129
data-testid="account-scopes-repo-scope"
129130
direction="horizontal"
130131
justify="space-between"
132+
padding="condensed"
131133
>
132134
<Stack direction="vertical" gap="none">
133135
<Text className="text-xs font-mono">
@@ -147,6 +149,7 @@ export const AccountScopesRoute: FC = () => {
147149
data-testid="account-scopes-public-repo-scope"
148150
direction="horizontal"
149151
justify="space-between"
152+
padding="condensed"
150153
>
151154
<Stack direction="vertical" gap="none">
152155
<Text className="text-xs font-mono">
@@ -182,6 +185,7 @@ export const AccountScopesRoute: FC = () => {
182185
data-testid="account-scopes-extra-scopes"
183186
direction="horizontal"
184187
gap="condensed"
188+
padding="condensed"
185189
>
186190
{extraScopes.map((scope) => (
187191
<Label key={scope} size="small" variant="secondary">

tailwind.config.mts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ const config: Config = {
7676
},
7777
},
7878
plugins: [
79-
plugin(({ addBase }) => {
79+
plugin(({ addBase, addComponents }) => {
80+
addComponents({
81+
'.gitify-scope-row': {
82+
'@apply rounded-md bg-gitify-accounts': {},
83+
},
84+
});
8085
// TODO - ideally we would use GitHub Primer Design Tokens instead of TailwindCSS
8186
addBase({
8287
'[data-color-mode="light"]': {
@@ -103,8 +108,7 @@ const config: Config = {
103108
'--gitify-counter-secondary': colors.gray[600],
104109
'--gitify-counter-text': colors.gray[100],
105110
},
106-
});
107-
}),
111+
});),
108112
],
109113
};
110114

0 commit comments

Comments
 (0)