Skip to content

Commit

Permalink
adminclient auth classes
Browse files Browse the repository at this point in the history
replaced amplify default ui
moved survey client auth to sharedcode
moved adminclient model code to separate module
added redux store to adminclient
  • Loading branch information
Donal Stewart committed Jan 20, 2021
1 parent 6044190 commit fdb88f8
Show file tree
Hide file tree
Showing 7 changed files with 8,255 additions and 2,604 deletions.
1 change: 1 addition & 0 deletions sharedcode/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

# production
/dist
*.tgz

# misc
.eslintcache
Expand Down
4 changes: 2 additions & 2 deletions sharedcode/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Contains the survey description shared between the [surveyclient](../surveyclient) and [adminclient](../adminclient).
Contains the survey description and components shared between the [surveyclient](../surveyclient) and [adminclient](../adminclient).

Run `npm install; npm run build` to build.
Run `npm install; npm run build; npm pack` to build and package.
10,735 changes: 8,174 additions & 2,561 deletions sharedcode/package-lock.json

Large diffs are not rendered by default.

82 changes: 72 additions & 10 deletions sharedcode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,98 @@
"private": true,
"main": "dist/index.js",
"type": "module",
"dependencies": {
"react": "^17.0.1"
"peerDependencies": {
"@aws-amplify/auth": "^3.4.17",
"@aws-amplify/core": "^3.8.9",
"@material-ui/core": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.57",
"react": "^17.0.1",
"react-redux": "^7.2.2",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0"
},
"devDependencies": {
"@aws-amplify/auth": "^3.4.17",
"@aws-amplify/core": "^3.8.9",
"@babel/cli": "^7.12.10",
"@babel/core": "^7.12.10",
"@babel/plugin-transform-runtime": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"@material-ui/core": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.57",
"@testing-library/jest-dom": "^5.11.9",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"eslint": "^7.16.0",
"eslint": "^7.18.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-webpack-plugin": "^2.4.1",
"webpack": "^5.11.0",
"webpack-cli": "^4.2.0"
"jest": "^26.6.3",
"jest-environment-jsdom-fourteen": "^1.0.1",
"jest-watch-typeahead": "^0.6.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-redux": "^7.2.2",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0"
},
"jest": {
"roots": [
"<rootDir>/src"
],
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
"!src/**/*.d.ts"
],
"setupFilesAfterEnv": [
"@testing-library/jest-dom/extend-expect"
],
"testEnvironment": "jest-environment-jsdom-fourteen",
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest"
},
"watchPlugins": [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
]
},
"scripts": {
"build": "webpack"
"build": "babel src --out-dir dist",
"test": "jest"
},
"babel": {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
[
"@babel/transform-runtime"
]
]
},
"eslintConfig": {
"extends": "react-app"
"env": {
"jest": true,
"jest/globals": true
},
"extends": [
"react-app",
"plugin:jest/all"
],
"plugins": [
"jest"
],
"rules": {
"jest/require-top-level-describe": "off",
"jest/prefer-expect-assertions": "off",
"jest/no-hooks": "off",
"jest/prefer-spy-on": "off",
"jest/no-test-return-statement": "off"
}
}
}
25 changes: 0 additions & 25 deletions sharedcode/webpack.config.cjs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from "react";
import { useDispatch } from "react-redux";
import { signOut } from "../../model/AuthActions";
import { signOut } from "learning-play-audit-shared";
import ConfirmDialog from "../ConfirmDialog";
import "../../App.css";

Expand Down
10 changes: 5 additions & 5 deletions surveyclient/src/components/auth/AuthSignOutWithConfirm.test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from "react";
import { render, unmountComponentAtNode } from "react-dom";
import { act } from "react-dom/test-utils";
import AuthSignOut from "./AuthSignOut";
import AuthSignOutWithConfirm from "./AuthSignOutWithConfirm";
import surveyStore from "../../model/SurveyModel";
import { Provider } from "react-redux";
import { signOut } from "../../model/AuthActions";
import { signOut } from "learning-play-audit-shared";

jest.mock("../../model/AuthActions");
jest.mock("learning-play-audit-shared");

describe("component AuthSignOut", () => {
describe("component AuthSignOutWithConfirm", () => {
var container = null;
beforeEach(() => {
// setup a DOM element as a render target
Expand Down Expand Up @@ -87,7 +87,7 @@ describe("component AuthSignOut", () => {
act(() => {
render(
<Provider store={surveyStore}>
<AuthSignOut />
<AuthSignOutWithConfirm />
</Provider>,
container
);
Expand Down

0 comments on commit fdb88f8

Please sign in to comment.