Skip to content

Commit

Permalink
initial checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Redman committed Apr 2, 2020
1 parent bf6d096 commit e413957
Show file tree
Hide file tree
Showing 19 changed files with 320 additions and 628 deletions.
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,23 @@ This is a simple react js hooks starter project that is using Azure AD to authen
```text
// .env.development.local
REACT_APP_ID={Application (client) ID created above}
REACT_APP_AUTHORITY=https://login.microsoftonline.com/{Azure tenant id that will match the tenant you created the app registration in}
REACT_APP_REDIRECT_URL=http://localhost:3000
REACT_APP_API_BASE_URL=https://lws-lagoonapis-fa-sbx.azurewebsites.net/api/
REACT_APP_API_BASE_URL=https://jsonplaceholder.typicode.com/
```
4. Run the following commands
```bash
$npm install
$npm start
```
```
5. Login and start clicking
## Additional Info
This project is using the JSONPlaceHolder API, which can be found here https://jsonplaceholder.typicode.com, to pull in random sample data to play with. A couple of important things to note about this data source:
1. It's read-only. It will provide fakes for inserts and updates, but you aren't really changing the source. For example, if you create a new post and then try to edit that post, it will fail since the post you created was just a fake.
2. Actually there was only one important thing to note about using this data...
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"reactstrap": "^8.4.1"
},
"scripts": {
"start": "react-scripts start",
"start": "PORT=3000 react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon-32x32.png" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
Expand All @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Lagoon WES</title>
<title>React Azure Starter</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
30 changes: 13 additions & 17 deletions src/components/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { UserAgentApplication } from 'msal';
import { getUserDetails, getUserPhoto, getUserGroups } from '../utils/graph-service';
import Calendar from '../calendar/calendar';
import Posts from '../posts/post';
import Facility from '../facility/facility';
import { library } from '@fortawesome/fontawesome-svg-core';
import { faCheckCircle, faQuestionCircle, faExclamationCircle } from '@fortawesome/free-solid-svg-icons'

Expand Down Expand Up @@ -85,7 +84,10 @@ class App extends Component {
}

isUserInAdminRole(userRoles) {
return userRoles.some(userRole => userRole.id === config.isAdminGroupId);
//this is the check for user groups, but it is commented out so we can make the buttons work for this sample, in the event that you use this code,
//you will need to create a group for admin access and grant admin consent to the group.read.all scope for the app in azure AD
//return userRoles.some(userRole => userRole.id === config.isAdminGroupId);
return true;
}

async getUserProfile() {
Expand Down Expand Up @@ -150,21 +152,15 @@ class App extends Component {
user={this.state.user}/>
<Container>
{notify}
<Route exact path="/"
render={(props) =>
<Welcome {...props}
isAuthenticated={this.state.isAuthenticated}
user={this.state.user}
authButtonMethod={this.login.bind(this)} />
} />
<Route exact path="/calendar"
render={(props) =>
<Calendar {...props}
isAuthenticated={this.state.isAuthenticated}
showNotify={this.setNotifyMessage.bind(this)} />
} />
<Route exact path="/facility" render={(props) => <Facility {...props} user={this.state.user} isAuthenticated={this.state.isAuthenticated} showNotify={this.setNotifyMessage.bind(this)} />} />
<Route exact path="/posts" render={(props) => <Posts {...props} user={this.state.user} isAuthenticated={this.state.isAuthenticated} showNotify={this.setNotifyMessage.bind(this)} />} />
<Route exact path="/" render={(props) =>
<Welcome {...props} isAuthenticated={this.state.isAuthenticated} user={this.state.user} authButtonMethod={this.login.bind(this)} />
} />
<Route exact path="/calendar" render={(props) =>
<Calendar {...props} isAuthenticated={this.state.isAuthenticated} showNotify={this.setNotifyMessage.bind(this)} />
} />
<Route exact path="/posts" render={(props) =>
<Posts {...props} user={this.state.user} isAuthenticated={this.state.isAuthenticated} showNotify={this.setNotifyMessage.bind(this)} />
} />
</Container>
</div>
</Router>
Expand Down
133 changes: 0 additions & 133 deletions src/components/facility/facility-upsert.js

This file was deleted.

124 changes: 0 additions & 124 deletions src/components/facility/facility.js

This file was deleted.

1 change: 0 additions & 1 deletion src/components/facility/index.js

This file was deleted.

Loading

0 comments on commit e413957

Please sign in to comment.