Skip to content

Commit

Permalink
Merge pull request janus-idp#78 from mareklibra/FLPATH-224.notificati…
Browse files Browse the repository at this point in the history
…onService

FLPATH-224: Add notification-service UI
  • Loading branch information
mareklibra authored Apr 3, 2023
2 parents 30a2be7 + cb9da7d commit c62ce31
Show file tree
Hide file tree
Showing 16 changed files with 487 additions and 168 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,6 @@ jobs:
#git tag -f -a ${{ github.ref_name }} -m '${{ github.ref_name }}'
#git push origin ${{ github.ref_name }} --force
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH_PARODOS }}
base: main
commit-message: 'Bump version to ${{ steps.new-version.outputs.new_version }}'
title: 'Bump version to ${{ steps.new-version.outputs.new_version }}'
body: >
This PR is auto-generated
branch: 'release/${{ steps.new-version.outputs.new_version }}'

- name: Install dependencies
run: yarn install --frozen-lockfile

Expand All @@ -87,3 +76,14 @@ jobs:
run: |
cd plugins/parodos
yarn publish --no-git-tag-version
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH_PARODOS }}
base: main
commit-message: 'Bump version to ${{ steps.new-version.outputs.new_version }}'
title: 'Bump version to ${{ steps.new-version.outputs.new_version }}'
body: >
This PR is auto-generated
branch: 'release/${{ steps.new-version.outputs.new_version }}'
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# [Backstage](https://backstage.io)

This is your newly scaffolded Backstage App, Good Luck!

To start the app, run:

```sh
Expand All @@ -11,14 +9,7 @@ yarn dev

## Local development

For local development set the `PARODOS_AUTH_KEY` environment variable to 'Basic dGVzdDp0ZXN0'. This token is base64 encoded string containing `test:test`. You can also use `PARODOS_AUTH_KEY="Basic dGVzdDp0ZXN0" yarn dev` to start development environment with the test token. You can also create an `app-config.local.yaml` file with the following content to automatically include the token.

```yaml
proxy:
'/parodos':
headers:
Authorization: 'Basic dGVzdDp0ZXN0'
```
The Parodos username is `test`, password `test`.

## Distribution

Expand Down
10 changes: 10 additions & 0 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ proxy:
accept: 'application/json'
# Authorization: ${PARODOS_AUTH_KEY}

'/parodos-notifications':
target: 'http://localhost:8081/api/v1'
changeOrigin: true
redirect: follow
cache: 'no-cache'
headers:
Content-Type: 'application/json'
accept: 'application/json'
Authorization: ${PARODOS_NOTIFICATION_AUTH_KEY}

# Reference documentation http://backstage.io/docs/features/techdocs/configuration
# Note: After experimenting with basic setup, use CI/CD to generate docs
# and an external cloud storage when deploying TechDocs for production use-case.
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@backstage/theme": "^0.2.17",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@parodos/plugin-parodos": "0.4.2",
"@parodos/plugin-parodos": "0.4.3",
"@parodos/plugin-parodos-auth": "^0.1.0",
"history": "^5.0.0",
"react": "^17.0.2",
Expand Down
19 changes: 10 additions & 9 deletions plugins/parodos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,20 @@ const routes = (
headers:
Content-Type: 'application/json'
accept: 'application/json'
Authorization: ${PARODOS_AUTH_KEY}

'/parodos-notifications':
target: 'http://localhost:8081/api/v1'
changeOrigin: true
redirect: follow
cache: 'no-cache'
headers:
Content-Type: 'application/json'
accept: 'application/json'
```
## Local development
For local development set the `PARODOS_AUTH_KEY` environment variable to 'Basic dGVzdDp0ZXN0'. This token is base64 encoded string containing `test:test`. You can also use `PARODOS_AUTH_KEY="Basic dGVzdDp0ZXN0" yarn dev` to start development environment with the test token. You can also create an `app-config.local.yaml` file with the following content to automatically include the token.
```yaml
proxy:
'/parodos':
headers:
Authorization: 'Basic dGVzdDp0ZXN0'
```
For local development, the application username is `test`, password `test`.
## Release
Expand Down
2 changes: 2 additions & 0 deletions plugins/parodos/src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export const App = () => {
setBaseUrl(backendUrl);

async function initialiseStore() {
// We do not pre-fetch notifications, let's do that on demand.
// TODO: fetch unread notificaionts count and keep it updated to render te tip to the user.
await Promise.all([fetchProjects(fetch), fetchDefinitions(fetch)]);
}

Expand Down
4 changes: 4 additions & 0 deletions plugins/parodos/src/components/Loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Progress } from '@backstage/core-components';
import React from 'react';

export const Loading: React.FC = () => <Progress />;
Loading

0 comments on commit c62ce31

Please sign in to comment.