Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(coscrad-frontend): refactor category tree presenters with UI context #462

Open
wants to merge 102 commits into
base: integration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
05c565d
feat(coscrad-frontend): move audio panel to a drawer (#342)
bsellars Apr 25, 2023
d413d16
feat(coscrad-frontend): move audio panel to a drawer (#358)
bsellars Apr 26, 2023
9abaa00
style(coscrad-frontend): add a drawer to the navbar (#359)
jbambrick May 1, 2023
8d84ad1
style(coscrad-frontend): fix display on nav menu icons (#362)
jbambrick May 2, 2023
a8baae6
feat(cli): introduce first CLI command: domain-dump (#360)
aaron-plahn May 2, 2023
6d5dd90
build(cicd): move builds to DigitalOcean cloud (#363)
aaron-plahn May 3, 2023
8cb7f21
style(coscrad-frontend): widescreen element negative margin fix (#364)
yaanahuu2 May 4, 2023
f8207f5
feat(cli): introduce data-restore cli command (#365)
aaron-plahn May 5, 2023
796af52
style(coscrad-frontend): remove coscrad main content container (#367)
yaanahuu2 May 8, 2023
03e86fa
feat(coscrad-frontend): support theme overrides on content config (#361)
bsellars May 9, 2023
0a46e4a
feat(api): support building a name for every aggregate root (#366)
aaron-plahn May 9, 2023
8f70464
feat(api): add support for straight-to-database endpoint for legacy d…
aaron-plahn May 9, 2023
59c4c61
style(coscrad-frontend): remove conflicting styles (#369)
jbambrick May 10, 2023
16c5e47
test(api): discover command payload schemas dynamically (#371)
aaron-plahn May 11, 2023
57ed67d
test(coscrad-frontend): test components that leverage the configurabl…
bsellars May 12, 2023
33cefac
feat(coscrad-frontend): support custom resource index label (#375)
jbambrick May 12, 2023
736207a
fix(coscrad-frontend): use custom label for resource index in nav men…
aaron-plahn May 12, 2023
4abf884
style(coscrad-frontend): layout paddingTop fix (#373)
jbambrick May 15, 2023
1cb38b4
feat(api): introduce CREATE_PLAYLIST (#378)
bsellars May 17, 2023
dc7cbd5
infra(api): introduce database migration infrastructure (#370)
aaron-plahn May 17, 2023
7bc2561
feature(coscrad-frontend): add tooltip to resource icon (#382)
yaanahuu2 May 18, 2023
4fd5fce
feat(coscrad-frontend): present multilingual text in term views (#377)
jbambrick May 15, 2023
b12410b
style(coscrad-frontend): leverage design standard for vocabulary deta…
jbambrick May 18, 2023
4be266c
infra(api): introduce data dumps and migration records (#381)
aaron-plahn May 18, 2023
8d435eb
infra(api): ensure that **data-dump** dumps full db snapshot (#383)
aaron-plahn May 18, 2023
36bbdb6
infra(api): introduce **revert-latest-migration** (#385)
aaron-plahn May 18, 2023
da2aabd
infra(api): validate invariants post-migration (#386)
aaron-plahn May 19, 2023
ffe22fe
fix(api): fix logging issues with migration cli commands (#387)
aaron-plahn May 23, 2023
439bd4d
docs(cli): add dedicated README for the cli (#388)
aaron-plahn May 23, 2023
2291d0b
build(cicd) introduce separate front-end deployment for Haida project…
aaron-plahn May 29, 2023
5c5e31f
test(api): update test data with valid media URLs (#391)
aaron-plahn May 29, 2023
58398c0
feat(api): introduce ADD_AUDIO_ITEM_TO_PLAYLIST (#392)
bsellars May 31, 2023
902df1b
feat(coscrad): introduce dynamic plural resource labels (#395)
jbambrick Jun 6, 2023
ea5f4fe
test(api): update term test data with valid urls (#396)
aaron-plahn Jun 6, 2023
d59bab1
feat(data-types): support dynamic union types and their validation (#…
aaron-plahn Jun 8, 2023
65b4e21
feat(api): introduce TRANSLATE_PLAYLIST_NAME (#397)
bsellars Jun 12, 2023
3098a2f
feat(api): introduce CREATE_NOTE_ABOUT_RESOURCE (#398)
aaron-plahn Jun 13, 2023
fa7d96d
feat(data-types): introduce dynamic union factory utility (#401)
aaron-plahn Jun 13, 2023
c2787bc
feat(api): introduce CONNECT_RESOURCES_WITH_NOTE (#402)
aaron-plahn Jun 15, 2023
5bc8dcf
WIP: audio clip player with cypress test (#399)
jbambrick Jun 19, 2023
b811484
feat(coscrad): support multilingual text for notes (#404)
aaron-plahn Jun 19, 2023
c81047c
feat(coscrad-frontend): support note creation on the front-end (#407)
aaron-plahn Jun 25, 2023
6ea323b
feat(coscrad-frontend): add menu and login button tooltips (#409)
yaanahuu2 Jun 26, 2023
130463d
test(api): add kktest user to test data (#408)
yaanahuu2 Jun 27, 2023
69deac2
feat(coscrad-frontend): support connection creation on the front-end …
aaron-plahn Jun 28, 2023
bc6da41
feat(coscrad): support tagging on the front-end (#411)
aaron-plahn Jun 28, 2023
d85c654
feat(api): remove multilingual text from command payloads (#412)
aaron-plahn Jun 28, 2023
fb0daed
feat(coscrad-cli): introduce **clear-database** CLI command (#415)
aaron-plahn Jun 30, 2023
8e4e35a
feat(coscrad-frontend): add social media icons to footer (#406)
bsellars Jun 30, 2023
fa93700
fix(api): prevent duplicate playlist names (#418)
bsellars Jun 30, 2023
7e21240
feat(coscrad-frontend): support configurable site title and favicon (…
jbambrick Jul 3, 2023
37a7b2b
feat(coscrad-frontend): add QR generation for current page (#400)
aaron-plahn Jul 3, 2023
df63633
fix(tsilhqotin-language-hub): update resource queries to use new API …
jbambrick Jul 3, 2023
c984fcf
feat(coscrad-frontend): display login status when logged in (#413)
aaron-plahn Jul 3, 2023
9fc94a5
feat(coscrad-cli): introduce **execute-command-stream** (#421)
aaron-plahn Jul 5, 2023
706745d
infra(coscrad-frontend-e2e): support seeding data between Cypress tes…
aaron-plahn Jul 5, 2023
281957e
test(coscrad-frontend-e2e): add e2e test for tag creation flow (#423)
aaron-plahn Jul 5, 2023
c0a983f
refactor(coscrad-frontend): isolate notes and connections panels (#424)
aaron-plahn Jul 5, 2023
219cfc2
fix(coscrad-frontend): add matchers to index table property (#405)
jbambrick Jul 7, 2023
3c81191
feat(api): introduce ADD_LYRICS_FOR_SONG (#420)
bsellars Jul 10, 2023
128c88e
feat(api): introduce TRANSLATE_SONG_LYRICS (#427)
aaron-plahn Jul 10, 2023
23649c1
feat(api): support multilingual text target for text field context (…
aaron-plahn Jul 11, 2023
820ca16
fix(coscrad-frontend): footer h6 nesting in grid fix (#431)
yaanahuu2 Jul 11, 2023
7de8a16
feat(api): introduce IMPORT_LINE_ITEMS_TO_TRANSCRIPT (#428)
bsellars Jul 12, 2023
b8e12ee
test(coscrad-frontend-e2e): fix cypress tests
aaron-plahn Jul 14, 2023
2b4272b
feat(api): introduce IMPORT_AUDIO_ITEMS_TO_PLAYLIST (#433)
bsellars Jul 17, 2023
318aac0
feat(coscrad-cli): introduce **seed-test-data-with-command** (#435)
aaron-plahn Jul 17, 2023
93fc18a
refactor(coscrad-cli): break out separate layer for managing test com…
aaron-plahn Jul 17, 2023
889a005
feat(api): introduce CREATE_TERM (#437)
aaron-plahn Jul 18, 2023
a2b273d
feat(api): introduce TRANSLATE_TERM (#439)
aaron-plahn Jul 18, 2023
93c5e50
feat(coscrad-frontend): add ui panels for notes and connected resourc…
yaanahuu2 Jul 18, 2023
8022b4a
refactor(api): remove aggregate type from base create command handler…
aaron-plahn Jul 19, 2023
27fe962
feat(api): introduce CREATE_POINT (#441)
aaron-plahn Jul 20, 2023
5551355
feat(coscrad-cli): support JSON data-file input to **execute-command-…
aaron-plahn Jul 20, 2023
a53a2c0
feat(coscrad-cli): introduce **seed-test-uuids** (#444)
aaron-plahn Jul 20, 2023
b1f4ed8
feat(coscrad-frontend): support playing an icecast stream (#438)
bsellars Jul 21, 2023
cc961d9
fix(api): fix register handler for CREATE_POINT (#445)
aaron-plahn Jul 22, 2023
e92b660
migration(02): add migration for English language code (#446)
aaron-plahn Jul 24, 2023
9838526
migration(03): add migration for bilingual terms and vocabulary lists…
aaron-plahn Jul 25, 2023
fa45190
infra(coscrad-frontend-e2e): add shell script to open Cypress for e2e…
aaron-plahn Jul 25, 2023
f52d38b
fix(coscrad-frontend): fix null value in format citation (#449)
yaanahuu2 Jul 25, 2023
1932468
style(coscrad-frontned): update song index-to-detail flow (#426)
jbambrick Jul 26, 2023
77eeed4
feat(media-player): add video player (#452)
jbambrick Jul 27, 2023
67b56fb
fix(coscrad-frontend): make minor UX modifications and fixes (#450)
yaanahuu2 Jul 28, 2023
ff787de
test(coscrad-frontend-e2e): seed fresh state for each e2e test (#451)
aaron-plahn Jul 28, 2023
41bbc5a
migrations(04): migrate bilingual songs to full multilingual text (#454)
aaron-plahn Jul 31, 2023
8372cba
feat(coscrad-frontend): create audio player component (#453)
jbambrick Jul 31, 2023
873ff6f
test(coscrad-frontend-e2e): add shell script to run cypress (#455)
aaron-plahn Aug 1, 2023
a1bf7c8
feat(api): introduce TRANSLATE_SONG_TITLE (#456)
bsellars Aug 1, 2023
47a369f
test(coscrad-frontend-e2e): add e2e test for TRANSLATE_SONG_TITLE (#457)
aaron-plahn Aug 2, 2023
302321b
feat(api): introduce CREATE_VOCABULARY_LIST (#460)
bsellars Aug 14, 2023
fe0ca28
feat(api): introduce TRANSLATE_TRANSCRIPT_LINE_ITEM (#459)
aaron-plahn Aug 15, 2023
d3f786c
test(coscrad-frontend-e2e): test TRANSLATE_LINE_ITEM in video command…
aaron-plahn Aug 17, 2023
444f1f6
test(coscrad-frontend-e2e): add e2e test for CREATE_VOCABULARY_LIST (…
aaron-plahn Aug 17, 2023
326a9b1
WIP tree now works
yaanahuu Aug 4, 2023
b36a66e
WIP start cypress test for tree
yaanahuu Aug 8, 2023
faad962
WIP fixed cypress tree test
yaanahuu Aug 9, 2023
d6c5b82
WIP refine cypress test for tree
yaanahuu Aug 14, 2023
f073f94
WIP fix lint warnings
yaanahuu Aug 14, 2023
7ad7e09
WIP address PR feedback
yaanahuu Aug 16, 2023
ed9e2ba
WIP fix key warning
yaanahuu Aug 16, 2023
36e4fb8
WIP remove ui context from category tree
yaanahuu Aug 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .env

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Thumbs.db

# environment files
*.env
cypress.env.json

# data for data processing scripts
/scripts/data-processing/data
Expand All @@ -50,3 +51,6 @@ auth_config.json
**content.config.ts
# TODO Be careful not to git-ignore third-party configs
**config.json

# COSCRAD CLI command e2e test dummy files
__cli-command-test-files__
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,18 @@
"console": "internalConsole",
"internalConsoleOptions": "neverOpen"
},
{
"type": "chrome",
"request": "attach",
"name": "Attach to Cypress Chrome",
"port": 9200,
"urlFilter": "http://localhost*",
"webRoot": "${workspaceFolder}",
"sourceMaps": true,
"skipFiles": [
"cypress_runner.js",
],
},

]
}
246 changes: 203 additions & 43 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* groovylint-disable NestedBlockDepth */
def nodeInstallationName = 'NodeJS 18.12.0'

/* groovylint-disable DuplicateStringLiteral */
/* groovylint-disable-next-line CompileStatic */
pipeline {
Expand All @@ -9,11 +12,9 @@ pipeline {
stages {
stage('ci') {
agent {
docker {
image 'node:18-alpine'
args '-u root'
}
label 'jenkins-build-agent'
}
tools { nodejs nodeInstallationName }
environment {
NODE_ENV = 'test'
NODE_PORT = 3131
Expand All @@ -26,7 +27,6 @@ pipeline {
ARANGO_DB_NAME = 'staging'
AUTH0_ISSUER_URL = 'https://foo.auth0.com/'
AUTH0_AUDIENCE = 'https://bar.mydomain.ca'
BASE_DIGITAL_ASSET_URL = 'https://www.myaudio.com:5555/media?id='
GLOBAL_PREFIX = 'api'
SHOULD_ENABLE_LEGACY_GAMES_ENDPOINT = 'false'
}
Expand All @@ -38,6 +38,10 @@ pipeline {
targetLocation: 'apps/coscrad-frontend/src/auth_config.json')]) {
echo 'PR opened or updated...'
echo "NODE ENV: ${NODE_ENV}"
echo 'node version:'
sh 'node -v'
echo 'npm version'
sh 'npm -v'
echo 'Installing dependencies'
sh 'npm ci --legacy-peer-deps'

Expand Down Expand Up @@ -76,13 +80,11 @@ pipeline {
}
}
}
stage('deploy to staging') {
stage('build and deploy to staging') {
agent {
docker {
image 'node:18-alpine'
args '-u root'
}
label 'jenkins-build-agent'
}
tools { nodejs nodeInstallationName }
environment {
NODE_ENV = 'staging'
NODE_PORT = 3131
Expand All @@ -95,48 +97,206 @@ pipeline {
ARANGO_DB_NAME = 'staging'
AUTH0_ISSUER_URL = 'https://foo.auth0.com/'
AUTH0_AUDIENCE = 'https://bar.mydomain.ca'
BASE_DIGITAL_ASSET_URL = 'https://www.myaudio.com:5555/media?id='
GLOBAL_PREFIX = 'api'
SHOULD_ENABLE_LEGACY_GAMES_ENDPOINT = 'false'
}
when {
branch 'integration'
}
steps {
configFileProvider([configFile(fileId:'42feff14-78da-45fc-a8ee-5f98213a313f', \
targetLocation: 'apps/coscrad-frontend/src/auth_config.json')]) {
echo 'Merged to integration'
echo "NODE ENV: ${NODE_ENV}"
echo 'Installing dependencies'
sh 'npm ci --legacy-peer-deps'
stages {
stage('install dependencies') {
steps {
echo 'Running staging build'
echo "NODE ENV: ${NODE_ENV}"
echo 'Installing dependencies'
sh 'npm ci --legacy-peer-deps'
}
}
stage('build front-end for COSCRAD sandbox') {
steps {
runFrontendBuild('COSCRAD')
}
post {
success {
deployFrontend('COSCRAD')
}
}
}
stage('build front-end for Haida sandbox') {
steps {
runFrontendBuild('Haida')
}
post {
success {
deployFrontend('Haida')
}
}
}
stage('build back-end') {
steps {
sh 'npx nx run build api --prod'
}
post {
success {
deployBackend()
}
}
}
stage('build cli') {
steps {
sh 'npx nx run api:build:cli'
}
post {
success {
deployCli()
}
}
}
}
}
}
}

echo 'Building COSCRAD'
echo 'with node version'
sh 'node --version'
/**
* TODO We might be able to have a single function that switches on `target` and
* sets several global variables to be used in various steps.
*/
String getContentConfigFilename(String target) {
if (target == 'COSCRAD') { return 'content.config.SAMPLE.ts' }

/**
* Note that the sample content config is actually valid for
* our staging build.
**/
echo 'copying sample content config for test build'
/* groovylint-disable-next-line LineLength */
sh 'cp apps/coscrad-frontend/src/configurable-front-matter/data/content.config.SAMPLE.ts apps/coscrad-frontend/src/configurable-front-matter/data/content.config.ts'
if (target == 'Haida') { return 'content.config.STAGING.ts' }

sh 'npm run build:coscrad:prod'
}
}
post {
success {
archiveArtifacts artifacts: 'dist/**, node_modules/**', followSymlinks: false
// Deploy front-end build to staging
sshPublisher(
publishers: [sshPublisherDesc(configName: '[email protected]', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'rm -rf /var/www/html && mv build/dist/apps/coscrad-frontend /var/www/html && rm -rf build', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: 'build', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'dist/**')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])

// Deploy back-end build to staging
sshPublisher(
publishers: [sshPublisherDesc(configName: '[email protected]', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'rm -rf archive ; mv build archive; touch archive/dist/apps/api/staging.env; PATH=$PATH://home/coscradmin/.nvm/versions/node/v18.16.0/bin pm2 restart main; echo API restarted', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: 'build', remoteDirectorySDF: false, removePrefix: '', sourceFiles: 'dist/**, node_modules/**')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
error "unsupported deployment target: ${target}"

// This is to satisfy the linter. Maybe we should be explicitly throwing in the line above?
return ''
}

/**
* # Available Targets
- COSCRAD
- Haida
**/
void copyContentConfig(String target) {
String contentConfigDirectory = 'apps/coscrad-frontend/src/configurable-front-matter/data/'

/**
* Note that the sample content config is actually valid for
* our staging build.
**/
echo "attempting to copy sample content config for test build for target ${target}"

/* groovylint-disable-next-line LineLength */
sh "cp ${contentConfigDirectory}${getContentConfigFilename(target)} ${contentConfigDirectory}content.config.ts"

return
}

void runFrontendBuild(String target) {
configFileProvider([configFile(fileId:'staging.auth.config', \
targetLocation: 'apps/coscrad-frontend/src/auth_config.json')]) {
echo "Building COSCRAD front-end for target project: ${target}"
echo 'with node version'
sh 'node --version'

copyContentConfig(target)
sh 'npx nx build coscrad-frontend --prod --skip-nx-cache'

echo 'build contents'
sh 'ls dist/apps'
}
}
}
}

String getDeploymentDirectoryForFrontendBuild(String target) {
if (target == 'COSCRAD') {
return 'html'
}

if (target == 'Haida') {
return 'haida'
}

error "No deployment directory found for unknown build target: ${target}"

return ''
}

void publishArtifacts(String sshConfigName, \
String postTransferCommand, \
String remoteDirectory, \
String sourceFilePattern) {
sshPublisher(
publishers: [
sshPublisherDesc(
configName: sshConfigName,
transfers: [
sshTransfer(
cleanRemote: false,
excludes: '',
execCommand: postTransferCommand,
execTimeout: 120000,
flatten: false, makeEmptyDirs:
false, noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: remoteDirectory,
remoteDirectorySDF: false,
removePrefix: '',
sourceFiles: sourceFilePattern
)],
usePromotionTimestamp: false,
useWorkspaceInPromotion: false,
verbose: false
)])
}

void archiveArtifacts(String sourceFilePattern) {
archiveArtifacts artifacts: sourceFilePattern, followSymlinks: false
}

void deployFrontend(String target) {
String basePath = '/var/www/'

String deploymentDirectory = getDeploymentDirectoryForFrontendBuild(target)

String fullDeploymentPath = "${basePath}${deploymentDirectory}"

String command = "rm -rf ${fullDeploymentPath} \
&& mv build/dist/apps/coscrad-frontend \
${fullDeploymentPath} && rm -rf build "

String sourceFilePattern = 'dist/apps/coscrad-frontend/**'

archiveArtifacts(sourceFilePattern)

publishArtifacts('[email protected]', command, 'build', sourceFilePattern)
}

void deployBackend() {
String backendArtifactsPattern = 'dist/apps/api/**, node_modules/**'

String postDeployCommand = 'rm -rf archive ; \
mv build archive; \
touch archive/dist/apps/api/staging.env; \
PATH=$PATH://home/coscradmin/.nvm/versions/node/v18.16.0/bin pm2 restart main; \
echo API restarted'

archiveArtifacts(backendArtifactsPattern)

publishArtifacts('[email protected]',
postDeployCommand, \
'build', \
backendArtifactsPattern)
}

void deployCli() {
String backendArtifactsPattern = 'dist/apps/coscrad-cli/**'

String postDeployCommand = 'echo CLI build copied'

archiveArtifacts(backendArtifactsPattern)

publishArtifacts('[email protected]',
postDeployCommand, \
'cli', \
backendArtifactsPattern)
}
18 changes: 1 addition & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,7 @@ that leverage the COSCRAD API. The Many ideas explored in the community projects
will eventually find their way into Coscrad's core.

**COSCRAD CLI**
We also have built our own command-line interface, `COSCRAD CLI`. This is used
for administrative tasks like dumping data snapshots (in persistence layer, domain layer
and view layer formats), seeding test data and restoring data dumps, dumping
a JSON version of schemas for our domain models, view models, command and event payloads,
and so on.

Currently, `COSCRAD CLI` is part of the `api`, and it is available via a custom
build of the `api`. Run `npx nx build:api:cli` to build the `COSCRAD CLI`. The
cli will be built to `dist/apps/cosccrad-cli`. Run

```
node main.js <command> <options>
```

from within this directory to execute a `COSCRAD CLI` command.

<!-- TODO Add documentation for all commands -->
The `coscrad-cli` is a command line tool for data administration tasks. Its use is documented [here](./apps/api/cli.README.md)

In the future, once our domain has been moved to a separate lib, we will move
the `COSCRAD CLI` to a standalone app in the mono-repo.
Expand Down
Loading