Skip to content

Commit

Permalink
Merge branch 'Simon-Initiative:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
dtiwarATS committed Jul 30, 2024
2 parents 15e26ab + 75c5c99 commit d1d57c5
Show file tree
Hide file tree
Showing 115 changed files with 2,342 additions and 1,811 deletions.
6 changes: 3 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

ARG ELIXIR_VERSION=1.15.5
ARG OTP_VERSION=26.1
ARG DEBIAN_VERSION=bullseye-20230612-slim
ARG ELIXIR_VERSION=1.17.2
ARG OTP_VERSION=27.0.1
ARG DEBIAN_VERSION=bullseye-20240722-slim

ARG IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"

Expand Down
6 changes: 3 additions & 3 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ services:
context: ../
dockerfile: .devcontainer/Dockerfile
args:
- ELIXIR_VERSION=1.15.5
- OTP_VERSION=26.1
- DEBIAN_VERSION=bullseye-20230612-slim
- ELIXIR_VERSION=1.17.2
- OTP_VERSION=27.0.1
- DEBIAN_VERSION=bullseye-20240722-slim
depends_on:
- postgres
env_file: ../oli.env
Expand Down
3 changes: 1 addition & 2 deletions .formatter.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
inputs: [
"*.{heex,ex,exs}",
"priv/*/seeds.exs",
"{config,lib,test}/**/*.{heex,ex,exs}",
"storybook/**/*.exs"
"{config,lib,test}/**/*.{heex,ex,exs}"
],
subdirectories: ["priv/*/migrations"]
]
6 changes: 3 additions & 3 deletions .github/actions/amazon-linux-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ RUN ./configure
RUN make && make install

WORKDIR /tmp
RUN wget "https://github.com/elixir-lang/elixir/archive/v1.15.5.tar.gz"
RUN tar xfz v1.15.5.tar.gz
WORKDIR /tmp/elixir-1.15.5/
RUN wget "https://github.com/elixir-lang/elixir/archive/v1.17.2.tar.gz"
RUN tar xfz v1.17.2.tar.gz
WORKDIR /tmp/elixir-1.17.2/
ENV PATH="${PATH}:/usr/local/bin"
RUN make && make install

Expand Down
23 changes: 2 additions & 21 deletions .github/workflows/auto-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,16 @@ on:
types: [completed]

jobs:
check-auto-deploy:
name: Check AUTO_DEPLOY_ENABLED config
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
environment:
name: ${{ vars.AUTO_DEPLOY_TARGET }}
url: https://${{ vars.AUTO_DEPLOY_TARGET }}
outputs:
enabled: ${{ steps.check_auto_deploy_enabled.outputs.enabled }}
auto_deploy_ref: ${{ steps.get_auto_deploy_ref.outputs.auto_deploy_ref }}
steps:
- name: Check whether AUTO_DEPLOY_ENABLED is set to TRUE
id: check_auto_deploy_enabled
run: echo "enabled=$(if [ "${{ vars.AUTO_DEPLOY_ENABLED }}" == "TRUE" ] ; then echo true ; else echo false ; fi)" >> $GITHUB_OUTPUT
- name: Get AUTO_DEPLOY_REF config
id: get_auto_deploy_ref
run: echo "auto_deploy_ref=$(if [ -n "${{ vars.AUTO_DEPLOY_REF }}" ] ; then echo ${{ vars.AUTO_DEPLOY_REF }} ; else echo refs/heads/master ; fi)" >> $GITHUB_OUTPUT

auto-deploy:
name: Auto Deploy
if: github.event.workflow_run.conclusion == 'success' && github.ref == needs.check-auto-deploy.outputs.auto_deploy_ref && needs.check-auto-deploy.outputs.enabled == 'true'
if: vars.AUTO_DEPLOY_ENABLED == 'TRUE' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == vars.AUTO_DEPLOY_REF
runs-on: ubuntu-latest
environment:
name: ${{ vars.AUTO_DEPLOY_TARGET }}
url: https://${{ vars.AUTO_DEPLOY_TARGET }}
needs: [check-auto-deploy]

steps:
- run: echo "Auto deploy enabled for ref ${{ vars.AUTO_DEPLOY_REF }}. Deploying ${{ github.sha }} ${{ github.ref }} ${{ github.ref_name }} to ${{ vars.AUTO_DEPLOY_TARGET }}"
- run: echo "Auto deploy enabled for ref ${{ vars.AUTO_DEPLOY_REF }}. Deploying ${{ github.event.workflow_run.head_branch }} commit ${{ github.event.workflow_run.head_sha }} to ${{ vars.AUTO_DEPLOY_TARGET }}"

# checkout the commit from the Package workflow that triggered the Auto Deploy workflow
- name: 🛎️ Checkout
Expand Down
26 changes: 6 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
- name: 🧪 Setup elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: 1.15.5 # Define the elixir version [required]
otp-version: 26.1 # Define the OTP version [required]
elixir-version: 1.17.2 # Define the elixir version [required]
otp-version: 27.0.1 # Define the OTP version [required]

