# HG changeset patch # User Thomas Junk # Date 1535100658 -7200 # Node ID 27502291e564189de05b7f414eec99728a498511 # Parent 3e5ed9f40095a4031d079ff35e608de3eb3b7a69 docs: Added comments on non trivial parts of the code diff -r 3e5ed9f40095 -r 27502291e564 client/src/components/Map.jsx --- a/client/src/components/Map.jsx Fri Aug 24 10:08:49 2018 +0200 +++ b/client/src/components/Map.jsx Fri Aug 24 10:50:58 2018 +0200 @@ -1,3 +1,12 @@ +/** + * Map comonent and integration point with open layers + * Currently JSX was chosen to have more programmatic control + * over resulting HTML + * + * May change in the future + * + */ + /*eslint no-unused-vars: ["error", { "args": "none" }]*/ import "ol/ol.css"; import { Map, View } from "ol"; diff -r 3e5ed9f40095 -r 27502291e564 client/src/components/Userdetail.vue --- a/client/src/components/Userdetail.vue Fri Aug 24 10:08:49 2018 +0200 +++ b/client/src/components/Userdetail.vue Fri Aug 24 10:50:58 2018 +0200 @@ -90,7 +90,12 @@ }; const isEmailValid = email => { - /* cf. types.go */ + /** + * + * For convenience purposes the same regex used as in the go code + * cf. types.go + * + */ // eslint-disable-next-line return /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/.test( email diff -r 3e5ed9f40095 -r 27502291e564 client/src/lib/errors.js --- a/client/src/lib/errors.js Fri Aug 24 10:08:49 2018 +0200 +++ b/client/src/lib/errors.js Fri Aug 24 10:50:58 2018 +0200 @@ -1,3 +1,4 @@ +/** facade to wrap calls to vue2-toastr */ import app from "../main"; const displayError = ({ title, message }) => { diff -r 3e5ed9f40095 -r 27502291e564 client/src/lib/session.js --- a/client/src/lib/session.js Fri Aug 24 10:08:49 2018 +0200 +++ b/client/src/lib/session.js Fri Aug 24 10:50:58 2018 +0200 @@ -1,10 +1,21 @@ +/** + * Compares whether session is current + * based on the expiry information and the + * current date + * + * @param {number} expiresFromPastSession + */ function sessionStillActive(expiresFromPastSession) { if (!expiresFromPastSession) return false; const now = Date.now(); const stillActive = now < expiresFromPastSession; return stillActive; } - +/** + * Converts a given unix time to Milliseconds + * + * @param {string} timestring + */ function toMillisFromString(timestring) { return timestring * 1000; } diff -r 3e5ed9f40095 -r 27502291e564 client/src/router.js --- a/client/src/router.js Fri Aug 24 10:08:49 2018 +0200 +++ b/client/src/router.js Fri Aug 24 10:50:58 2018 +0200 @@ -3,6 +3,7 @@ import store from "./store"; import { sessionStillActive, toMillisFromString } from "./lib/session"; +/* facilitate codesplitting */ const Login = () => import("./views/Login.vue"); const Main = () => import("./views/Main.vue"); const Users = () => import("./views/Users.vue");