Skip to content

Commit 3af83cc

Browse files
authored
Merge pull request #3561 from amvanbaren/v0.23.0-rc.1
Test v0.23.0-rc.1
2 parents af742d0 + 9976b3e commit 3af83cc

File tree

5 files changed

+66
-38
lines changed

5 files changed

+66
-38
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG SERVER_VERSION=13234236
1+
ARG SERVER_VERSION=v0.23.0-rc.1
22

33
# Builder image to compile the website
44
FROM ubuntu AS builder
@@ -19,7 +19,7 @@ RUN apt-get update \
1919
&& corepack prepare yarn@stable --activate
2020

2121
# bump to update website
22-
ENV WEBSITE_VERSION 0.15.0
22+
ENV WEBSITE_VERSION 0.16.0-next.9ad64f0d
2323
COPY . /workdir
2424

2525
RUN /usr/bin/yarn --cwd website \

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"repository": "https://github.com/eclipse/open-vsx.org",
77
"license": "EPL-2.0",
88
"dependencies": {
9-
"openvsx-webui": "0.15.0"
9+
"openvsx-webui": "0.16.0-next.9ad64f0d"
1010
},
1111
"peerDependencies": {
1212
"@babel/core": "^7.0.0"

website/src/main.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { ThemeProvider } from '@mui/material/styles';
1616
import { useMediaQuery } from '@mui/material';
1717
import { Main, ExtensionRegistryService } from 'openvsx-webui';
1818
import createDefaultTheme from 'openvsx-webui/lib/default/theme';
19+
import {createAbsoluteURL} from 'openvsx-webui/lib/utils';
1920
import createPageSettings from './page-settings';
2021

2122
const App: FunctionComponent = () => {
@@ -42,7 +43,7 @@ const App: FunctionComponent = () => {
4243
<Main
4344
service={service}
4445
pageSettings={pageSettings}
45-
canLogin
46+
loginProviders={{github: createAbsoluteURL(['oauth2', 'authorization', 'github'])}}
4647
/>
4748
</ThemeProvider>
4849
</HelmetProvider>

website/src/menu-content.tsx

Lines changed: 56 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -26,37 +26,43 @@ import AccountBoxIcon from '@mui/icons-material/AccountBox';
2626
import { UserSettingsRoutes } from 'openvsx-webui';
2727
import { MainContext } from 'openvsx-webui/lib/context';
2828
import { MobileMenuItem, itemIcon, MobileMenuItemText, MobileUserAvatar, headerItem, MenuLink, MenuRouteLink } from 'openvsx-webui/lib/default/menu-content'
29+
import { LoginComponent } from 'openvsx-webui/lib/default/login'
2930
import { UserAvatar } from 'openvsx-webui/lib/pages/user/avatar';
3031

3132
//-------------------- Mobile View --------------------//
3233

3334
export const MobileMenuContent: FunctionComponent = () => {
34-
const {service, user} = useContext(MainContext)
35+
const {user, loginProviders} = useContext(MainContext)
3536
return <>
36-
{
37-
user
38-
? <MobileUserAvatar/>
39-
: <MobileMenuItem>
40-
<Link href={service.getLoginUrl()}>
41-
<MobileMenuItemText>
42-
<AccountBoxIcon sx={itemIcon} />
43-
Log In
44-
</MobileMenuItemText>
45-
</Link>
37+
{loginProviders && (
38+
user ? (
39+
<MobileUserAvatar />
40+
) : (
41+
<MobileMenuItem>
42+
<LoginComponent
43+
loginProviders={loginProviders}
44+
renderButton={(href, onClick) => {
45+
return (<Link href={href} onClick={onClick}>
46+
<MobileMenuItemText>
47+
<AccountBoxIcon sx={itemIcon} />
48+
Log In
49+
</MobileMenuItemText>
50+
</Link>);
51+
}}
52+
/>
4653
</MobileMenuItem>
47-
}
48-
{
49-
!location.pathname.startsWith(UserSettingsRoutes.ROOT)
50-
? <MobileMenuItem>
54+
)
55+
)}
56+
{loginProviders && !location.pathname.startsWith(UserSettingsRoutes.ROOT) && (
57+
<MobileMenuItem>
5158
<RouteLink to='/user-settings/extensions'>
5259
<MobileMenuItemText>
5360
<PublishIcon sx={itemIcon} />
5461
Publish Extension
5562
</MobileMenuItemText>
5663
</RouteLink>
5764
</MobileMenuItem>
58-
: null
59-
}
65+
)}
6066
<MobileMenuItem>
6167
<Link target='_blank' href='https://github.com/eclipse/openvsx'>
6268
<MobileMenuItemText>
@@ -156,7 +162,7 @@ const SubMenuLink = styled(Link)(subMenuLink);
156162

157163

158164
export const DefaultMenuContent: FunctionComponent = () => {
159-
const {service, user} = useContext(MainContext)
165+
const {loginProviders, user} = useContext(MainContext)
160166
const [workingGroupMenuOpen, setWorkingGroupMenuOpen] = useState(false);
161167
const workingGroupMenuEl = useRef<HTMLButtonElement | null>(null);
162168
const toggleWorkingGroupMenu = () => setWorkingGroupMenuOpen(!workingGroupMenuOpen);
@@ -191,16 +197,37 @@ export const DefaultMenuContent: FunctionComponent = () => {
191197
<Button variant='contained' color='secondary' href='/user-settings/extensions' sx={{ mx: 2.5 }}>
192198
Publish
193199
</Button>
194-
{
195-
user ?
196-
<UserAvatar />
197-
:
198-
<IconButton
199-
href={service.getLoginUrl()}
200-
title='Log In'
201-
aria-label='Log In' >
202-
<AccountBoxIcon />
203-
</IconButton>
204-
}
200+
{loginProviders && (
201+
<>
202+
<Button variant='contained' color='secondary' href='/user-settings/extensions' sx={{ mx: 2.5 }}>
203+
Publish
204+
</Button>
205+
{
206+
user ?
207+
<UserAvatar />
208+
:
209+
<LoginComponent
210+
loginProviders={loginProviders}
211+
renderButton={(href, onClick) => {
212+
if (href) {
213+
return (<IconButton
214+
href={href}
215+
title='Log In'
216+
aria-label='Log In' >
217+
<AccountBoxIcon />
218+
</IconButton>);
219+
} else {
220+
return (<IconButton
221+
onClick={onClick}
222+
title='Log In'
223+
aria-label='Log In' >
224+
<AccountBoxIcon />
225+
</IconButton>);
226+
}
227+
}}
228+
/>
229+
}
230+
</>
231+
)}
205232
</>;
206233
}

website/yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,7 +2411,7 @@ __metadata:
24112411
"@types/react-router-dom": "npm:^5.3.3"
24122412
css-loader: "npm:^6.8.1"
24132413
express: "npm:^4.21.2"
2414-
openvsx-webui: "npm:0.15.0"
2414+
openvsx-webui: "npm:0.16.0-next.9ad64f0d"
24152415
source-map-loader: "npm:^4.0.1"
24162416
style-loader: "npm:^3.3.3"
24172417
typescript: "npm:~5.1.6"
@@ -2432,9 +2432,9 @@ __metadata:
24322432
languageName: node
24332433
linkType: hard
24342434

2435-
"openvsx-webui@npm:0.15.0":
2436-
version: 0.15.0
2437-
resolution: "openvsx-webui@npm:0.15.0"
2435+
"openvsx-webui@npm:0.16.0-next.9ad64f0d":
2436+
version: 0.16.0-next.9ad64f0d
2437+
resolution: "openvsx-webui@npm:0.16.0-next.9ad64f0d"
24382438
dependencies:
24392439
"@emotion/react": "npm:^11.11.1"
24402440
"@emotion/styled": "npm:^11.11.0"
@@ -2460,7 +2460,7 @@ __metadata:
24602460
react-router-dom: "npm:^6.14.1"
24612461
peerDependencies:
24622462
"@babel/core": ^7.0.0
2463-
checksum: 10/c3cff9e5cf7043e889d82b6e3421237b9e9ea65773e0559eb5167713d67d47da5196eb9d726105a851171a9a811d91f5070b75cd25142ad07f7aea38c5e23996
2463+
checksum: 10/04e0b2c457790daca609a0c36d67a7ecb22b6a7078e8a54884c30da925b9f8496f1ed6b1ab260d9c4df98cc565f54dcfd2e274f4f803737680e0571f710c92da
24642464
languageName: node
24652465
linkType: hard
24662466

0 commit comments

Comments
 (0)