Skip to content

Commit

Permalink
Initial commit of the open source Artemis UI
Browse files Browse the repository at this point in the history
  • Loading branch information
davakos committed Jul 28, 2022
1 parent 476c74a commit 606ce69
Show file tree
Hide file tree
Showing 165 changed files with 88,805 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/ui/**/*.po linguist-generated
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@
# In this example, @doctocat owns any file in the `/docs`
# directory in the root of your repository and any of its
# subdirectories.
#/docs/ @doctocat
#/docs/ @doctocat
/ui/ @davakos
27 changes: 26 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,32 @@ coverage.xml
engine/tests/data/auth.json

# Exclude .env files
.env*
.env.local
.env.development.local
.env.test.local
.env.production.local

# Exclude vim .swp files
*.swp

# UI
# dependencies
/ui/node_modules
/ui/.pnp
/ui/**/.pnp.js

# testing
/ui/coverage

# misc
/ui/**/.eslintcache
/ui/**/npm-debug.log*
/ui/**/yarn-debug.log*
/ui/**/yarn-error.log*

# i18n transients
/ui/src/locale/_build/
/ui/src/locale/**/*.*js

# linting
/ui/hadolint
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Artemis is an extensible source code scanning tool developed by the WarnerMedia

## Overview

Artemis is made up of 3 primary components: the [backend](./backend), the web UI, and the scan orchestrator. Each of these has its own components, architecture, and development processes, which are detailed in the README files within their subdirectories.
Artemis is made up of 3 primary components: the [backend](./backend), the [web UI](./ui), and the scan orchestrator. Each of these has its own components, architecture, and development processes, which are detailed in the README files within their subdirectories.

## License

Expand Down
2 changes: 1 addition & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ terraform apply

## License

