Skip to content

Commit

Permalink
Misc improvements (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
turboMaCk authored and ICTGuerrilla committed Aug 10, 2023
1 parent 9a27223 commit f74a156
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is what we use to run ICT Union.

Overall system is a collection of sub systems (components) used to manage
System is a collection of sub systems (components) used to manage
and run the system of the union organization.

This helps us to have much finer grain control over permissions.
Expand All @@ -17,9 +17,9 @@ Every sub-system has its own documentation within README.md file!

| name | status | role |
|----------------------------------|-----------------------------------------------------------------------|------------------------------------------|
| [Gray Whale](gray-whale) | ![status](actions/workflows/gray-whale.yaml/badge.svg?branch=main) | Database migrations and management |
| [Orca](orca) | ![status](actions/workflows/orca.yaml/badge.svg?branch=main) | Registration and members management |
| [Member's Panel](memebers-panel) | ![status](actions/workflows/members-panel.yaml/badge.svg?branch=main) | Entry dashboard for organization members |
| [Gray Whale](gray-whale) | ![status](/ictunion/main-system/actions/workflows/gray-whale.yaml/badge.svg?branch=main) | Database migrations and management |
| [Orca](orca) | ![status](/ictunion/main-system/actions/workflows/orca.yaml/badge.svg?branch=main) | Registration and members management |
| [Member's Panel](members-panel) | ![status](/ictunion/main-system/actions/workflows/members-panel.yaml/badge.svg?branch=main) | Entry dashboard for organization members |

## Goals

Expand Down
6 changes: 2 additions & 4 deletions members-panel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Work In Progress!**

Access entry dashboard for organization members
Access entry dashboard for organization members.

## Setup

Expand All @@ -12,9 +12,7 @@ First define configuration starting from example file:
cp config.example.json example.json
```

Configuration is compile-time. It's used to produce static file where all the configuration options
are inlined. This means that configuration file is used to configure buid
prior to invoking compiler.
Configuration happens in compile-time. All compilation options are inlined into artifacts during compilation.

Start development server:

Expand Down
12 changes: 8 additions & 4 deletions members-panel/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ interface AppState {
userInfo: UserInfo;
}

export default class App extends React.Component<Keycloak, AppState> {
constructor(props: Keycloak) {
interface Props {
keycloak: Keycloak;
}

export default class App extends React.Component<Props, AppState> {
constructor(props: Props) {
super(props);

this.state = {
userInfo: null
};

props.loadUserInfo().then((userInfo: UserInfo) => {
props.keycloak.loadUserInfo().then((userInfo: UserInfo) => {
this.setState((state) => {
return {
...state, userInfo: userInfo
Expand All @@ -33,7 +37,7 @@ export default class App extends React.Component<Keycloak, AppState> {
}

logout() {
this.props.logout();
this.props.keycloak.logout();
}

render() {
Expand Down
5 changes: 2 additions & 3 deletions members-panel/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import initKeycloak from './keycloak';
import App from './App';

window.addEventListener("load", () => {
initKeycloak().then(k => {
console.log(k.hasRealmRole('registration-procession'));
ReactDOM.render(React.createElement(App, k), document.getElementById('app'));
initKeycloak().then(keycloak => {
ReactDOM.render(React.createElement(App, { keycloak }), document.getElementById('app'));
});
});
6 changes: 1 addition & 5 deletions members-panel/test.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
with (import <nixpkgs> {});
callPackage ./. {
nodejs = nodejs-18_x;
config = {
keycloak_url = "https://keycloak.ictunion.cz";
keycloak_realm = "members";
keycloak_client_id = "test-client";
};
config = builtins.fromJSON (builtins.readFile ./config.example.json);
}

0 comments on commit f74a156

Please sign in to comment.