Skip to content

Commit 7392975

Browse files
committed
fix pagination and add appointments page
1 parent f9ef565 commit 7392975

File tree

5 files changed

+52
-3
lines changed

5 files changed

+52
-3
lines changed

config-overrides.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,21 @@ module.exports = function override (config, env) {
4141
)
4242
}
4343
}
44-
// add another output file at /simple/
44+
// add another output file at /simple/ and /appointments/
4545
config.plugins.splice(2, 0,
4646
new HtmlWebpackPlugin({
4747
inject: true,
4848
template: path.resolve(__dirname, 'public', 'simple/index.html'),
4949
filename: 'simple/index.html'
5050
})
5151
)
52+
config.plugins.splice(2, 0,
53+
new HtmlWebpackPlugin({
54+
inject: true,
55+
template: path.resolve(__dirname, 'public', 'appointments/index.html'),
56+
filename: 'appointments/index.html'
57+
})
58+
)
5259
// console.dir(config, { depth: 10, colors: true })
5360
return config
5461
}

public/appointments/index.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6+
<title>tutorcruncher-socket</title>
7+
<style>
8+
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,500);
9+
body {
10+
background: #eee;
11+
font-family: 'Open Sans', sans-serif;
12+
}
13+
* {
14+
box-sizing: border-box; /* bootstrap does this on most sites. */
15+
}
16+
main {
17+
max-width: 800px;
18+
margin: 20px auto;
19+
}
20+
main > div {
21+
background-color: white;
22+
border: 1px solid #aaa;
23+
}
24+
</style>
25+
</head>
26+
<body>
27+
<main>
28+
<p><a href="https://github.com/tutorcruncher/socket-frontend">github.com/tutorcruncher/socket-frontend</a></p>
29+
<p><a href="/">back to index</a></p>
30+
<p>appointments socket view:</p>
31+
<div id="socket"></div>
32+
</main>
33+
</body>
34+
<script>
35+
var public_key = '9c79f14df986a1ec693c'
36+
var api_root = null // 'https://socket-beta.tutorcruncher.com' 'http://localhost:8000'
37+
window.socket = socket(public_key, {
38+
mode: 'appointments',
39+
api_root: api_root,
40+
})
41+
</script>
42+
</html>

public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<main>
2828
<p><a href="https://github.com/tutorcruncher/socket-frontend">github.com/tutorcruncher/socket-frontend</a></p>
2929
<p><a href="/simple/">view simple socket panel</a></p>
30+
<p><a href="/appointments/">view appointments socket panel</a></p>
3031
<p>mode defined by options:</p>
3132
<div id="socket1"></div>
3233
<p>Grid mode:</p>

public/simple/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
var public_key = '9c79f14df986a1ec693c'
3636
var api_root = null // 'https://socket-beta.tutorcruncher.com' 'http://localhost:8000'
3737
window.socket = socket(public_key, {
38-
mode: 'appointments',
3938
api_root: api_root,
4039
})
4140
</script>

src/components/appointments/Appointments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class Appointments extends Component {
104104
const on_previous_pages = (page - 1) * this.props.config.pagination
105105
this.sso_args && await this.update_attendees()
106106
this.setState({
107-
appointments,
107+
appointments, page,
108108
more_pages: appointments.count > appointments.results.length + on_previous_pages,
109109
})
110110
}

0 commit comments

Comments
 (0)