Skip to content
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7d1cbd4
adding accordion for derived courses
schittlur Jul 28, 2023
ff1eb46
course id page
schittlur Jul 28, 2023
f7e0dcd
updated workflow
Nov 9, 2023
4df3fd1
Modified workflow/added Sonarcloud config
Nov 14, 2023
b576072
Removed test branch
Nov 14, 2023
de4d53e
Merge pull request #109 from OpenLXP/ecr-actions
RyanKingDeloitte Nov 14, 2023
7033a8e
Derived courses initial UI setup
schittlur Jan 11, 2024
0116762
spacing fixed
schittlur Jan 11, 2024
8bb1628
took padding for accordion to match wireframe
LFRMadrid Jan 12, 2024
e40c6b0
show section only if derived courses data exists
schittlur Jan 12, 2024
ca28ce3
show more button and implementation
schittlur Jan 16, 2024
fd23073
Update [courseId].js
LFRMadrid Jan 17, 2024
c379d5a
Merge pull request #111 from OpenLXP/feature/course-details-derived-c…
schittlur Jan 19, 2024
c0d6d6c
Removed dev branch from github actions (#112)
sammy-sandhu Feb 5, 2024
66fa550
Fixing Lint for Ironbank
Feb 16, 2024
5cc6ca3
Merge pull request #115 from OpenLXP/ironbank-dev
schittlur Feb 16, 2024
117ef8d
Update cd-workflows.yml
sammy-sandhu Feb 29, 2024
ef53580
XDS-UI Env Var Github Actions (#116)
sammy-sandhu Mar 1, 2024
37441ef
notifications
schittlur Mar 22, 2024
6e64b8c
rerender on mark all as read click
schittlur Mar 22, 2024
d766518
fix spelling
JDTobin Apr 2, 2024
c26d2d4
Update cd-workflows.yml
sammy-sandhu Apr 2, 2024
2b914f7
Update Dockerfile to trigger workflow
sammy-sandhu Apr 2, 2024
824a08e
Update cd-workflows.yml
sammy-sandhu Apr 2, 2024
c88c723
reduce width on derived courses
JDTobin Apr 4, 2024
a39d3ec
change timestamp format
JDTobin Apr 5, 2024
a70fad6
adding platform to xAPI
KarenAJ Apr 5, 2024
86fc2e3
Correction platform in xAPI
KarenAJ Apr 5, 2024
1778fc0
Edited platform
KarenAJ Apr 8, 2024
3d9a69b
icon css to position horizontal
schittlur Apr 11, 2024
a6ee952
updating the hidden derived courses to a clickable link
schittlur Apr 17, 2024
72495b9
endpoints updated
schittlur Apr 19, 2024
d63ec0f
Mark all read button functionality update
schittlur Apr 23, 2024
feff2c4
adding a check for no filters
schittlur Apr 25, 2024
6b7cf1d
Merge pull request #118 from OpenLXP/origin/notifications
schittlur May 8, 2024
da27dcb
Update cd-workflows.yml
sammy-sandhu May 9, 2024
374bf9a
Update README.md
sammy-sandhu Sep 13, 2024
fb0548e
logo dynamic with config image (#120)
schittlur Sep 27, 2024
886ce22
updates to course information mapping
schittlur Oct 22, 2024
d6f5a6f
node version update
schittlur Oct 22, 2024
28aaebb
Merge pull request #121 from OpenLXP/node_version_update
schittlur Oct 22, 2024
09c0ec1
Updated ECR tag
Oct 23, 2024
fbc9f43
Merge branch 'dev' of https://github.com/OpenLXP/openlxp-xds-ui into dev
Oct 23, 2024
c513585
adding check
schittlur Oct 24, 2024
361b208
Merge pull request #122 from OpenLXP/node_version_update
schittlur Oct 24, 2024
3eee7ec
Use xAPI Forwarding (#131)
milt Mar 11, 2025
96a22b3
Latest code sync with P1 master (#133)
sammy-sandhu Aug 19, 2025
1c72be8
Fixing merge conflicts
Aug 19, 2025
1eb9e03
Fixed Lint
Aug 19, 2025
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
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
],
"rules": {
"react-hooks/exhaustive-deps": "off",
"react-hooks/rules-of-hooks": "off",
"react/no-unescaped-entities": 0,
"sort-imports-es6-autofix/sort-imports-es6": [
2,
{
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/cd-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Docker CD

on:
push:
branches:
- dev
pull_request:
branches:
- main
- dev
types: [opened, synchronize, reopened]

jobs:
code-test:
# Kicks off the workflow and prepares Github to run coverage test using a ubuntu-latest container.
name: Code Test
runs-on: ubuntu-latest
env:
OS: ubuntu-latest
PYTHON: '3.9'

steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9

# Install dependencies required for tests
- name: Install Dependencies
run: |
yarn install

# - name: Generate Coverage Report
# env:
# GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# run: |
# echo "Cloning private repository"
# git clone https://openlxp-host:${{ secrets.ACCESS_TOKEN }}@github.com/OpenLXP/openlxp-private.git
# echo "Private repository cloned successfully"
# echo "Copying .env file from openlxp-private to current working directory"
# cp ./openlxp-private/openlxp-xds-ui-env/.env .
# echo "Copied .env file successfully"
# echo "Create openlxp docker network"
# docker network create openlxp
# echo "Docker network successfully created"
# yarn
# yarn test --coverage

build:
# requires dependency from step above
needs: code-test
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Docker login
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "Authenticate to Docker"
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Docker build
run: |
echo "Start docker build"
docker build . -t openlxp/openlxp-xds-ui
73 changes: 0 additions & 73 deletions .github/workflows/docker-image.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ yarn-debug.log*
yarn-error.log*

# local env files
.env
.env.local
.env.development.local
.env.test.local
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.20.4
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
# Install dependencies only when needed
FROM node:14.18.1-alpine AS deps
FROM node:18.20-alpine AS deps

# RUN apk add libc6-compat
WORKDIR /app
COPY package.json ./
RUN yarn install --production

# Rebuild the source code only when needed
FROM node:14.18.1-alpine AS builder
FROM node:18.20-alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules


RUN yarn build


# Production image, copy all the files and run next
FROM node:14.18.1-alpine AS runner
FROM node:18.20-alpine AS runner
WORKDIR /app

ENV NODE_ENV production
Expand All @@ -39,3 +37,4 @@ EXPOSE 3000
ENV NEXT_TELEMETRY_DISABLED 1

CMD ["yarn", "start"]

2 changes: 1 addition & 1 deletion jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import '@/__mocks__/mockSetUp';
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';

74 changes: 52 additions & 22 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,63 @@
const { createSecureHeaders } = require("next-secure-headers");

const nextConfig = {
reactStrictMode: true,
swcMinify: true,
// basePath: '/ecc-openlxp-xds-ui',

// Adding policies:
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'X-Frame-Options',
value: 'DENY',
},
{
key: 'X-Content-Type-Options',
value: 'nosniff',
},
{
key: 'Referrer-Policy',
value: 'origin-when-cross-origin',
},
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload',
},
{
key: 'Content-Security-Policy',
value: 'frame-ancestors "self" https://ecc.staging.dso.mil'
},
],
headers: createSecureHeaders({
contentSecurityPolicy: {
directives: {
defaultSrc: [
"'self'",
"https://ecc.staging.dso.mil",
"https://ecc.staging.dso.mil/ecc-openlxp-xds/",
"https://ecc.apps.dso.mil",
"https://ecc.apps.dso.mil/ecc-openlxp-xds-ui/"
],
styleSrc: [
"'self'",
"https://ecc.apps.dso.mil",
"https://ecc.apps.dso.mil/ecc-openlxp-xds-ui/",
"https://ecc.staging.dso.mil",
"https://fonts.googleapis.com"
],
imgSrc: ["'self'",
"data:",
"data:*",
"https://www.jcs.mil",
"https://www.aetc.af.mil",
"https://prod-discovery.edx-cdn.org",
"https://media.defense.gov",
"https://www.dote.osd.mil",
"https://d15cw65ipctsrr.cloudfront.net",
"https://d3njjcbhbojbot.cloudfront.net",
"https://coursera-course-photos.s3.amazonaws.com",
"https://ecc.apps.dso.mil"
],
fontSrc: [
"'self'",
"https://fonts.gstatic.com"
],
frameAncestors: [
"'self'",
"https://ecc.staging.dso.mil",
"https://ecc.apps.dso.mil",
"https://ecc.apps.dso.mil/ecc-openlxp-xms-ui/"
]
},
frameGuard: "deny",
noopen: "noopen",
nosniff: "nosniff",
xssProtection: "sanitize",
referrerPolicy: "origin-when-cross-origin",
}
})
},
];
},
Expand Down
41 changes: 28 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,57 @@
"name": "openlxp-xds",
"version": "0.1.0",
"private": true,
"homepage": ".",
"dependencies": {
"@adobe/css-tools": "4.3.2",
"@babel/runtime": "^7.26.10",
"@headlessui/react": "^1.4.2",
"@heroicons/react": "^1.0.5",
"@tailwindcss/line-clamp": "^0.3.0",
"@testing-library/dom": "^10.4.0",
"@xapi/xapi": "^2.0.1",
"autoprefixer": "^10.4.0",
"axios": "^0.23.0",
"next": "12.1.0",
"postcss": "^8.4.5",
"axios": "^1.8.2",
"brace-expansion": "^2.0.2",
"follow-redirects": "1.15.6",
"form-data": "4.0.4",
"micromatch": "4.0.8",
"next": "^14.2.25",
"next-secure-headers": "^2.2.0",
"postcss": "^8.4.31",
"query-string": "^7.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-query": "^3.26.0",
"react-test-renderer": "^17.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-query": "^3.39.3",
"react-router-dom": "^5.2.0",
"react-test-renderer": "^18",
"sharp": "0.32.6",
"tailwindcss": "^3.0.7",
"use-resize-observer": "^9.1.0"
"tar-fs": "^2.1.3"
},
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "jest --watch",
"coverage": "jest --watchAll --coverage --verbose --noStackTrace --silent --maxWorkers=50%"
"test:unit": "jest --coverage --watchAll=false",
"coverage": "jest --watchAll --coverage --verbose --noStackTrace --silent --maxWorkers=50%",
"test:e2e-ci": "CYPRESS_BASE_URL=${ZAP_URL} npx cypress run --browser chrome --config-file cypress/config/pipeline.config.js"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.1.2",
"@babel/core": "^7.23.2",
"@babel/preset-react": "^7.22.15",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^14.0.0",
"@testing-library/react-hooks": "^7.0.2",
"braces": "^3.0.3",
"eslint": "^8.6.0",
"eslint-config-next": "12.0.7",
"eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.2.5",
"jest-mock-axios": "^4.4.1",
"next-router-mock": "^0.5.3",
"next-router-mock": "^0.9.11",
"prettier": "2.5.1"
}
}
12 changes: 12 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sonar.projectKey=OpenLXP_openlxp-xds-ui
sonar.organization=openlxp

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=openlxp-xds
#sonar.projectVersion=1.0

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
#sonar.sources=.

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
2 changes: 1 addition & 1 deletion src/__mocks__/authContextMock.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import { useContext, createContext } from "react";
import { createContext, useContext } from "react";
export const AuthContext = createContext()
export const AuthContextWrapper = ({children}) => {
const login = jest.fn()
Expand Down
Loading