- name: ⬇️ Install elixir dependencies
run: mix deps.get
Expand All @@ -77,20 +77,6 @@ jobs:
- name: 📦 Install node_module dependencies
run: yarn --cwd assets --frozen-lockfile

# - name: ▶️ Run integration tests
# run: |
# /usr/local/share/chrome_driver/chromedriver &
# timeout 90 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9515)" != "404" ]]; do sleep 1; done' || false
# set -a;source oli.env && MIX_ENV=hound mix test.hound

# - name: 📈 Save test results
# uses: actions/upload-artifact@v3
# if: failure()
# with:
# name: integration-test-results
# path: test-results
# if-no-files-found: ignore

check-simon-token:
name: Check simon-bot access token
runs-on: ubuntu-latest
Expand Down Expand Up @@ -123,8 +109,8 @@ jobs:
- name: 🧪 Setup elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: 1.15.5 # Define the elixir version [required]
otp-version: 26.1 # Define the OTP version [required]
elixir-version: 1.17.2 # Define the elixir version [required]
otp-version: 27.0.1 # Define the OTP version [required]

- name: ⬇️ Install elixir dependencies
run: mix deps.get
Expand Down Expand Up @@ -164,8 +150,8 @@ jobs:
- name: 🧪 Setup elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: 1.15.5 # Define the elixir version [required]
otp-version: 26.1 # Define the OTP version [required]
elixir-version: 1.17.2 # Define the elixir version [required]
otp-version: 27.0.1 # Define the OTP version [required]

- name: ⬇️ Install elixir dependencies
run: mix deps.get
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
- name: 🧪 Setup Elixir
uses: erlef/setup-elixir@v1
with:
elixir-version: 1.15.5 # Define the elixir version [required]
otp-version: 26.1 # Define the OTP version [required]
elixir-version: 1.17.2 # Define the elixir version [required]
otp-version: 27.0.1 # Define the OTP version [required]

- name: ⬇️ Install Elixir Dependencies
run: mix deps.get
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ Mnesia.*
# If you run "mix test --cover", coverage assets end up here.
/cover/

# `mix test.hound` will output failing test results here
/test-results/

# The directory Mix downloads your dependencies sources to.
/deps/

Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
erlang 26.1
elixir 1.15.5-otp-26
erlang 27.0.1
elixir 1.17.2-otp-27
nodejs 16.14.2
yarn 1.22.17
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
# This file is based on these images:
#
# - https://hub.docker.com/r/hexpm/elixir/tags - for the build image
# - https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye-20230612-slim - for the release image
# - https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye-20240722-slim - for the release image
# - https://pkgs.org/ - resource for finding needed packages
# - Ex: hexpm/elixir:1.15.5-erlang-26.1-debian-bullseye-20230612-slim
# - Ex: hexpm/elixir:1.17.2-erlang-27.0.1-debian-bullseye-20240722-slim
#
ARG ELIXIR_VERSION=1.15.5
ARG OTP_VERSION=26.1
ARG DEBIAN_VERSION=bullseye-20230612-slim
ARG ELIXIR_VERSION=1.17.2
ARG OTP_VERSION=27.0.1
ARG DEBIAN_VERSION=bullseye-20240722-slim

ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"
Expand Down
25 changes: 0 additions & 25 deletions assets/css/storybook.css

This file was deleted.

38 changes: 0 additions & 38 deletions assets/js/storybook.js

This file was deleted.

