Skip to content

Commit

Permalink
Merge branch 'dev' into enterprise-license
Browse files Browse the repository at this point in the history
  • Loading branch information
t-aleksander authored Aug 12, 2024
2 parents 2f692e1 + 83c2034 commit 22263af
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lint-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ on:
push:
branches:
- main
- dev
paths:
- "e2e/**"
pull_request:
branches:
- main
- dev
paths:
- "e2e/**"

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ on:
push:
branches:
- main
- dev
paths:
- "web/**"
pull_request:
branches:
- main
- dev
paths:
- "web/**"

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/App/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'react-loading-skeleton/dist/skeleton.css';
import './App.scss';

import { Navigate, Route, BrowserRouter as Router, Routes } from 'react-router-dom';
import { BrowserRouter as Router, Navigate, Route, Routes } from 'react-router-dom';

import { AddDevicePage } from '../../pages/addDevice/AddDevicePage';
import { OpenidAllowPage } from '../../pages/allow/OpenidAllowPage';
Expand Down
17 changes: 11 additions & 6 deletions web/src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,20 +926,24 @@ const en: BaseTranslation = {
title: 'External OpenID Settings',
helper: 'Here you can change general OpenID behavior in your Defguard instance.',
createAccount: {
label: 'Automatically create user account when logging in for the first time through external OpenID.',
helper: 'If this option is enabled, Defguard automatically creates new accounts for users who log in for the first time using an external OpenID provider. Otherwise, the user account must first be created by an administrator.',
label:
'Automatically create user account when logging in for the first time through external OpenID.',
helper:
'If this option is enabled, Defguard automatically creates new accounts for users who log in for the first time using an external OpenID provider. Otherwise, the user account must first be created by an administrator.',
},
},
form: {
title: 'External OpenID Client Settings',
helper: 'Here you can configure the OpenID client settings with values provided by your external OpenID provider.',
custom: "Custom",
helper:
'Here you can configure the OpenID client settings with values provided by your external OpenID provider.',
custom: 'Custom',
documentation: 'Documentation',
delete: 'Delete provider',
labels: {
provider: {
label: 'Provider',
helper: 'Select your OpenID provider. You can use custom provider and fill in the base URL by yourself.',
helper:
'Select your OpenID provider. You can use custom provider and fill in the base URL by yourself.',
},
client_id: {
label: 'Client ID',
Expand All @@ -951,7 +955,8 @@ const en: BaseTranslation = {
},
base_url: {
label: 'Base URL',
helper: 'Base URL of your OpenID provider, e.g. https://accounts.google.com. Make sure to check our documentation for more information and examples.',
helper:
'Base URL of your OpenID provider, e.g. https://accounts.google.com. Make sure to check our documentation for more information and examples.',
},
},
},
Expand Down
20 changes: 13 additions & 7 deletions web/src/i18n/pl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -910,22 +910,27 @@ Uwaga, podane tutaj konfiguracje nie posiadają klucza prywatnego. Musisz uzupe
openIdSettings: {
general: {
title: 'Ustawienia zewnętrznego OpenID',
helper: 'Możesz tu zmienić ogólną mechanikę działania zewnętrznego OpenID w twojej instancji Defguarda.',
helper:
'Możesz tu zmienić ogólną mechanikę działania zewnętrznego OpenID w twojej instancji Defguarda.',
createAccount: {
label: 'Automatycznie twórz konta w momencie logowania przez zewnętrznego dostawcę OpenID',
helper: 'Jeśli ta opcja jest włączona, Defguard automatycznie tworzy nowe konta dla użytkowników, którzy logują się po raz pierwszy za pomocą zewnętrznego dostawcy OpenID. W innym przypadku konto użytkownika musi zostać najpierw utworzone przez administratora.',
label:
'Automatycznie twórz konta w momencie logowania przez zewnętrznego dostawcę OpenID',
helper:
'Jeśli ta opcja jest włączona, Defguard automatycznie tworzy nowe konta dla użytkowników, którzy logują się po raz pierwszy za pomocą zewnętrznego dostawcy OpenID. W innym przypadku konto użytkownika musi zostać najpierw utworzone przez administratora.',
},
},
form: {
title: 'Ustawienia klienta zewnętrznego OpenID',
helper: 'Tutaj możesz skonfigurować ustawienia klienta OpenID z wartościami dostarczonymi przez zewnętrznego dostawcę OpenID.',
custom: "Niestandardowy",
helper:
'Tutaj możesz skonfigurować ustawienia klienta OpenID z wartościami dostarczonymi przez zewnętrznego dostawcę OpenID.',
custom: 'Niestandardowy',
documentation: 'Dokumentacja',
delete: 'Usuń dostawcę',
labels: {
provider: {
label: 'Dostawca',
helper: 'Wybierz swojego dostawcę OpenID. Możesz użyć dostawcy niestandardowego i samodzielnie wypełnić pole URL bazowego.',
helper:
'Wybierz swojego dostawcę OpenID. Możesz użyć dostawcy niestandardowego i samodzielnie wypełnić pole URL bazowego.',
},
client_id: {
label: 'ID klienta',
Expand All @@ -937,7 +942,8 @@ Uwaga, podane tutaj konfiguracje nie posiadają klucza prywatnego. Musisz uzupe
},
base_url: {
label: 'URL bazowy',
helper: 'Podstawowy adres URL twojego dostawcy OpenID, np. https://accounts.google.com. Sprawdź naszą dokumentację, aby uzyskać więcej informacji i zobaczyć przykłady.',
helper:
'Podstawowy adres URL twojego dostawcy OpenID, np. https://accounts.google.com. Sprawdź naszą dokumentację, aby uzyskać więcej informacji i zobaczyć przykłady.',
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/auth/AuthPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import useApi from '../../shared/hooks/useApi';
import { useToaster } from '../../shared/hooks/useToaster';
import { UserMFAMethod } from '../../shared/types';
import { RedirectPage } from '../redirect/RedirectPage';
import { OpenIDCallback } from './Callback/Callback';
import { Login } from './Login/Login';
import { MFARoute } from './MFARoute/MFARoute';
import { useMFAStore } from './shared/hooks/useMFAStore';
import { OpenIDCallback } from './Callback/Callback';

export const AuthPage = () => {
const {
Expand Down
16 changes: 8 additions & 8 deletions web/src/pages/auth/Callback/Callback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import './style.scss';

import { useMutation } from '@tanstack/react-query';
import { AxiosError } from 'axios';

import { useEffect, useState } from 'react';
import { useNavigate } from 'react-router';

import { useI18nContext } from '../../../i18n/i18n-react';
import { Button } from '../../../shared/defguard-ui/components/Layout/Button/Button';
import { LoaderSpinner } from '../../../shared/defguard-ui/components/Layout/LoaderSpinner/LoaderSpinner';
import { useAuthStore } from '../../../shared/hooks/store/useAuthStore';
import useApi from '../../../shared/hooks/useApi';
import { useToaster } from '../../../shared/hooks/useToaster';
import { MutationKeys } from '../../../shared/mutations';
import { CallbackData } from '../../../shared/types';
import { useAuthStore } from '../../../shared/hooks/store/useAuthStore';
import { LoaderSpinner } from '../../../shared/defguard-ui/components/Layout/LoaderSpinner/LoaderSpinner';
import { useToaster } from '../../../shared/hooks/useToaster';
import { useI18nContext } from '../../../i18n/i18n-react';
import { Button } from '../../../shared/defguard-ui/components/Layout/Button/Button';
import { useNavigate } from 'react-router';

export const OpenIDCallback = () => {
const {
Expand Down Expand Up @@ -61,7 +61,7 @@ export const OpenIDCallback = () => {
callbackMutation.mutate(data);
}
}
}, []);
}, [LL.messages, callbackMutation, toaster]);

// TODO: Perhaphs make it a bit more user friendly
return error ? (
Expand Down
2 changes: 2 additions & 0 deletions web/src/pages/auth/Login/components/OidcButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable max-len */
import './style.scss';

import { Button } from '../../../../shared/defguard-ui/components/Layout/Button/Button';
import {
ButtonSize,
Expand Down
26 changes: 18 additions & 8 deletions web/src/pages/auth/Login/components/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@
padding: 0 12px;
position: relative;
text-align: center;
-webkit-transition: background-color .218s, border-color .218s, box-shadow .218s;
transition: background-color .218s, border-color .218s, box-shadow .218s;
-webkit-transition:
background-color 0.218s,
border-color 0.218s,
box-shadow 0.218s;
transition:
background-color 0.218s,
border-color 0.218s,
box-shadow 0.218s;
vertical-align: middle;
white-space: nowrap;
width: auto;
Expand Down Expand Up @@ -62,8 +68,8 @@
}

.gsi-material-button .gsi-material-button-state {
-webkit-transition: opacity .218s;
transition: opacity .218s;
-webkit-transition: opacity 0.218s;
transition: opacity 0.218s;
bottom: 0;
left: 0;
opacity: 0;
Expand All @@ -86,15 +92,19 @@
opacity: 38%;
}

.gsi-material-button:not(:disabled):active .gsi-material-button-state,
.gsi-material-button:not(:disabled):active .gsi-material-button-state,
.gsi-material-button:not(:disabled):focus .gsi-material-button-state {
background-color: #303030;
opacity: 12%;
}

.gsi-material-button:not(:disabled):hover {
-webkit-box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
-webkit-box-shadow:
0 1px 2px 0 rgba(60, 64, 67, 0.3),
0 1px 3px 1px rgba(60, 64, 67, 0.15);
box-shadow:
0 1px 2px 0 rgba(60, 64, 67, 0.3),
0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.gsi-material-button:not(:disabled):hover .gsi-material-button-state {
Expand All @@ -107,4 +117,4 @@
border: none;
cursor: pointer;
padding: 0;
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import './style.scss';

import { useMutation, useQueryClient } from '@tanstack/react-query';

import parse from 'html-react-parser';

import { useI18nContext } from '../../../../../i18n/i18n-react';
import { Helper } from '../../../../../shared/defguard-ui/components/Layout/Helper/Helper';
import { LabeledCheckbox } from '../../../../../shared/defguard-ui/components/Layout/LabeledCheckbox/LabeledCheckbox';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import './style.scss';

import { zodResolver } from '@hookform/resolvers/zod';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import parse from 'html-react-parser';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { SubmitHandler, useForm } from 'react-hook-form';
import { z } from 'zod';

import parse from 'html-react-parser';
import { useI18nContext } from '../../../../../i18n/i18n-react';
import IconCheckmarkWhite from '../../../../../shared/components/svg/IconCheckmarkWhite';
import { FormInput } from '../../../../../shared/defguard-ui/components/Form/FormInput/FormInput';
Expand Down Expand Up @@ -34,6 +34,8 @@ export const OpenIdSettingsForm = () => {
const localLL = LL.settingsPage.openIdSettings;
const [currentProvider, setCurrentProvider] = useState<OpenIdProvider | null>(null);
const queryClient = useQueryClient();
const docsLink =
'https://defguard.gitbook.io/defguard/admin-and-features/external-openid-providers';

const {
settings: { fetchOpenIdProviders, addOpenIdProvider, deleteOpenIdProvider },
Expand Down Expand Up @@ -141,7 +143,7 @@ export const OpenIdSettingsForm = () => {
key: 3,
},
],
[],
[localLL.form],
);

const renderSelected = useCallback(
Expand Down Expand Up @@ -239,10 +241,7 @@ export const OpenIdSettingsForm = () => {
type="password"
/>
</form>
<a
href="https://defguard.gitbook.io/defguard/admin-and-features/external-openid-providers"
target="_blank"
>
<a href={docsLink} target="_blank" rel="noreferrer">
{localLL.form.documentation()}
</a>
</section>
Expand Down

0 comments on commit 22263af

Please sign in to comment.