Merge branch 'main' into feat/protect-users-endpoint

This commit is contained in:
Davor 2022-07-06 19:53:07 +02:00
commit e7c4695a66
7 changed files with 94 additions and 34 deletions

View file

@ -1,2 +1,2 @@
REACT_APP_API_URL=http://127.0.0.1:5000/api/v1
REACT_APP_HYDRA_PUBLIC_URL=https://sso.init.stackspin.net
REACT_APP_API_URL=http://stackspin_proxy:8081/api/v1
REACT_APP_HYDRA_PUBLIC_URL=https://sso.init.stackspin.net

View file

@ -1,46 +1,65 @@
# Getting Started with Create React App
# Stackspin Dashboard
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This repo hosts the Stackspin Dashboard frontend code.
The backend code is located at
<https://open.greenhost.net/stackspin/dashboard-backend>.
## Available Scripts
## Development environment
In the project directory, you can run:
### Setup
### `yarn start`
Create a `.env` file in the project root directory:
Runs the app in the development mode.\
cp .env.example .env
and adjust the `REACT_APP_HYDRA_PUBLIC_URL` to the SSO URL of your cluster.
#### `yarn start`
Runs the app in the development mode.
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.\
The page will reload if you make edits.
You will also see any lint errors in the console.
### `yarn test`
#### `yarn test`
Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
Launches the test runner in the interactive watch mode.
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests)
for more information.
### `yarn build`
#### `yarn build`
Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
Builds the app for production to the `build` folder.
It correctly bundles React in production mode and optimizes the build
for the best performance.
The build is minified and the filenames include the hashes.\
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment)
for more information.
### `yarn eject`
#### `yarn eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
If you arent satisfied with the build tool and configuration choices,
you can `eject` at any time. This command will remove the single build dependency
from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
Instead, it will copy all the configuration files and the transitive dependencies
(webpack, Babel, ESLint, etc) right into your project so you have full control
over them.
All of the commands except `eject` will still work, but they will point to the
copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
You dont have to ever use `eject`. The curated feature set is suitable for
small and middle deployments, and you shouldnt feel obligated
to use this feature.
However we understand that this tool wouldnt be useful
if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).

View file

@ -1,5 +1,39 @@
# [1.0.0]
# Changelog
## Bug fixes
## [1.0.4]
* Resolve "New dashboard user management blocks all apps for admin user" #61
### Bug fixes
* Don't fail initialize-user job when Dashboard app is already configured #64
### Updates
* Update dashboard-backend to v0.2.6
## [1.0.3]
### Features
* Update frontend to 0.2.5
## [1.0.2]
### Features
* Update backend to 0.2.5
### Bug fixes
* Check if app exists before inserting into DB on initialization #64
## [1.0.1]
### Bug fixes
* Resolve "App access role is not persistent" #63
## [1.0.0]
### Bug fixes
* Resolve "New dashboard user management blocks all apps for admin user" #61

View file

@ -1,7 +1,7 @@
annotations:
category: Dashboard
apiVersion: v2
appVersion: 0.2.4
appVersion: 0.2.5
dependencies:
- name: common
# https://artifacthub.io/packages/helm/bitnami/common
@ -23,4 +23,4 @@ name: stackspin-dashboard
sources:
- https://open.greenhost.net/stackspin/dashboard/
- https://open.greenhost.net/stackspin/dashboard-backend/
version: 1.0.0
version: 1.0.4

View file

@ -68,7 +68,7 @@ dashboard:
image:
registry: open.greenhost.net:4567
repository: stackspin/dashboard/dashboard
tag: 0-1-9
tag: 0-2-5
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
@ -235,7 +235,7 @@ backend:
image:
registry: open.greenhost.net:4567
repository: stackspin/dashboard-backend/dashboard-backend
tag: 0-2-4
tag: 0-2-6
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/

View file

@ -2,7 +2,7 @@ import React from 'react';
import { useController } from 'react-hook-form';
/* eslint-disable react/react-in-jsx-scope */
export const Input = ({ control, name, type = 'text', label, ...props }: InputProps) => {
export const Input = ({ control, name, type = 'text', label, required, ...props }: InputProps) => {
const {
field,
// fieldState: { invalid, isTouched, isDirty },
@ -10,7 +10,7 @@ export const Input = ({ control, name, type = 'text', label, ...props }: InputPr
} = useController({
name,
control,
rules: { required: true },
rules: { required },
defaultValue: '',
});

View file

@ -134,11 +134,18 @@ export const UserModal = ({ open, onClose, userId, setUserId }: UserModalProps)
<div className="mt-6 grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6">
<div className="sm:col-span-3">
<Input control={control} name="name" label="Name" onKeyPress={handleKeyPress} />
<Input control={control} name="name" label="Name" onKeyPress={handleKeyPress} required={false} />
</div>
<div className="sm:col-span-3">
<Input control={control} name="email" label="Email" type="email" onKeyPress={handleKeyPress} />
<Input
control={control}
name="email"
label="Email"
type="email"
onKeyPress={handleKeyPress}
required
/>
</div>
{isAdmin && (
<>