Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
734a2c2
Environment setup
easternwashingaden Jun 22, 2020
4f19aeb
Set up the environment
easternwashingaden Jun 23, 2020
272bda6
Added react-router-dom
aecombs Jun 23, 2020
17ae029
Added home, library, customers, and search components and nav
aecombs Jun 23, 2020
c09081f
Resolved merge conflict
aecombs Jun 23, 2020
560734d
Removed class components from all components
aecombs Jun 23, 2020
21aaeb5
Merge pull request #1 from easternwashingaden/nav-bar-branch
aecombs Jun 23, 2020
31b9fbc
Imported bootstrap
aecombs Jun 23, 2020
c9e4359
Added cd favicon
aecombs Jun 23, 2020
cc2e6fd
Added customer and can now grab customers from our rails api
aecombs Jun 23, 2020
5eba442
Merge branch 'master' of https://github.com/easternwashingaden/video-…
aecombs Jun 23, 2020
9ff7f58
Fixed issue with continuous api calls
aecombs Jun 23, 2020
5e6c077
Changed css to have a table of customers
aecombs Jun 23, 2020
7e0ae8b
Added columns to customers table
aecombs Jun 23, 2020
080a683
Added select customer button, leads no where
aecombs Jun 23, 2020
1e8d854
Install axiso
easternwashingaden Jun 23, 2020
9e5b834
Installed axios
easternwashingaden Jun 23, 2020
a64256a
Merge pull request #2 from easternwashingaden/customers-branch
aecombs Jun 23, 2020
14ad177
Added import bootrap
easternwashingaden Jun 23, 2020
d5fa9b1
Changed the welcome text
easternwashingaden Jun 23, 2020
f3586f5
Deleted extra line
easternwashingaden Jun 23, 2020
fe7bf68
Get data from API through axios
easternwashingaden Jun 23, 2020
2d0f2ec
Deleted extra line
easternwashingaden Jun 23, 2020
1b70553
Added Movie component
easternwashingaden Jun 23, 2020
54d3e3f
Merge branch 'master' into get_libary_list
easternwashingaden Jun 23, 2020
19d0a21
Merge pull request #3 from easternwashingaden/get_libary_list
easternwashingaden Jun 23, 2020
de6ae95
Adding comments to app
aecombs Jun 23, 2020
e4b8ecd
Merge branch 'master' of https://github.com/easternwashingaden/video-…
aecombs Jun 23, 2020
1af7ca4
Passing props to components thru header
aecombs Jun 23, 2020
e5e107c
Added selectedCustomer state and callback function
aecombs Jun 24, 2020
732c3f4
Added selectedMovie state and callback function, and display in nav
aecombs Jun 24, 2020
936b494
Added some CSS
aecombs Jun 24, 2020
452aecf
Added logo
aecombs Jun 24, 2020
8da159e
Added fonts
aecombs Jun 24, 2020
6ec9970
Merge pull request #4 from easternwashingaden/storing-selected-custom…
aecombs Jun 24, 2020
90c1c03
Worked on the search bar and checkout
easternwashingaden Jun 24, 2020
e180cd5
Added env
easternwashingaden Jun 24, 2020
28dc894
Printed the error message
easternwashingaden Jun 24, 2020
a120fbc
Worked on the search
easternwashingaden Jun 24, 2020
e81a555
Changed background image
aecombs Jun 24, 2020
f24305c
Worked on the search functionality
easternwashingaden Jun 24, 2020
f2ff1ea
Updated logo and favicon.ico
aecombs Jun 24, 2020
92e88a6
Fixed image issue
aecombs Jun 24, 2020
8b0bcd8
Merge pull request #5 from easternwashingaden/change-images
aecombs Jun 24, 2020
613136a
Changed due date
easternwashingaden Jun 24, 2020
678791d
Console log something
easternwashingaden Jun 24, 2020
9cbc6c0
console.log API_KEY
easternwashingaden Jun 24, 2020
0aa6ee6
Change the form for search
easternwashingaden Jun 24, 2020
32b95a8
Merge pull request #6 from easternwashingaden/search_feature
easternwashingaden Jun 24, 2020
08891d6
Now uses rails api to get movies from tmdb
aecombs Jun 24, 2020
418e65c
Merge pull request #7 from easternwashingaden/searching-with-rails
aecombs Jun 24, 2020
6982032
Updated external id column
aecombs Jun 24, 2020
c057b2b
removed comments from search
aecombs Jun 24, 2020
80db890
Added css to tables and to search button
aecombs Jun 24, 2020
bf8a19a
Removed container css from tables
aecombs Jun 24, 2020
2667d21
Search displays ext id properly
aecombs Jun 24, 2020
6dc20c6
Added addMovie function from search to the Library
easternwashingaden Jun 25, 2020
612fb06
Merge pull request #8 from easternwashingaden/search-css
aecombs Jun 25, 2020
eeefd21
Added the messages state
easternwashingaden Jun 25, 2020
dc3f5ef
Added onButtonAddClick and more
easternwashingaden Jun 25, 2020
fcbf104
Merge branch 'master' into add_movie_to_rental
easternwashingaden Jun 25, 2020
b022880
Merge pull request #9 from easternwashingaden/add_movie_to_rental
easternwashingaden Jun 25, 2020
368b442
Cleaned up app.js of comments
aecombs Jun 25, 2020
3c19239
Removed unused code on Header.js
aecombs Jun 25, 2020
0d453d7
Cleaned up selection in nav
aecombs Jun 25, 2020
545e218
Added flash messages and timeout functionality, changed app title
aecombs Jun 25, 2020
2d95b8e
Changed bg on all pages, added conditionality to search
aecombs Jun 25, 2020
ebd1ab4
Updated home text
aecombs Jun 25, 2020
df9094a
Fixed the adding movie feature to prevent user from adding the same m…
easternwashingaden Jun 25, 2020
c3abbb3
Merge pull request #11 from easternwashingaden/fix_add_movie_to_rental
easternwashingaden Jun 25, 2020
6d10ad8
Merge branch 'master' into add-flash-messages
easternwashingaden Jun 25, 2020
cfebd34
Merge pull request #10 from easternwashingaden/add-flash-messages
easternwashingaden Jun 25, 2020
181edfd
fixed message
easternwashingaden Jun 25, 2020
10c3a9d
Added footer
aecombs Jun 25, 2020
7f16a8e
Resolved merge conflict
aecombs Jun 25, 2020
0f065c2
Changed class to className
aecombs Jun 25, 2020
9dc87da
Merge pull request #12 from easternwashingaden/update-search-add-footer
aecombs Jun 25, 2020
e1261ce
Fixed footer floating issue, added functionality to search page
aecombs Jun 25, 2020
56f06d4
Deleted an extra line
easternwashingaden Jun 25, 2020
8ab5d0b
Deleted unneeded lines and convert the registered_at
easternwashingaden Jun 25, 2020
f4f58a8
Deleted unneed lines
easternwashingaden Jun 25, 2020
feab597
Deleted unneeded comments and codes
easternwashingaden Jun 25, 2020
84cca11
Added propTypes
easternwashingaden Jun 25, 2020
149d284
Deleted unneeded comments and codes
easternwashingaden Jun 25, 2020
cc98e5a
Added PropTypes
easternwashingaden Jun 25, 2020
dc53a74
Deleted unneeded comments and codes
easternwashingaden Jun 25, 2020
4043d2e
Merge pull request #13 from easternwashingaden/add_proptypes
easternwashingaden Jun 25, 2020
c43119f
Fixed the proptypes
easternwashingaden Jun 25, 2020
b6f9d37
Added the alt to image
easternwashingaden Jun 25, 2020
30d31c8
Fixed proptype
easternwashingaden Jun 25, 2020
fe89725
Fixed a proptype
easternwashingaden Jun 25, 2020
e8f5e0e
Changed errorMessage to message
aecombs Jun 25, 2020
0b4181d
Installed and implemented react-notifications-component
aecombs Jun 25, 2020
3818f97
Fixed error on search notifications
aecombs Jun 25, 2020
cc5960c
Merge pull request #14 from easternwashingaden/change-notifications
aecombs Jun 25, 2020
5c9edc1
Extended pages to always be full view length before tables load
aecombs Jun 25, 2020
74a90ef
Merge branch 'master' of https://github.com/easternwashingaden/video-…
aecombs Jun 25, 2020
21a50ca
Fixed home page length
aecombs Jun 25, 2020
ea43b43
Fixed footer width
aecombs Jun 25, 2020
b1a40c8
Merge pull request #15 from easternwashingaden/fix-css
aecombs Jun 25, 2020
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.env
10,063 changes: 5,558 additions & 4,505 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,32 @@
"version": "0.1.1",
"private": true,
"dependencies": {
"axios": "^0.19.2",
"bootstrap": "^4.5.0",
"jquery": "^3.5.1",
"popper.js": "^1.16.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-notifications-component": "^2.4.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file modified public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}

34 changes: 18 additions & 16 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';

class App extends Component {
render() {
import React, { useEffect } from 'react';
import Header from './components/Header';
import Footer from './components/Footer';
import 'bootstrap/dist/css/bootstrap.min.css';
import ReactNotification from 'react-notifications-component';
import 'react-notifications-component/dist/theme.css';

const App = () => {
useEffect(() => {
document.title = "LA Videos title"
}, []);

return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.js</code> and save to reload.
</p>
</div>
<section className="">
<ReactNotification />
<Header />
<Footer />
</section>
);
}
}

export default App;
export default App;
49 changes: 49 additions & 0 deletions src/components/Customer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from 'react';
import PropTypes from 'prop-types';

const Customer = (props) => {

const onButtonClick = () => {
const selected = {
id: props.id,
name: props.name
}
props.selectCustomerCallback(selected);
}

return (
<tr>
<td><p>{props.id}</p></td>
<td>
<button onClick={onButtonClick} className="btn btn-danger">
Select
</button>
</td>
<td><p>{props.name}</p></td>
<td><p>{props.address}<br/>{props.city}, {props.state} {props.postal_code}</p></td>
<td><p>{props.phone}</p></td>
<td><p>{new Intl.NumberFormat("en-us", {
style: "currency",
currency: "USD"
}).format(props.account_credit)}</p></td>
<td><p>{props.movies_checked_out_count}</p></td>
<td><p>{new Date(props.registered_at).toDateString()}</p></td>
</tr>
);
}

Customer.propTypes = {
id: PropTypes.number.isRequired,
name: PropTypes.string,
registered_at: PropTypes.string,
address: PropTypes.string,
city: PropTypes.string,
state: PropTypes.string,
postal_code: PropTypes.string,
phone: PropTypes.string,
account_credit: PropTypes.number,
movies_checked_out_count: PropTypes.number,
selectCustomerCallback: PropTypes.func.isRequired
};

export default Customer;
82 changes: 82 additions & 0 deletions src/components/Customers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import React, { useState, useEffect } from 'react';
import axios from 'axios';
import PropTypes from 'prop-types';
import Customer from './Customer';
import { store } from 'react-notifications-component';


const Customers = (props) => {
const [customersList, setCustomersList] = useState([]);

useEffect(() => {
axios.get(props.url)
.then( (response) => {
const customers = response.data;
setCustomersList(customers);
})
.catch((error) => {
store.addNotification({
title: "Error: ",
message: `${error.message}`,
type: "danger",
insert: "top",
container: "top-left",
animationIn: ["animated", "fadeIn"],
animationOut: ["animated", "fadeOut"],
dismiss: {
duration: 5000,
onScreen: true
}
});
});
},[props.url])

const customersComponents = customersList.map((customerObject) => {
return(
<Customer
key={customerObject.id}
id={customerObject.id}
name={customerObject.name}
registered_at={customerObject.registered_at}
address={customerObject.address}
city={customerObject.city}
state={customerObject.state}
postal_code={customerObject.postal_code}
phone={customerObject.phone}
account_credit={customerObject.account_credit}
movies_checked_out_count={customerObject.movies_checked_out_count}
selectCustomerCallback={props.selectCustomerCallback}
/>
)
})


return (
<div className="w-100 d-flex text-center flex-wrap justify-content-around">
<h2 className="text-center w-100 pt-3 pb-3">Customers</h2>
<table className="table table-hover table-light">
<thead className="thead-light text-center">
<tr>
<th>ID</th>
<th>Select</th>
<th>Name</th>
<th>Address</th>
<th>Phone Number</th>
<th>Account Credit</th>
<th>Current Rentals</th>
<th>Registered</th>
</tr>
</thead>
<tbody>
{customersComponents}
</tbody>
</table>
<div className="full-page"></div>
</div>
);
}

Customers.propTypes = {
url: PropTypes.string.isRequired
};
export default Customers;
45 changes: 45 additions & 0 deletions src/components/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from 'react';

const Footer = () => {
return (
<footer className="w-100 footer text-white pt-3">
<div className="container">
<div className="row">
<div className="d-flex col">
<div className="footer-logo text-left">
<a href="/"><img className="w-100" src="https://lh3.googleusercontent.com/pw/ACtC-3egOjtR1cwMLE4DWMqvjucZFIg_OgNhqZtie9V5whCbr-K9oWeSs_9zSXWVS3CMZLDZM_mxC68ZIV20qYpUwihwbMTCwSyWV_rpPl9OEr2xxQGxhq9aeOssSRHQnL2Zdw9VhKh_5W6EouKACuyRpCQC=w400-h173-no?authuser=0" alt = ""/></a>
</div>
</div>
<div className="container text-left col">
<h5 className="pb-1">About LA Videos</h5>
<a href="/"><p>Careers</p></a>
<a href="/"><p>Blog</p></a>
<a href="/"><p>News</p></a>
<a href="/"><p>Company Info</p></a>
</div>
<div className="container text-left col">
<h5 className="pb-1">Troubleshooting</h5>
<a href="/"><p>Customer Resolution</p></a>
<a href="/"><p>Employee Contract</p></a>
<a href="/"><p>Rentals Policy</p></a>
<a href="/"><p>Contact Us</p></a>
</div>
<div className="container text-left col">
<h5 className="pb-1">Community</h5>
<a href="/"><p>Announcements</p></a>
<a href="/"><p>Picnic Schedule</p></a>
<a href="/"><p>Employee of the Month</p></a>
<a href="/"><p>Videobook</p></a>
</div>

<div className="w-100"></div>
<div className="col text-center">
<p className="subtle-text px-2 small">© 2020 LA Videos, All Rights Reserved</p>
</div>
</div>
</div>
</footer>
);
}

export default Footer;
Loading