Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c09caa0
Updated environment configs to account for SIPS account updates. also…
anilnatha Nov 10, 2023
2e4b038
Renamed panel sizing auto save ID for job monitoring UI so it's uniqu…
anilnatha Nov 13, 2023
c40a935
Updated scrolling behavior on job monitoring and new job submission f…
anilnatha Nov 13, 2023
cad2c3f
Updated CSS class names to follow proper CSS naming conventions.
anilnatha Nov 13, 2023
ad4977b
Fixed scrolling behavior on web view component.
anilnatha Nov 13, 2023
01fc1cd
Fix webview variable reference.
anilnatha Nov 13, 2023
e89fb35
Updated CHANGELOG
anilnatha Nov 13, 2023
ef3b2fe
Merge branch 'updates/update-env-configs' into features/update-scroll…
anilnatha Nov 13, 2023
7877fcd
Updated Changelog.
anilnatha Nov 13, 2023
17639ee
Merge pull request #11 from unity-sds/updates/update-env-configs
rtapella Nov 14, 2023
4090bce
Merge branch 'develop' into features/update-scrolling-behavior
rtapella Nov 14, 2023
5aad292
Merge pull request #13 from unity-sds/features/update-scrolling-behavior
rtapella Nov 14, 2023
4dde83d
Update CHANGELOG.md
rtapella Nov 14, 2023
f3126d8
Fixed navbar brand logo link for tablet breakpoint.
anilnatha Dec 5, 2023
b08ef64
Restructured forms to accommodate L1A and L1B job forms. the /jobs/ne…
anilnatha Dec 9, 2023
25aa8cd
Added "BackLink" component to handle navigation back to a given page.…
anilnatha Dec 11, 2023
ffca83c
Added a NoutFound route for improved route error handling.
anilnatha Dec 12, 2023
224b6a8
Added process utility to easily facilitate updating routes and job fo…
anilnatha Dec 12, 2023
eb814a0
Fixed linting errors.
anilnatha Dec 12, 2023
e575c5b
Fixed error reported by linter.
anilnatha Dec 12, 2023
94c12ba
Removed unused css files.
anilnatha Dec 13, 2023
ca4d428
Updated L1B form fields.
anilnatha Dec 13, 2023
daa23a5
Updated L1B forms.
anilnatha Dec 13, 2023
b1bedf8
Updated CHANGELOG.
anilnatha Dec 13, 2023
c3d3aa4
Merge pull request #16 from unity-sds/features/fix-brand-link
rtapella Dec 13, 2023
9f1491f
Merge branch 'develop' into features/update-forms
anilnatha Dec 13, 2023
6e0f3b5
Updated changelog.
anilnatha Dec 13, 2023
e858b70
Merge pull request #17 from unity-sds/features/update-forms
rtapella Dec 13, 2023
795bfa8
Removed extraneous input field.
anilnatha Dec 13, 2023
efd043d
Merge pull request #18 from unity-sds/features/update-forms
rtapella Dec 14, 2023
bbd2330
Added CSS styling for navbar to match Figma designs.
anilnatha Mar 11, 2024
cca5557
Updated Changelog to reflect navbar updates and bumped version number.
anilnatha Mar 11, 2024
4786ea7
Fixed border styling of menu.
anilnatha Mar 18, 2024
1363eba
Fixed border styling between menu items.
anilnatha Mar 19, 2024
2a0ddb8
Fixed letter spacing on menu headers.
anilnatha Mar 19, 2024
f21e0d2
Cleaned up ordering of CSS properties.
anilnatha Mar 19, 2024
cd18fe0
Merge pull request #23 from unity-sds/features/update-navbar-styling
anilnatha Mar 21, 2024
ce8d643
Test docker build by updating event in docker build workflow to match…
anilnatha Apr 1, 2024
0aef358
Added missing apache conf file.
anilnatha Apr 1, 2024
eae37b9
Updated action versions to resolve warnings being reported by GitHub …
anilnatha Apr 1, 2024
6cd17bb
Modified application tooling to allow for stateless production builds…
anilnatha Apr 12, 2024
7e178a5
Modified gitignore for .env.docker.example.
anilnatha Apr 12, 2024
d45d126
Updated Changelog.
anilnatha Apr 12, 2024
fd4a2ca
Updated changelog
anilnatha Apr 12, 2024
8e0b035
Merge branch 'develop' into features/ci-integration
anilnatha Apr 12, 2024
2ff6270
Modified comment in docker-entrypoint.sh
anilnatha Apr 12, 2024
5539d00
Fixed Makefile reference to .env.docker.local
anilnatha Apr 12, 2024
0c437e9
Stubbed in placeholder env for DS stac browser url.
anilnatha Apr 13, 2024
5ef4b6c
Updated a CHANGELOG issue reference.
anilnatha Apr 13, 2024
847dd0d
Merge pull request #24 from unity-sds/features/ci-integration
rtapella Apr 15, 2024
c38b6ec
Updated Release Date for 0.5.0.
anilnatha Apr 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git
*/.git
node_modules
*/node_modules
npm-debug.log
dist
.swc
.env
!.env/.env
21 changes: 20 additions & 1 deletion .env/.env
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
VITE_UNITY_UI_VERSION=${npm_package_version}
# GENERAL
VITE_UNITY_UI_VERSION=${npm_package_version}
VITE_ADMIN_EMAIL=ENV_UNITY_UI_ADMIN_EMAIL