3 changes: 0 additions & 3 deletions assets/src/apps/authoring/Authoring.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useEffect, useMemo, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { getModeFromLocalStorage } from 'components/misc/DarkModeSelector';
import { ModalDisplay } from 'components/modal/ModalDisplay';
import { isFirefox } from 'utils/browser';
import { AppsignalContext, ErrorBoundary } from '../../components/common/ErrorBoundary';
import { initAppSignal } from '../../utils/appsignal';
Expand Down Expand Up @@ -242,8 +241,6 @@ const Authoring: React.FC<AuthoringProps> = (props: AuthoringProps) => {
<AppsignalContext.Provider value={appsignal}>
<ErrorBoundary>
<ModalContainer>
{/* ModalContainer handles re-parenting anywhere we use react-bootstrap Modals, ModalDisplay handles the torus style redux modals. TODO: unite these*/}
<ModalDisplay />
{isLoading && (
<div id="aa-loading">
<div className="loader spinner-border text-primary" role="status">
Expand Down
3 changes: 0 additions & 3 deletions assets/src/apps/bank/ActivityBank.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { PersistenceStatus } from 'components/content/PersistenceStatus';
import { Banner } from 'components/messages/Banner';
import { Page, Paging } from 'components/misc/Paging';
import { Modal } from 'components/modal/Modal';
import { ModalDisplay } from 'components/modal/ModalDisplay';
import { arrangeObjectives } from 'components/resource/objectives/sort';
import { UndoToasts } from 'components/resource/undo/UndoToasts';
import { modalActions } from 'actions/modal';
Expand Down Expand Up @@ -588,8 +587,6 @@ export class ActivityBank extends React.Component<ActivityBankProps, ActivityBan
<React.StrictMode>
<AppsignalContext.Provider value={this.state.appsignal}>
<ErrorBoundary>
<ModalDisplay />

<div className="resource-editor">
<div>
<UndoToasts undoables={this.state.undoables} onInvokeUndo={this.onInvokeUndo} />
Expand Down
3 changes: 0 additions & 3 deletions assets/src/apps/bibliography/Bibliography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { ErrorBoundary } from 'components/common/ErrorBoundary';
import { Banner } from 'components/messages/Banner';
import { Page, Paging } from 'components/misc/Paging';
import { Modal } from 'components/modal/Modal';
import { ModalDisplay } from 'components/modal/ModalDisplay';
import { modalActions } from 'actions/modal';
import { BibEntry } from 'data/content/bibentry';
import { Message, Severity, createMessage } from 'data/messages/messages';
Expand Down Expand Up @@ -326,8 +325,6 @@ const Bibliography: React.FC<BibliographyProps> = (props: BibliographyProps) =>
return (
<React.StrictMode>
<ErrorBoundary>
<ModalDisplay />

<div className="resource-editor row">
<div className="col-span-12">
<Banner
Expand Down
3 changes: 0 additions & 3 deletions assets/src/apps/page-editor/PageEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { TitleBar } from 'components/content/TitleBar';
import { setDefaultEditor } from 'components/editing/markdown_editor/markdown_util';
import { AlternativesContextProvider } from 'components/hooks/useAlternatives';
import { Banner } from 'components/messages/Banner';
import { ModalDisplay } from 'components/modal/ModalDisplay';
import { ContentOutline } from 'components/resource/editors/ContentOutline';
import { Editors } from 'components/resource/editors/Editors';
import { Objectives } from 'components/resource/objectives/Objectives';
Expand Down Expand Up @@ -559,8 +558,6 @@ export class PageEditor extends React.Component<PageEditorProps, PageEditorState
return (
<React.StrictMode>
<AppsignalContext.Provider value={this.state.appsignal}>
<ModalDisplay />

<ErrorBoundary>
<div className="resource-editor row">
<div className="col-span-12">
Expand Down
2 changes: 0 additions & 2 deletions assets/src/components/activities/AuthoringElementProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { useContext, useRef } from 'react';
import produce from 'immer';
import { Maybe } from 'tsmonad';
import { ErrorBoundary } from 'components/common/ErrorBoundary';
import { ModalDisplay } from 'components/modal/ModalDisplay';
import { AuthoringElementProps } from './AuthoringElement';
import { ActivityModelSchema, MediaItemRequest, PostUndoable } from './types';

Expand Down Expand Up @@ -54,7 +53,6 @@ export const AuthoringElementProvider: React.FC<AuthoringElementProps<ActivityMo
<AuthoringElementContext.Provider
value={{ projectSlug, editMode, dispatch, model, onRequestMedia, authoringContext }}
>
<ModalDisplay />
<ErrorBoundary>{children}</ErrorBoundary>
</AuthoringElementContext.Provider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export const FormulaEditor = (props: Props) => {
}

const onFormulaClick = () => {
console.log('onFormulaClick');

window.oliDispatch(
modalActions.display(
<FormulaModal
Expand Down
7 changes: 3 additions & 4 deletions assets/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const populateEntries = () => {
keepalive: ['./src/phoenix/keep-alive.ts'],
delivery_adaptive_themes_default_light: ['./styles/adaptive/light.scss'],
delivery_adaptive_themes_flowchart: ['./styles/adaptive/flowchart.scss'],
storybook: ['./js/storybook.js'],
};

const manifests = glob.sync('./src/components/activities/*/manifest.json', {});
Expand Down Expand Up @@ -79,9 +78,9 @@ const populateEntries = () => {
if (
Object.keys(merged).length !=
Object.keys(initialEntries).length +
2 * foundActivities.length +
2 * foundParts.length +
styleSheets.length
2 * foundActivities.length +
2 * foundParts.length +
styleSheets.length
) {
throw new Error(
'Encountered a possible naming collision in activity or part manifests. Aborting.',
Expand Down
9 changes: 0 additions & 9 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ config :oli,
problematic_query_detection: false,
problematic_query_cost_threshold: 150,
ecto_repos: [Oli.Repo],
prometheus_port: 9568,
build: %{
version: Mix.Project.config()[:version],
sha: System.get_env("SHA", default_sha),
Expand Down Expand Up @@ -290,14 +289,6 @@ config :tailwind,
--output=../priv/static/css/app.css
),
cd: Path.expand("../assets", __DIR__)
],
storybook: [
args: ~w(
--config=tailwind.config.js
--input=css/storybook.css
--output=../priv/static/assets/storybook.css
),
cd: Path.expand("../assets", __DIR__)
]

config :ex_cldr,
Expand Down
Loading

0 comments on commit d1d57c5

Please sign in to comment.