Skip to content
This repository has been archived by the owner on Sep 19, 2022. It is now read-only.

Commit

Permalink
v0.4.0 (#93)
Browse files Browse the repository at this point in the history
* Update go.sum

* Login dialog - early draft

* Crypto utils, sessions setup

* Fixed cache.hashGetObject

* Remove gin-contrib/sessions module

* Login options with tests

* Login options and security principal

* Glob permissions

* GitHub oauth flow - draft

* OAuth - GitHub and Azure basic flow

* Persist principal ID in the cookie

* Saving principal

* age stored as JSON

* Login with Google

* Fix tests

* Checking principal permissions

* Save user's ID

* Save user agent, delete cookie

* Controllable Login control

* Assign principal to session

* "login" renamed to "signin" everywhere

* Assign principal to session and hide signin dialog

* Sign in, sign out

* canAccess

* /public/{page_name} renamed to /p/{page_name}

* https://app.pglet.io -> https://console.pglet.io

* A separate proxy command

* Update principal on every page load

* Theming moved to a separate module

* UpdateTheme and Dark

* Trying to adjust some elements of the scheme

* Start proxy service only for web-only apps

* Standard light/dark themes

* Fixed auth cookie lifetime

* Loading message changed

* Added HTML control

* Customized dark theme

* Make white more dimmer

* Correct resources cleanup after Host clients

* Update strings_test.go

* Using Google Secret Manager for storing secrets

* Added logging

* Proxy service renamed to Client, "web" arg renamed to "local"

* run the app on the local instance of Pglet server
  • Loading branch information
FeodorFitsner committed May 21, 2021
1 parent 3d9358e commit 33c2f3f
Show file tree
Hide file tree
Showing 63 changed files with 2,545 additions and 849 deletions.
8 changes: 0 additions & 8 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@ import "./App.css";
import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
import { PageLanding } from './controls/PageLanding'
import { AccountLanding } from './controls/AccountLanding';
import { FluentSample } from './playground/FluentSample';
import { ButtonSample } from './playground/ButtonSample';
import { GridSample } from './playground/GridSample';
import { ChartSample } from './playground/ChartSample';

export const App: React.FunctionComponent = () => {
return (
<Router>
<Switch>
<Route path="/:accountName/:pageName" children={<PageLanding />} />
<Route path="/sample" children={<FluentSample />} />
<Route path="/button-sample" children={<ButtonSample />} />
<Route path="/grid-sample" children={<GridSample />} />
<Route path="/charts-sample" children={<ChartSample />} />
<Route path="/:accountName" children={<AccountLanding />} />
<Route path="/" children={<PageLanding />} />
</Switch>
Expand Down
7 changes: 5 additions & 2 deletions client/src/WebSocket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
registerWebClientError,
appBecomeInactive,
sessionCrashed,
signout,
addPageControlsSuccess,
addPageControlsError,
replacePageControlsSuccess,
Expand Down Expand Up @@ -62,7 +63,7 @@ export const WebSocketProvider: React.FC<React.ReactNode> = ({children}) => {

if (data.action === "registerWebClient") {
if (data.payload.error) {
dispatch(registerWebClientError(data.payload.error));
dispatch(registerWebClientError(data.payload));
} else {
dispatch(registerWebClientSuccess({
pageName: _registeredPageName,
Expand All @@ -73,7 +74,9 @@ export const WebSocketProvider: React.FC<React.ReactNode> = ({children}) => {
} else if (data.action === "appBecomeInactive") {
dispatch(appBecomeInactive(data.payload));
} else if (data.action === "sessionCrashed") {
dispatch(sessionCrashed(data.payload));
dispatch(sessionCrashed(data.payload));
} else if (data.action === "signout") {
dispatch(signout(data.payload));
} else if (data.action === "addPageControls") {
if (data.payload.error) {
dispatch(addPageControlsError(data.payload.error));
Expand Down
18 changes: 18 additions & 0 deletions client/src/assets/img/github-logo-white.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions client/src/assets/img/github-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions client/src/assets/img/google-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/src/assets/img/logo_light.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions client/src/assets/img/microsoft-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions client/src/assets/img/pglet-logo-no-text.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions client/src/controls/Control.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,19 @@ export interface IControlsListProps {
export interface IPageProps {
pageName: string;
control: any;
updateTheme: (standardTheme:any, themePrimaryColor:any, themeTextColor:any, themeBackgroundColor:any) => any;
}

export interface ISigninOptions {
gitHubEnabled: boolean;
gitHubGroupScope: boolean;
azureEnabled: boolean;
azureGroupScope: boolean;
googleEnabled: boolean;
googleGroupScope: boolean;
}

export interface ISigninProps {
signinOptions: ISigninOptions;
onDismiss?: () => any;
}
2 changes: 2 additions & 0 deletions client/src/controls/ControlsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { MySpinner } from './Spinner'
import { MySlider } from './Slider'
import { Button } from './Button'
import { MyText } from './Text'
import { Html } from './Html'
import { MyImage } from './Image'
import { MyLink } from './Link'
import { MyDatePicker } from './DatePicker'
Expand Down Expand Up @@ -47,6 +48,7 @@ export const ControlsList: React.FunctionComponent<IControlsListProps> = ({ cont
'spinner': MySpinner,
'slider': MySlider,
'text': MyText,
'html': Html,
'spinbutton': MySpinButton,
'link': MyLink,
'image': MyImage,
Expand Down
8 changes: 8 additions & 0 deletions client/src/controls/Html.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react'
import { IControlProps } from './Control.types'

export const Html = React.memo<IControlProps>(({control}) => {

const content = control.value ? control.value : "";
return <div dangerouslySetInnerHTML={{ __html: content }} />;
})

0 comments on commit 33c2f3f

Please sign in to comment.