Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
f314e6e
remove template-based hamburger menu, sidebar nav, and separate heade…
eapearson Sep 3, 2021
a2db61c
formatted w/prettier (tabs 4 -> 2)
eapearson Sep 3, 2021
2499e9e
index, main js entry point, now just wrapper around App.
eapearson Sep 3, 2021
731c2a2
support importing css in tests
eapearson Sep 7, 2021
35a32b1
dev docker-compose supports working with kbase-ui
eapearson Sep 7, 2021
4d623a3
refactor layout to use single component, refactor auth into context t…
eapearson Sep 7, 2021
e08cf5d
remove console log
eapearson Sep 7, 2021
f2e49cb
prettier-formatted
eapearson Sep 7, 2021
5d021a4
remove console log
eapearson Sep 8, 2021
da7067a
use start_server script for reset as well; important because the star…
eapearson Sep 9, 2021
d7f5224
update README (I know, there are more updates coming).
eapearson Sep 13, 2021
ef0be33
add missing environment variable; document env vars
eapearson Sep 13, 2021
0b9e5ca
enhance script to create docker network if need be
eapearson Sep 13, 2021
8389d84
add development doc
eapearson Sep 13, 2021
3b3bbc1
[SCT-3123] update deployment docs (more changes coming, surely)
eapearson Sep 13, 2021
3a29240
[SCT-3123] fix typo in Sanic app name, remove unused routes and templ…
eapearson Sep 13, 2021
ef0fb1f
[SCT-3123] remove unnecessary condition in if statement (/ is already…
eapearson Sep 13, 2021
292471e
[SCT-3123] remove unused styles
eapearson Sep 13, 2021
dd96fd4
[SCT-3123] quotes normalized by prettier, remove unnecessary comment
eapearson Sep 13, 2021
6aab1f1
update dependencies with no major version changes (those are next!)
eapearson Sep 13, 2021
fce888b
[SCT-3123] A set of major version dependency updates; only one code c…
eapearson Sep 14, 2021
ccab10a
add testing-library (in addition to enzyme); it is the recommended (f…
eapearson Sep 14, 2021
c3a2015
switch to react-select (already used in codebase) rather than custom …
eapearson Sep 14, 2021
fcc7ea3
Merge remote-tracking branch 'origin/main' into fix-SCT-3123
eapearson Sep 14, 2021
2f0d1f0
remove unused components; these were part of an original effort to en…
eapearson Sep 14, 2021
e62deb5
improve formatting (slightly)
eapearson Sep 14, 2021
04a1c91
set search input as type ... "search"; this will enable search-friend…
eapearson Sep 15, 2021
7f5cf2c
rot via npm (npx's) built-in package.json sorter "npx sort-package-json"
eapearson Sep 22, 2021
4ff77d7
for login for unauthenticated on a kbase.us host, show error alert ot…
eapearson Sep 22, 2021
5766b0c
remove unused paths; also, they could not possibly hagve been invoked…
eapearson Sep 22, 2021
e799eab
fix issues pointed out by code quality tools.
eapearson Sep 22, 2021
a6180e6
add specific hostnames for local docker compose; for some reason the …
eapearson Sep 22, 2021
37aaab5
Improve alt attribute for gravatar image
eapearson Sep 22, 2021
a564625
Handle case of no gravatarDefault; defaults to 'identicon'.
eapearson Sep 22, 2021
7cf5e16
Add simple error message component; uses bootstrap alert styling and …
eapearson Sep 22, 2021
78008cb
Add simpler Loading component, just shows message, uses bootstrap ale…
eapearson Sep 22, 2021
7362741
remove unused unauthorized page
eapearson Sep 22, 2021
19283e5
handle auth loading and resolution state in Main; remove from dashboa…
eapearson Sep 22, 2021
d70229f
Remove console log
eapearson Sep 22, 2021
2b38166
Fix test
eapearson Sep 22, 2021
46aa960
remove commented-out test code
eapearson Sep 22, 2021
daa76cd
simplify filter; state not required sort option; sequenced setStates …
eapearson Sep 22, 2021
0c63af0
remove commented-out code
eapearson Sep 22, 2021
b2d26a8
remove unused state property and associated event handler
eapearson Sep 22, 2021
e47f0b6
improve language on public/private switch
eapearson Sep 22, 2021
f58e1ed
Remove unused state property
eapearson Sep 22, 2021
c96ed91
remove unused state property
eapearson Sep 22, 2021
648a4dd
last update dependencies. now all caught up! there were security alerts.
eapearson Sep 23, 2021
8ce708b
fix errant );
eapearson Sep 23, 2021
f213245
constrain width to 1024px; regression.
eapearson Sep 23, 2021
4f48698
fix test broken by dep update
eapearson Sep 23, 2021
58169a1
fix typing error from dep update to history
eapearson Sep 23, 2021
9c2ab2e
remove unused component
eapearson Sep 23, 2021
5ef57ab
fix usage of updated react-select
eapearson Sep 23, 2021
b387835
revert history update; local tests pass, but not in gha for some reason
eapearson Sep 23, 2021
c21481e
Add basic tests for some new components; update jest config so testin…
eapearson Sep 23, 2021
90dca54
Complete (coverage-wise) BrowserAuth tests, and, er, fix an unused st…
eapearson Sep 23, 2021
5b21e83
remove unused component
eapearson Sep 23, 2021
169916a
normalize naming of not found page, add tests
eapearson Sep 23, 2021
8b715f2
update release notes
eapearson Sep 23, 2021
f98fe26
remove unused import
eapearson Sep 23, 2021
2e76290
remove commented-out config
eapearson Oct 14, 2021
0a68942
fix document string
eapearson Oct 14, 2021
a8023a2
move docker-compose with proxying into /dev; top level docker-compose…
eapearson Oct 14, 2021
077f092
add local docker container stop tasks, and production build start/sto…
eapearson Oct 14, 2021
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
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ All notable changes to this project are 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).

## [Unreleased] - 2021-09-13
## [Unreleased] - 2021-09-23

### Added

- SCT-3129: add GHA workflow which supports test and build for all scenarios - feature and fix branches, pull requests, merges to master, and releases - and pushes to GHCR. Also names the resulting image/package `navigator`, the new canonical name for this repo/product.
- SCT-3123: Added testing-library support

### Changed

Expand All @@ -32,7 +33,8 @@ none
- add "-n" to entr, otherwise broken
- Fix broken tests
- Fixed Typescript usage (errors reported by latest TS)
- SCT-3123: Fix duplicate auth calls up on app startup; significant refactoring to enable this.

### Security

none
- all NPM dependencies updated; resolving outstanding security alerts
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
serve:
docker-compose down
sh dev/start_server.sh
cd dev; \
sh start_server.sh

serve-stop:
cd dev; sh stop_server.sh

watch:
yarn watch

reset:
docker-compose down --rmi all --remove-orphans --volumes
docker-compose build --no-cache
docker-compose up
cd dev; \
docker compose down --rmi all --remove-orphans --volumes; \
docker compose build --no-cache; \
sh start_server.sh

serve-prod:
docker compose --project-name navigator-prod up --build; \
docker compose --project-name navigator-prod rm -f

serve-prod-stop:
docker compose --project-name navigator-prod stop
File renamed without changes.
39 changes: 39 additions & 0 deletions dev/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: '3'
networks:
kbase-dev:
name: kbase-dev
services:
navigator:
hostname: navigator
build:
context: ..
dockerfile: Dockerfile
args:
DEVELOPMENT: 1
environment:
- PYTHONUNBUFFERED=1
- DEVELOPMENT=1
# KBASE_ENDPOINT defaults to the ci_proxy for development; used for KBase service endpoint urls
- KBASE_ENDPOINT=${KBASE_ENDPOINT:-http://localhost:5011/services}
# KBASE_ROOT defaults to the CI origin for development; used for KBase user interface urls
- KBASE_ROOT=${KBASE_ROOT:-https://ci.kbase.us}
# URL_PREFIX defaults to an empty string for development; set to "narratives" for deployments, including
# development with the kbase-ui proxy
- URL_PREFIX
- WORKERS=2
networks:
- kbase-dev
ports:
- '127.0.0.1:5000:5000'
volumes:
- ${PWD}/..:/app

# Proxy requests from localhost:5011 to ci.kbase.us
# (for getting around CORS restrictions)
ci_proxy:
hostname: navigator_ci_proxy
image: nginx:alpine
ports:
- '127.0.0.1:5011:5011'
volumes:
- ./nginx-default.conf:/etc/nginx/conf.d/default.conf
5 changes: 0 additions & 5 deletions dev/nginx-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ server {
listen 5011;
server_name localhost;

#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;

location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
Expand All @@ -25,8 +22,6 @@ server {
proxy_pass https://ci.kbase.us;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
Expand Down
20 changes: 17 additions & 3 deletions dev/start_server.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
#!/bin/sh

# Start the development servers

set -e

export DEVELOPMENT=1
docker-compose up --build
if docker network create kbase-dev; then
echo "Docker network 'kbase-dev' created"
else
echo "Docker network 'kbase-dev' already exists"
fi

if docker compose --project-name navigator-dev up --build ; then
echo "Docker Compose - exited normally"
else
echo "Docker Compose - exited with error"
fi

if docker compose --project-name navigator-dev rm -f; then
echo "Docker Compose - containers removed normally"
else
echo "Docker Compose - containers removed with error"
fi
11 changes: 11 additions & 0 deletions dev/stop_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

set -e

export DEVELOPMENT=1

if docker compose --project-name navigator-dev stop; then
echo "Docker Compose - containers stopped normally"
else
echo "Docker Compose - containers stopped with error"
fi
36 changes: 18 additions & 18 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# To be used to closely approximate production in development.
# See /dev for support for local development iterative workflow.
version: '3'

networks:
kbase-dev:
name: kbase-dev
services:
web:
navigator:
hostname: navigator
build:
context: .
dockerfile: dev/Dockerfile-python
args:
DEVELOPMENT: 1
dockerfile: Dockerfile
environment:
- PYTHONUNBUFFERED=1
- DEVELOPMENT=1
- KBASE_ENDPOINT=http://localhost:5011/services
# KBASE_ENDPOINT defaults to the ci_proxy for development; used for KBase service endpoint urls
- KBASE_ENDPOINT=${KBASE_ENDPOINT:-http://localhost:5011/services}
# KBASE_ROOT defaults to the CI origin for development; used for KBase user interface urls
- KBASE_ROOT=${KBASE_ROOT:-https://ci.kbase.us}
# URL_PREFIX defaults to an empty string for development; set to "narratives" for deployments, including
# development with the kbase-ui proxy
- URL_PREFIX
- WORKERS=2
networks:
- kbase-dev
ports:
- "127.0.0.1:5000:5000"
volumes:
- ${PWD}:/app

# Proxy requests from localhost:5011 to ci.kbase.us
# (for getting around CORS restrictions)
ci_proxy:
image: nginx:alpine
ports:
- "127.0.0.1:5011:5011"
volumes:
- ./dev/nginx-default.conf:/etc/nginx/conf.d/default.conf
- '127.0.0.1:5000:5000'
2 changes: 2 additions & 0 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ This takes a little extra work than the above.
2. Set the following environment variables:

- `URL_PREFIX` - this is the prefix for any path that the "service" (the server that comes along with this module) generates. I.e., it's the path that to the entrypoint. On narrative-dev, it's `/narratives`, so the URL of the main page is `https://narrative-dev.kbase.us/narratives`

- `KBASE_ROOT` - this is the root URL for the environment. `https://ci.kbase.us`, `https://narrative-dev.kbase.us`, etc. This is used to craft most external link URLs.

- `KBASE_ENDPOINT` - this is the root endpoint for all services. `https://kbase.us/services` for production, `https://ci.kbase.us/services` for CI, etc. This is used to call individual data providers.

3. Everything else should be default.
Expand Down
Loading