# Auth
VITE_AUTH_OAUTH_CLIENT_ID=ENV_UNITY_UI_AUTH_OAUTH_CLIENT_ID
VITE_AUTH_OAUTH_REDIRECT_URI=ENV_UNITY_UI_AUTH_OAUTH_REDIRECT_URI
VITE_AUTH_OAUTH_LOGOUT_ENDPOINT=ENV_UNITY_UI_AUTH_OAUTH_LOGOUT_ENDPOINT
VITE_AUTH_OAUTH_PROVIDER_URL=ENV_UNITY_UI_AUTH_OAUTH_PROVIDER_URL
VITE_AUTH_APP_ADMIN_GROUP_NAME=ENV_UNITY_UI_AUTH_APP_ADMIN_GROUP_NAME
VITE_AUTH_APP_APP_VIEWER_GROUP_NAME=ENV_UNITY_UI_AUTH_APP_APP_VIEWER_GROUP_NAME

# ADS
VITE_ADS_URL=ENV_UNITY_UI_ADS_URL

# DS
VITE_STAC_BROWSER_URL=ENV_UNITY_UI_STAC_BROWSER_URL

# SPS
VITE_SPS_WPST_ENDPOINT=ENV_UNITY_UI_SPS_WPST_ENDPOINT
18 changes: 0 additions & 18 deletions .env/.env.development

This file was deleted.

19 changes: 19 additions & 0 deletions .env/.env.docker.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# GENERAL
ENV_UNITY_UI_ADMIN_EMAIL=REPLACE_WITH_ADMIN_EMAIL

# Auth
ENV_UNITY_UI_AUTH_OAUTH_CLIENT_ID=REPLACE_WITH_COGNITO_USER_POOL_CLIENT_ID
ENV_UNITY_UI_AUTH_OAUTH_REDIRECT_URI=REPLACE_WITH_URL_OF_APPLICATION_WITH_PORT_IF_NEEDED
ENV_UNITY_UI_AUTH_OAUTH_LOGOUT_ENDPOINT=REPLACE_WITH_COGNITO_DOMAIN/logout
ENV_UNITY_UI_AUTH_OAUTH_PROVIDER_URL=REPLACE_WITH_COGNITO_DOMAIN/oauth2
ENV_UNITY_UI_AUTH_APP_ADMIN_GROUP_NAME=REPLACE_WITH_USER_POOL_ADMIN_GROUP_NAME
ENV_UNITY_UI_AUTH_APP_APP_VIEWER_GROUP_NAME=REPLACE_WITH_USER_PROOL_VIEWER_GROUP_NAME

# ADS
ENV_UNITY_UI_ADS_URL=REPLACE_WITH_ADS_URL

# DS
VITE_STAC_BROWSER_URL=REPLACE_WITH_STAC_BROWSER_URL

# SPS
ENV_UNITY_UI_SPS_WPST_ENDPOINT=REPLACE_WITH_ADES_WPST_URL
18 changes: 0 additions & 18 deletions .env/.env.integration

This file was deleted.

Empty file removed .env/.env.production
Empty file.
Empty file removed .env/.env.staging
Empty file.
30 changes: 30 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Docker Build and Push

