Skip to content

Commit c6020bb

Browse files
authored
[INNO] ARC-2720-Adding links in spa backfill (#2606)
* ARC-2720 Add the edit button to SPA backfill page * NONE: Amend table head keys for SPA backfill * ARC-2720 Add the settings dropdown with configure link to backfill SPA * WIP Create and add link to respositories page * WIP Add back btn, heading and search bar to repo page * ARC-2720 Add link to repos on backfill SPA * NONE Removed unused repositories page and respective route * ARC-2720 Fixed redirect for repos to existing repos page
1 parent 913b45d commit c6020bb

File tree

5 files changed

+315
-7
lines changed

5 files changed

+315
-7
lines changed

spa/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"@atlaskit/badge": "^15.1.14",
2727
"@atlaskit/button": "^16.8.0",
2828
"@atlaskit/css-reset": "^6.5.2",
29+
"@atlaskit/dropdown-menu": "^12.1.8",
2930
"@atlaskit/dynamic-table": "^14.11.5",
3031
"@atlaskit/form": "^8.11.8",
3132
"@atlaskit/heading": "^1.3.7",
@@ -37,6 +38,7 @@
3738
"@atlaskit/skeleton": "^0.2.3",
3839
"@atlaskit/spinner": "^15.6.1",
3940
"@atlaskit/textarea": "^4.7.7",
41+
"@atlaskit/textfield": "^6.0.0",
4042
"@atlaskit/tokens": "^1.11.1",
4143
"@atlaskit/tooltip": "^17.8.3",
4244
"@emotion/styled": "^11.11.0",

spa/src/common/Wrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const wrapperStyle = css`
1111
`;
1212
const wrapperCenterStyle = css`
1313
margin: 0 auto;
14-
max-width: 580px;
14+
max-width: 800px;
1515
height: calc(100vh - ${navHeight * 2}px);
1616
display: flex;
1717
flex-direction: column;

spa/src/utils/dynamicTableHelper.tsx

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import Lozenge from "@atlaskit/lozenge";
66
import { SuccessfulConnection } from "../rest-interfaces";
77
import { ThemeAppearance } from "@atlaskit/lozenge/dist/types/Lozenge";
88
import { css } from "@emotion/react";
9+
import EditIcon from "@atlaskit/icon/glyph/edit";
10+
import Button from "@atlaskit/button";
11+
import MoreIcon from "@atlaskit/icon/glyph/more";
12+
import DropdownMenu, { DropdownItem, DropdownItemGroup } from "@atlaskit/dropdown-menu";
913

1014
type Row = {
1115
key: string;
@@ -57,14 +61,19 @@ const createHead = (withWidth: boolean) => {
5761
width: withWidth ? 30 : undefined,
5862
},
5963
{
60-
key: "party",
64+
key: "repos",
6165
content: "Repos",
6266
width: withWidth ? 30 : undefined,
6367
},
6468
{
65-
key: "term",
69+
key: "status",
6670
content: "Status",
6771
width: withWidth ? 30 : undefined,
72+
},
73+
{
74+
key: "settings",
75+
content: "Settings",
76+
width: withWidth ? 10: undefined
6877
}
6978
],
7079
};
@@ -106,16 +115,33 @@ export const getGHSubscriptionsRows = (
106115
content: (
107116
<div css={rowWrapperStyle}>
108117
<span>
109-
{cloudConnection.isGlobalInstall
110-
? `All repos`
111-
: `Only select repos`}
118+
<a
119+
href="#"
120+
onClick={() => {
121+
AP.navigator.go("addonmodule", {
122+
moduleKey: "gh-addon-subscription-repos",
123+
customData: {subscriptionId: cloudConnection.subscriptionId},
124+
});
125+
}}
126+
>
127+
{cloudConnection.isGlobalInstall
128+
? `All repos`
129+
: `Only select repos`}
130+
</a>
112131
</span>
113132
<Badge>
114133
{ifAllReposSynced(
115134
cloudConnection.numberOfSyncedRepos,
116135
cloudConnection.totalNumberOfRepos
117136
)}
118137
</Badge>
138+
<Button
139+
href={cloudConnection.html_url}
140+
target="_blank"
141+
appearance="subtle"
142+
iconBefore={<EditIcon label="" size="small"/>}
143+
>
144+
</Button>
119145
</div>
120146
),
121147
},
@@ -147,6 +173,31 @@ export const getGHSubscriptionsRows = (
147173
</div>
148174
</div>
149175
),
176+
},{
177+
key: cloudConnection.id,
178+
content: (
179+
<div css={rowWrapperStyle}>
180+
<DropdownMenu
181+
trigger={({ triggerRef, ...props }) => (
182+
<Button
183+
{...props}
184+
appearance="subtle"
185+
iconBefore={<MoreIcon label="more" size="small"/>}
186+
ref={triggerRef}
187+
/>
188+
)}
189+
>
190+
<DropdownItemGroup>
191+
<DropdownItem
192+
href={cloudConnection.html_url}
193+
target="_blank"
194+
>
195+
Configure
196+
</DropdownItem>
197+
</DropdownItemGroup>
198+
</DropdownMenu>
199+
</div>
200+
)
150201
}
151202
],
152203
})

0 commit comments

Comments
 (0)