Skip to content

Commit 0481625

Browse files
authored
Merge pull request #30 from uw-asa/develop
Version 3.1.1 release (pending)
2 parents 874cfcd + cc6c538 commit 0481625

File tree

90 files changed

+67628
-28403
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+67628
-28403
lines changed

.dockerignore

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
node_modules
2-
.git
1+
node_modules/
2+
.git/
33
.env
4-
*-sample.xml
5-
/test
4+
.eslintrc
5+
.mocharc.yml
6+
sample.env
7+
*/*-sample.xml
8+
*/*-sample.json
9+
test/
10+
.vscode/

CHANGELOG.md

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,100 @@
11
# Changelog
22

3-
## [2.1.1] - 2021/10/07 - Added changelog
3+
## [3.1.1] - Minor Patches to Dev Dependencies
4+
5+
- eslint 8.1.0 -> 8.2.0
6+
- eslint-config-airbnb-base 14.2.1 -> 15.0.0
7+
- eslint-plugin-import 2.25.2 -> 2.25.3
8+
9+
## [3.1.0] - UI changes: Adaptive layout
10+
11+
- Removed the old dist. files for Bootstrap 4.3.1 and jquery 3.4.1.
12+
- Added Configuration Variable to set UI sizing at startup for full screen devices
13+
- Configuration variable acts as a hint to ensure the correct size. Window remains resizable thereafter if running in a full desktop environment
14+
- Added Art assets that break apart the footer into distinct elements so they can be applied to separately and scale/move independently
15+
- Broke custom stylesheets into separate elements for specific content items and the overall application look and feel
16+
- Made changes to templates to support the dynamic layout
17+
- EventDateCard now has breakpoints to hide certain columns of data at smaller screen sizes
18+
- Unified header sizes for cards so they all look similar
19+
- Changed margin settings for a more compact look at smaller screen sizes
20+
- For layouts that must completely change, the code has been altered to query the `windowWidth` and dynamically render content with a different data layout and template (currently limited to eventShiftCard/Narrow)
21+
- Added `windowWidth` to be passed along to renderer utilities in main.js
22+
- Made major changes to the render code for Event Shifts from When I Work
23+
- Removed all references to moment.js and replaced with the relevant date-fns.js library functions
24+
- Modified how data is formulated and packaged for the rendering template based on the window's current width
25+
- Started adding Type info to docstrings for passed params
26+
- Made some changes to `start.sh` to mitigate GPU process crashes on boot for Pi platforms (still unresolved, but better than it was)
27+
28+
### 3.1.0 Changes to the Production Docker Base Image
29+
30+
- Changed from Ubuntu to Debian
31+
- Modified what packages are installed over the base image, removing many that aren't (apparently) needed, and swapping out non "-dev" versions where possible
32+
- Changed the `npm install` run command to specify production environment (don't install dev dependencies)
33+
34+
## [3.0.1-dev] - Dev-only; minor patches to dependencies
35+
36+
- Dependency Updates
37+
- mocha 9.1.2 -> 9.1.3
38+
- eslint-plugin-import 2.24.2 -> 2.25.2
39+
- eslint 7.32.0 -> 8.0.1
40+
- axios 0.22.0 -> 0.23.0
41+
42+
## [3.0.0-dev] - Dev-Only; Electron update and major re-structuring
43+
44+
Many changes necessitated as part of updating Electron from v6 to v12 (oldest still-supported version [to limit the number of possible breaking changes, of which there are many]). Notably there's been a major restructuring of the three main Electron processes and their roles. Previously the code was all in renderer, which had access to all the Node APIs. With the update (because of security and best practices) most of that code needed to be removed to Main or Preload in order to be able to access those APIs, as well as the utility functions in `/utils`. The rewrite also necessitated using IPC (inter-process communication) to handle function transitions and passing back and forth functions. Libraries such as Pug for templating and moment/date-fns can't be required into the browser environment, so any functions provided by those libraries or by functions I've written need to be explicitly passed in via Electron's ContextBridge in `preload.js`.
45+
46+
### Architecture changes
47+
48+
API fetching and data processing moved to main process. DOM functionality provided by the browser environment no longer available to the data processing utility functions (used to parse XML), so a new dependency (@xmldom/xmldom) has been added to cover for the missing DOMParser functionality. This replacement is mostly drop-in and package size hasn't significantly increased.
49+
50+
### Core Dependency Updates
51+
52+
- axios 0.19.2 👉 0.22.0
53+
- dotenv 8.2.0 👉 10.0.0
54+
- pug 3.0.0 👉 3.0.2
55+
- electron 6.1.7 👉 12.2.1
56+
57+
### Moment.js deprecated
58+
59+
Began removal of moment.js in favor of using format from date-fns, which is a lighter-weight Moment replacement. This necessitated refactoring the format string templates and using different functions compared to what was available in Moment.js. There are still many places that Moment is referenced though.
60+
61+
### Minor Changes
62+
63+
- Added minor change to css to re-enable window dragging (was enabled by default in electron v6, but not in 12, apparently). Footer designated as a draggable area. This is really only relevant for desktop use/development testing.
64+
- `.dockerignore`: Added more files to be excluded; Fixed rules that weren't working.
65+
- Patched errorBackOff() so that it incrases error backoff rate at expected intervals, rather than immediately jumping to the MAX_REFRESH_INTERVAL.
66+
67+
## [2.1.3-dev] - Dev-only
68+
69+
Updated README due to changes in Balena ("Applications" 👉 "Fleets")
70+
71+
### [Issue #20](https://github.com/uw-asa/wiw-events-shifts-display/issues/20) - Multi-Architecture Builds
72+
73+
- `.dockerignore` updated to exclude more items.
74+
- Altered the dockerfile to a template for builds that take the Balena Fleet architecture into account and builds based on whatever architecture is needed for that target device arch.
75+
- 2 architectures tested in build process: armv7hf (pi2, pi3) and aarch64 (pi3-64, pi4-64).
76+
- Base OS for deployment is sticking to Ubuntu 18.04 LTS (Bionic), as it has the most support at this time.
77+
78+
## [2.1.2-dev] - Dev-only
79+
80+
### [Issue #22](https://github.com/uw-asa/wiw-events-shifts-display/issues/22) - Dependency Updates
81+
82+
- Updated dev dependencies
83+
- chai 4.2.0 👉 4.3.4
84+
- eslint 6.8.0 👉 7.3.2
85+
- eslint-plugin-import 2.20.1 👉 2.24.2
86+
- eslint-plugin-airbnb-base 14.1.0 👉 14.2.1
87+
- eslint-plugin-mocha 6.3.0 👉 9.0.0
88+
- mocha 7.1.1 👉 9.1.2
89+
- nyc 15.0.0 👉 15.1.0
90+
- Updated static distributable libraries
91+
- bootstrap 4.3.1 👉 5.1.2
92+
- jquery 3.4.1 👉 3.6.0
93+
- 🔧 Patched issue with text alignment class changes due to update to bootstrap css changes
94+
- Updated production dependencies
95+
- moment 2.24.0 👉 2.27.0
96+
- pug 2.0.4 👉 3.0.0
97+
98+
## [2.1.1] - 2021/10/07 - Added changelog [Issue #21](https://github.com/uw-asa/wiw-events-shifts-display/issues/21)
499

5100
Added changelog to track changes. Current version is v2.1.1

Dockerfile renamed to Dockerfile.template

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# This dockerfile is specifically generated to target a raspberry pi platform and will not run on different host architectures
22

3-
FROM balenalib/raspberrypi3-ubuntu-node:12.14-bionic
3+
# Balena base image reference: https://www.balena.io/docs/reference/base-images/base-images/
4+
# Device type pulled based on template variable for targeted fleet. Note that Fleets must share a similar architecture.
5+
FROM balenalib/%%BALENA_MACHINE_NAME%%-debian-node
46

57
# Avoid debconf from asking about keyboard config - there is no keyboard - set debconf to noninteractive
68
ENV DEBIAN_FRONTEND noninteractive
@@ -15,22 +17,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1517
libxcb-image0 \
1618
libxcb-util1 \
1719
xdg-utils \
18-
libdbus-1-dev \
19-
libgtk2.0-dev \
20-
libnotify-dev \
21-
libgnome-keyring-dev \
22-
libgconf2-dev \
23-
libasound2-dev \
24-
libcap-dev \
25-
libcups2-dev \
26-
libxtst-dev \
20+
libdbus-1-3 \
21+
libgtk-3-0 \
22+
# libnotify-dev \
23+
# libgnome-keyring-dev \
24+
# libgconf2-dev \
25+
libasound2 \
26+
libcap2 \
27+
# libcups2-dev \
28+
# libxtst-dev \
2729
libxss1 \
28-
libnss3-dev \
29-
libsmbclient \
30+
libnss3 \
31+
# libsmbclient \
3032
libssh-4 \
3133
fbset \
32-
libexpat-dev \
33-
libraspberrypi-bin \
34+
# libexpat-dev \
35+
# libraspberrypi-bin \
3436
&& rm -rf /var/lib/apt/lists/*
3537

3638
WORKDIR /usr/src/app
@@ -49,7 +51,7 @@ RUN echo "#!/bin/bash" > /etc/X11/xinit/xserverrc \
4951
# Move package.json to filesystem
5052
COPY ./package.json .
5153

52-
RUN npm install && npm cache clean --force && rm -rf /tmp/*
54+
RUN npm install --production --force && npm cache clean --force && rm -rf /tmp/*
5355

5456
# Test to ensure that electron was installed by checking if the electron binaries were downloaded to the /dist/ folder
5557
RUN test -d "./node_modules/electron/dist/" || exit 1

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,27 +127,27 @@ There are 2 options; build in the cloud with Balena Cloud or build the image loc
127127

128128
Use Ensure files are up to date and that you are on the correct code branch. Run tests to ensure the code is ready for deployment. Run the app locally on the development machine with `npm start` and make sure things appear correct, check the dev console while the app is running with `Ctrl+Shift+I` and look for http errors or console errors. You also must install the [Balena CLI][1].
129129

130-
### Locally with Docker
130+
### Locally with Docker (still uses Balena CLI to initiate build env)
131131

132-
1. Open a console to the project root (where `Dockerfile` and `package.json` are)
132+
1. Open a console to the project root (where `Dockerfile.template` and `package.json` are)
133133
2. Log into the Balena console with `balena login`
134134
3. Build the image
135135

136-
> `balena build --application [BALENA APP NAME] --logs .`
136+
> `balena build --fleet [BALENA FLEET NAME] --logs .`
137137
138-
**Note(s):** Don't forget the trailing `.` which designates the current directory as the source for the code. Substitute in the name of your app for `[BALENA APP NAME]` which corresponds to the application name on the Balena Cloud dashboard. Add `--logs` to see the complete build details. For complete CLI documentation and other options see the [Balena CLI documentation][2].
138+
**Note(s):** Don't forget the trailing `.` which designates the current directory as the source for the code. Substitute in the name of your fleet for `[BALENA FLEET NAME]` which corresponds to the application name on the Balena Cloud dashboard. Add `--logs` to see the complete build details. For complete CLI documentation and other options see the [Balena CLI documentation][2].
139139

140140
4. Push the built image to Balena Cloud
141141

142-
> `balena deploy [BALENA APP NAME]`
142+
> `balena deploy [BALENA FLEET NAME]`
143143
144144
### Building with Balena Cloud
145145

146-
1. Open a console to the project root (where `Dockerfile` and `package.json` are)
146+
1. Open a console to the project root (where `Dockerfile.template` and `package.json` are)
147147
2. Log into the Balena console with `balena login`
148148
3. Push code to Balena's build servers and wait for the image to be deployed automatically
149149

150-
> `balena push [BALENA APP NAME] .`
150+
> `balena push [BALENA FLEET NAME] .`
151151
152152
## Resources for Learning Electron
153153

index.css

Lines changed: 0 additions & 112 deletions
This file was deleted.

index.html

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,36 @@
44
<!-- Required meta tags -->
55
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
66
<meta charset="UTF-8">
7-
<title>Events Schedule</title>
8-
<link rel="stylesheet" type="text/css" href="index.css">
9-
<link rel="stylesheet" type="text/css" href="static/bootstrap-4.3.1-dist/css/bootstrap.min.css">
7+
<!-- note, Title bar never displays -->
8+
<title>PiDisplay</title>
9+
<link rel="stylesheet" type="text/css" href="static/css/index.css">
10+
<link rel="stylesheet" type="text/css" href="static/css/content.css">
11+
12+
<link rel="stylesheet" type="text/css" href="static/bootstrap-5.1.2-dist/css/bootstrap.min.css">
1013

11-
<script type="text/javascript" src="static/jquery-3.4.1/jquery-3.4.1.min.js"></script>
12-
<script type="text/javascript" src="static/bootstrap-4.3.1-dist/js/bootstrap.min.js"></script>
14+
<script type="text/javascript" src="static/jquery-3.6.0/jquery-3.6.0.min.js"></script>
15+
<script type="text/javascript" src="static/bootstrap-5.1.2-dist/js/bootstrap.min.js"></script>
1316
</head>
1417

1518
<body>
1619
<div id="main" class="container-fluid">
1720
</div>
1821

1922
<footer>
20-
<div class="container-fluid">
21-
<div class="row">
23+
<div class="container-fluid px-lg-2">
24+
<div id="footer-container" class="row align-items-center">
2225
<div class="col">
2326
<span id="reload-interval"></span>
2427
</div>
2528
<div id="clock" class="col">
2629
<!-- clock -->
2730
</div>
28-
<div id="title" class="col">
29-
<h1 class="text-right"></h1>
31+
<div id="titleContainer" class="col">
32+
<h1 id="title" class="text-end"></h1>
3033
</div>
3134
</div>
3235
</div>
36+
<div id="title-bg"></div>
3337
</footer>
3438
<!-- You can also require other files to run in this process -->
3539
<script src="./renderer.js"></script>

0 commit comments

Comments
 (0)