This repository is released under [the MIT license](https://en.wikipedia.org/wiki/MIT_License). View the [local license file](./LICENSE).
This repository is released under [the MIT license](https://en.wikipedia.org/wiki/MIT_License). View the [local license file](../LICENSE).
8 changes: 8 additions & 0 deletions ui/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/node_modules
/build
.DS_Store
.git
.gitignore
.github
*.log*
/publicCustom/README.md
32 changes: 32 additions & 0 deletions ui/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[Makefile]
trim_trailing_whitespace = false

[*.md]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false

[.ebextensions/*.config]
indent_style = space
indent_size = 2

[**/*.{yaml,yml}]
indent_style = space
indent_size = 2

[*.{babelrc,jq,json,toml}]
indent_style = space
indent_size = 2
17 changes: 17 additions & 0 deletions ui/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
REACT_APP_VERSION=$npm_package_version
REACT_APP_CUSTOM_LOGO=""
REACT_APP_EMAIL_AUTHOR=""
REACT_APP_DEMO_USER_VCSORG="goodVcs/goodOrg"
REACT_APP_DEMO_USER_REPO="artemis-test-data"
REACT_APP_DOC_URL_USAGE=""
REACT_APP_URL_PROVISION=""
REACT_APP_API_NAMESPACE="/mockApi/v1"
// delay to show a notification before automatically dismissing it (6 seconds in milliseconds)
REACT_APP_NOTIFICATION_DELAY=6000
// delay to auto-reload data (30 seconds in milliseconds)
REACT_APP_RELOAD_INTERVAL=30000
// delay to check for maintenance mode (5 minutes in milliseconds)
REACT_APP_MAINT_CHECK_INTERVAL=300000
REACT_APP_TABLE_ROWS_PER_PAGE_DEFAULT=10
REACT_APP_TABLE_ROWS_PER_PAGE_OPTIONS="5,10,20"
REACT_APP_SERVICE_GITHUB_URL="/settings?code=0123456789abcdefabcd"
2 changes: 2 additions & 0 deletions ui/.env.nonprod
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ADD THE CLIENT ID FOR YOUR NONPROD GITHUB APP HERE
REACT_APP_SERVICE_GITHUB_URL="https://github.com/login/oauth/authorize?client_id="
22 changes: 22 additions & 0 deletions ui/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
REACT_APP_VERSION=$npm_package_version
# SET TO "true" IF YOU WANT TO USE A CUSTOM APP LOGO. DEFINE THE LOGO IN src/custom/Logo.tsx
REACT_APP_CUSTOM_LOGO=""
REACT_APP_EMAIL_AUTHOR=""
# IF YOU HAVE A REPO YOU WANT TO ALLOW USERS TO SCAN, ENTER IT HERE BY VCSORG & REPO, e.g. VCSORG="github/myorg", REPO="scan-test-repo"
REACT_APP_DEMO_USER_VCSORG=""
REACT_APP_DEMO_USER_REPO=""
# IF YOU HAVE USER DOCUMENTION, PROVIDE THE URL TO IT HERE
REACT_APP_DOC_URL_USAGE=""
# IF YOU HAVE A METHOD FOR PROVISIONING NEW USER ACCESS, PROVIDE THE URL TO IT HERE
REACT_APP_URL_PROVISION=""
REACT_APP_API_NAMESPACE="/api/v1"
// delay to show a notification before automatically dismissing it (6 seconds in milliseconds)
REACT_APP_NOTIFICATION_DELAY=6000
// delay to auto-reload data (30 seconds in milliseconds)
REACT_APP_RELOAD_INTERVAL=30000
// delay to check for maintenance mode (5 minutes in milliseconds)
REACT_APP_MAINT_CHECK_INTERVAL=300000
REACT_APP_TABLE_ROWS_PER_PAGE_DEFAULT=10
REACT_APP_TABLE_ROWS_PER_PAGE_OPTIONS="5,10,20"
# ADD THE CLIENT ID FOR YOUR PROD GITHUB APP HERE
REACT_APP_SERVICE_GITHUB_URL="https://github.com/login/oauth/authorize?client_id="
16 changes: 16 additions & 0 deletions ui/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
REACT_APP_VERSION=$npm_package_version
REACT_APP_EMAIL_AUTHOR="[email protected]"
REACT_APP_DEMO_USER_VCSORG="goodVcs/goodOrg"
REACT_APP_DEMO_USER_REPO="artemis-test-data"
REACT_APP_DOC_URL_USAGE="/docs"
REACT_APP_URL_PROVISION="/provision"
REACT_APP_API_NAMESPACE="/mockApi/v1"
// delay to show a notification before automatically dismissing it (6 seconds in milliseconds)
REACT_APP_NOTIFICATION_DELAY=6000
// delay to auto-reload data (30 seconds in milliseconds)
REACT_APP_RELOAD_INTERVAL=30000
// delay to check for maintenance mode (5 minutes in milliseconds)
REACT_APP_MAINT_CHECK_INTERVAL=300000
REACT_APP_TABLE_ROWS_PER_PAGE_DEFAULT=10
REACT_APP_TABLE_ROWS_PER_PAGE_OPTIONS="5,10,20"
REACT_APP_SERVICE_GITHUB_URL="/settings?code=0123456789abcdefabcd"
2 changes: 2 additions & 0 deletions ui/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/locale/_build/
src/locale/**/*.*js
19 changes: 19 additions & 0 deletions ui/.linguirc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"catalogs": [
{
"path": "<rootDir>/src/locale/{locale}/messages",
"include": [
"<rootDir>/src"
],
"exclude": [
"**/node_modules/**"
]
}
],
"locales": ["en"],
"format": "po",
"sourceLocale": "en",
"compileNamespace": "cjs",
"orderBy": "messageId",
"runtimeConfigModule": ["@lingui/core", "i18n"]
}
7 changes: 7 additions & 0 deletions ui/.markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"default": true,
"line-length": false,
"no-inline-html": {
"allowed_elements": [ "pre" ]
}
}
1 change: 1 addition & 0 deletions ui/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.15.1
3 changes: 3 additions & 0 deletions ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
coverage
4 changes: 4 additions & 0 deletions ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 2,
"useTabs": true
}
39 changes: 39 additions & 0 deletions ui/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Note: This Dockerfile creates an image intended ONLY for local development and testing
# it may contain unnessary source code and artifacts that are NOT intended for deployment

FROM node:16-bullseye-slim

WORKDIR /app

# Note: don't copy all source code immediately
# just grab the package file and npm install dependencies
# that way, the expensive dependency install can be performed ONCE in a layer
# and it's inexpensive to rebuild the container when
# modifications are made to the source code in subsequent layers
COPY package*.json hadolint.sha512 ./

# hadolint: hadlolint unavailable via apt, so use the binary from GitHub
# it doesn't include a file checksum, so use one we've generated to validate the package
# hadolint ignore=DL3008
RUN apt-get update && \
grep security /etc/apt/sources.list > /etc/apt/security.sources.list && \
apt-get upgrade -y && \
apt-get upgrade -y -o Dir::Etc::Sourcelist=/etc/apt/security.sources.list && \
apt-get install -y --no-install-recommends jq wget ca-certificates make && \
wget --quiet \
https://github.com/hadolint/hadolint/releases/download/v2.6.0/hadolint-Linux-x86_64 \
-O ./hadolint && \
sha512sum -c hadolint.sha512 && \
chmod 0766 ./hadolint && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# hadolint ignore=DL3059
RUN npm install -g npm@^8.12.1 && \
npm install && \
npm install -g serve@^13.0.2

COPY . .
COPY publicCustom ./public/

CMD ["npm", "run", "start"]
Loading

0 comments on commit 606ce69

Please sign in to comment.