on:
push:
branches:
- main # or any other branch you want to trigger the workflow
- "features/*"

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Log in to Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io # replace with your registry if different
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push "Latest" Docker image
id: build-and-push-latest
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}/unity-ui-application:latest # replace with your image name and tag
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
.env
!.env/.env
!.env/.env.docker.example

node_modules
dist
Expand Down
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.0] 2024-04-15
- Updated Navbar CSS styling to match Figma designs [#5](https://github.com/unity-sds/unity-ui/issues/5)
- Added CI/CD workflow to build application as a docker image. [#21](https://github.com/unity-sds/unity-ui/issues/21)
- Updated application build configuration. Stateful information has been removed from project configuration. Instead we now allow environment variables to be supplied to the container at startup which in turn get injected into the Unity UI Codebase. This is in support of moving to dynamic configuration of the application via Unity Marketplace. Related to [#3](https://github.com/unity-sds/unity-sds-portal/issues/3)

## [0.4.0] - 2023-12-13
- Updated /job/new endpoint so it lists the applications for which jobs may be executed.
- Moved chirp rebinning job form to /jobs/new/chirp
- Added job submission forms for L1A and L1B PGEs
- Added process utility to help facilitate changes listed above.

## [0.3.1] - 2023-12-12
- Fixed link associated with logo on mobile platforms

## [0.3.0] - 2023-11-13

- Updated environment configurations to account for SIPS-TEST deployments
- Updated scrolling behavior for all UIs so they can be scrolled independently from the navbar. And in the case of the Job Monitoring UI, the detail view scrolls independently from the main view.

## [0.2.0] - 2023-10-02

- Updated Job Monitoring Dashboard, data is fetched from WPS-T Endpoint
Expand All @@ -29,4 +48,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Integration of React Stellar Navbar component [#73](https://github.com/unity-sds/unity-project-management/issues/73)
- Developed Jobs Monitoring Dashboard — currently loads static data - [#1](https://github.com/unity-sds/unity-jobs-ui/issues/1), [#4],(https://github.com/unity-sds/unity-jobs-ui/issues/4)[#12], (https://github.com/unity-sds/unity-jobs-ui/issues/12)
- Jobs Detail view [#72](https://github.com/unity-sds/unity-jobs-ui/issues/18)
- Integration of generic web view for loading third-party user interfaces
- Integration of generic web view for loading third-party user interfaces
56 changes: 56 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
############################################################
############################################################
# Code Building Stage

FROM node:lts-hydrogen as builder

RUN apt-get update

# Create app directory
WORKDIR /usr/src/app

# Copy source to workdir
COPY . .

# Install dependencies
RUN npm clean-install

# Build distribution
RUN npm run build

############################################################
############################################################
# Build Image Stage

FROM ubuntu:18.04
LABEL version="0.1.0"

ENV UNITY_WWW_ROOT=/var/www/unity-ui
ENV ENTRYPOINT_FOLDER=/entrypoint.d

RUN apt-get update \
&& apt-get install -y apache2 \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

# Create app directory and copy distribution code from builder stage
WORKDIR ${UNITY_WWW_ROOT}
COPY --from=builder /usr/src/app/dist ./

# Configure apache2
COPY ./etc/apache2/sites-available/unity-ui.conf /etc/apache2/sites-available/
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
RUN a2dissite 000-default.conf
RUN a2ensite unity-ui.conf

# Copy and set up files needed for container startup
COPY ./entrypoint.d/* ${ENTRYPOINT_FOLDER}/
RUN chmod 777 -R ${ENTRYPOINT_FOLDER}/* && chmod +x -R ${ENTRYPOINT_FOLDER}/*

EXPOSE 80

# Default process to run on container startup
ENTRYPOINT ["/entrypoint.d/docker-entrypoint.sh"]

# Default options to pass to apache when starting container in docker-entrypoint.sh
CMD ["-k", "start"]
44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
export IMAGE_NAME = unity-ui
export CONTAINER_NAME = unity-ui
export RUN_OPTIONS =

build-no-cache: RUN_OPTIONS = "--no-cache"
build-no-cache: build

build:
docker buildx build --progress=plain $(RUN_OPTIONS) -t ${IMAGE_NAME} -f Dockerfile .

destroy-container:
docker container rm ${CONTAINER_NAME}

destroy-image:
docker image rm ${IMAGE_NAME}

kill:
docker kill ${CONTAINER_NAME}

run:
docker run --env-file=./.env/.env.docker -t -i --rm -p 8080:80 --name ${CONTAINER_NAME} ${IMAGE_NAME}

start:
docker start ${CONTAINER_NAME}

stop:
docker stop ${CONTAINER_NAME}

# ----------------------------------------------------------------------------
# Self-Documented Makefile
# ref: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
# ----------------------------------------------------------------------------
help: ## (DEFAULT) This help information
@echo ====================================================================
@grep -E '^## .*$$' \
$(MAKEFILE_LIST) \
| awk 'BEGIN { FS="## " }; {printf "\033[33m%-24s\033[0m \n", $$2}'
@echo
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' \
$(MAKEFILE_LIST) \
| awk 'BEGIN { FS=":.*?## " }; {printf "\033[36m%-24s\033[0m %s\n", $$1, $$2}' \
# | sort
.PHONY: help
.DEFAULT_GOAL := help
11 changes: 11 additions & 0 deletions entrypoint.d/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
#set -x; : "$0" "$@" # Use for debugging

# Inject Environment Variables for React App
source ${ENTRYPOINT_FOLDER}/env.sh

rm -f /var/run/apache2/apache2.pid

# Run the main container process
# (Arguments for Apache supplied from the Dockerfile CMD)
exec /usr/sbin/apachectl -D FOREGROUND "$@"
12 changes: 12 additions & 0 deletions entrypoint.d/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
for i in $(env | grep ENV_UNITY_UI_)
do
key=$(echo $i | cut -d '=' -f 1)
value=$(echo $i | cut -d '=' -f 2-)
echo $key=$value
# sed All files
# find $UNITY_WWW_ROOT -type f -exec sed -i "s|${key}|${value}|g" '{}' +

# sed .js only
find $UNITY_WWW_ROOT -type f \( -name '*.js' \) -exec sed -i "s|${key}|${value}|g" '{}' +
done
15 changes: 15 additions & 0 deletions etc/apache2/sites-available/unity-ui.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<VirtualHost *:80>

ServerName localhost
DocumentRoot /var/www/unity-ui/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

<Directory /var/www/unity-ui/>
Options -Indexes
AllowOverride All
Order allow,deny
allow from all
</Directory>

</VirtualHost>
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "unity-ui",
"private": true,
"version": "0.2.0",
"version": "0.5.0",
"type": "module",
"scripts": {
"dev": "vite",
"build-integration": "tsc && vite build --mode integration --base=/dashboard/",
"build-staging": "tsc && vite build --mode staging --base=/dashboard/",
"build-prod": "tsc && vite build --mode production",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
Expand Down
5 changes: 5 additions & 0 deletions src/Config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ const Config = {

}

if( import.meta.env.DEV ) {
// Output Configuration on every call to help with debugging only in DEV mode
console.log(Config)
}

export default Config;
26 changes: 23 additions & 3 deletions src/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,45 @@ import {
import Home from "./routes/home"
import JobMonitoring from "./routes/jobs/monitoring";
import NewJob from "./routes/jobs/new";

import Navbar from "./components/Navbar"
import WebView from "./components/WebView";

import Config from "./Config";

import { getProcesses, getProcessRoute } from "./utils/processes";
import NotFound from "./routes/errors/not-found";

function Root() {

const processes = getProcesses();

return (
<>
<div className="viewWrapper">
<Navbar />
<div className="view">
<Routes>
<Route path="/applications/catalog" element={<WebView url={Config.ads.url} />} />
<Route path="/jobs/monitoring" element={<JobMonitoring />} />
<Route path="/jobs/monitoring/:jobid_param" element={<JobMonitoring />} />
<Route path="/jobs/new" element={<NewJob />} />
<Route path="*" element={<Home />} />

{
/* Add routes for job execution forms */
processes.map( (item) => {
const path = "/jobs/new/" + item['id'];
const route:JSX.Element | null = getProcessRoute(item['id']);
return (
<Route path={path} element={ (route) ? route : <NotFound />} key={"route_" + item['id']}/>
)
})
}

<Route path="/" element={<Home />} />
<Route path="*" element={<NotFound />} />
</Routes>
</div>
</>
</div>
)
}

Expand Down
Loading