|
7 | 7 | import GraphErrors from '$lib/GraphErrors.svelte';
|
8 | 8 | import Pagination from '$lib/Pagination.svelte';
|
9 | 9 | import { changeParams } from '$lib/utils/searchparams';
|
10 |
| - import { BodyLong, Button, Detail, Heading, TextField } from '@nais/ds-svelte-community'; |
| 10 | + import { Alert, BodyLong, Button, Detail, Heading, TextField } from '@nais/ds-svelte-community'; |
11 | 11 | import { PlusIcon, TrashIcon } from '@nais/ds-svelte-community/icons';
|
12 | 12 | import type { PageProps } from './$houdini';
|
13 | 13 |
|
|
30 | 30 | team
|
31 | 31 | });
|
32 | 32 | Repositories.fetch();
|
| 33 | + repositoryAdded = true; |
| 34 | + repoOperatedOn = repository; |
| 35 | + setTimeout(() => { |
| 36 | + repositoryAdded = false; |
| 37 | + }, 10000); |
33 | 38 | };
|
34 | 39 |
|
35 | 40 | const removeRepositoryMutation = graphql(`
|
|
45 | 50 | team
|
46 | 51 | });
|
47 | 52 | Repositories.fetch();
|
| 53 | + repositoryRemoved = true; |
| 54 | + repoOperatedOn = repository; |
| 55 | + setTimeout(() => { |
| 56 | + repositoryRemoved = false; |
| 57 | + }, 10000); |
48 | 58 | };
|
49 | 59 |
|
50 | 60 | const validateRepo = (input: string) => {
|
|
63 | 73 | };
|
64 | 74 |
|
65 | 75 | let filter = $state('');
|
| 76 | + let repositoryAdded = $state(false); |
| 77 | + let repositoryRemoved = $state(false); |
| 78 | + let repoOperatedOn = $state(''); |
66 | 79 |
|
67 | 80 | const handleFilter = () => {
|
68 | 81 | if (filter === '') {
|
|
104 | 117 | <GraphErrors errors={$Repositories.errors} />
|
105 | 118 |
|
106 | 119 | {#if $Repositories.data}
|
| 120 | + {#if repositoryAdded} |
| 121 | + <div style="margin-bottom: var(--spacing-layout)"> |
| 122 | + <Alert variant="success" size="small" fullWidth={true} |
| 123 | + >Repository <code>{repoOperatedOn}</code> added successfully. It might take a couple of minutes |
| 124 | + before the repository is authorized.</Alert |
| 125 | + > |
| 126 | + </div> |
| 127 | + {/if} |
| 128 | + |
| 129 | + {#if repositoryRemoved} |
| 130 | + <div style="margin-bottom: var(--spacing-layout)"> |
| 131 | + <Alert variant="success" size="small" fullWidth={true} |
| 132 | + >Repository <code>{repoOperatedOn}</code> removed successfully.</Alert |
| 133 | + > |
| 134 | + </div> |
| 135 | + {/if} |
| 136 | + |
107 | 137 | <div class="wrapper">
|
108 | 138 | <div>
|
109 | 139 | {#if $Repositories.data.team}
|
|
146 | 176 | {/if}
|
147 | 177 |
|
148 | 178 | <Heading level="2" size="small">Authorized repositories</Heading>
|
149 |
| - {#if team.repositories.pageInfo.totalCount === 0} |
| 179 | + {#if team.repositories.pageInfo.totalCount === 0 && filter === ''} |
150 | 180 | <BodyLong spacing>
|
151 | 181 | {#if team.repositories.pageInfo.totalCount == 0}
|
152 | 182 | <strong>No repositories are authorized for deployment.</strong>
|
|
236 | 266 | gap: var(--a-spacing-1-alt);
|
237 | 267 | align-items: center;
|
238 | 268 | }
|
| 269 | + code { |
| 270 | + font-size: 1rem; |
| 271 | + } |
239 | 272 | </style>
|
0 commit comments