Commit b57ba4f6 authored by Alexis POYEN's avatar Alexis POYEN
Browse files

Merge branch 'code-review' into 'master'

Code review

See merge request apoyen/sdk-go!2
parents 1437609c 15be3288
Pipeline #5118 passed with stages
in 3 minutes and 34 seconds
......@@ -5,10 +5,23 @@ import (
"net/http"
"strconv"
"strings"
"time"
"forge.grandlyon.com/apoyen/sdk-go/pkg/auth"
)
// UserClient has many BankAccounts and one UserBanker
type UserClient struct {
ID uint `gorm:"primary_key"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
DeletedAt *time.Time `json:"-"`
UserID int `gorm:"not null;unique"`
Name string
UserBankerID uint
BankAccounts []BankAccount
}
// HandleClients expose the UserClients API
func (d *DataHandler) HandleClients(w http.ResponseWriter, r *http.Request) {
id, _ := strconv.Atoi(strings.TrimPrefix(r.URL.Path, "/api/UserClients/"))
......
......@@ -73,18 +73,6 @@ func (d *DataHandler) ProcessAPI(w http.ResponseWriter, r *http.Request) {
}
}
// UserClient has many BankAccounts and one UserBanker
type UserClient struct {
ID uint `gorm:"primary_key"`
CreatedAt time.Time `json:"-"`
UpdatedAt time.Time `json:"-"`
DeletedAt *time.Time `json:"-"`
UserID int `gorm:"not null;unique"`
Name string
UserBankerID uint
BankAccounts []BankAccount
}
// UserBanker has many UserClient
type UserBanker struct {
ID uint `gorm:"primary_key"`
......
......@@ -39,7 +39,7 @@ func init() {
// SetFile set a file to log to instead of standard output
func SetFile(file string) {
var err error
f, err = os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
f, err = os.OpenFile(file, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0600)
if err != nil {
log.Fatalf("error opening file: %v", err)
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
// Imports
import * as Auth from "/services/auth/auth.js";
import * as Messages from "/services/messages/messages.js";
import { RandomString } from "/services/common/common.js";
import * as Operations from "/components/bankerPage/operations.js";
// DOM elements
......@@ -17,8 +16,6 @@ export async function mount(where, parent) {
class BankAccount {
constructor(parent) {
// Random id seed
this.prefix = RandomString(8);
this.parent = parent;
}
......
......@@ -9,7 +9,6 @@
<link rel="stylesheet" href="assets/bulma.min.css" />
<link rel="stylesheet" href="assets/animate.css" />
<link rel="stylesheet" href="style.css" />
<script defer src="assets/fontawesome/brands.min.js"></script>
<script defer src="assets/fontawesome/solid.min.js"></script>
<script defer src="assets/fontawesome/fontawesome.min.js"></script>
<script defer type="module" src="main.js"></script>
......@@ -31,12 +30,42 @@
<div class="buttons">
<a class="button is-primary" href="https://www.github.com/nicolaspernoud/Vestibule" target="_blank" rel="noopener noreferrer">
<span class="icon">
<em class="fab fa-github"></em>
<svg
class="svg-inline--fa fa-github fa-w-16"
aria-hidden="true"
focusable="false"
data-prefix="fab"
data-icon="github"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 496 512"
data-fa-i2svg=""
>
<path
fill="currentColor"
d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"
></path></svg
><!-- <i class="fab fa-github"></i> -->
</span>
</a>
<a class="button is-danger" href="https://forge.grandlyon.com/NPERNOUD/vestibule" target="_blank" rel="noopener noreferrer">
<span class="icon">
<em class="fab fa-gitlab"></em>
<svg
class="svg-inline--fa fa-gitlab fa-w-16"
aria-hidden="true"
focusable="false"
data-prefix="fab"
data-icon="gitlab"
role="img"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 512 512"
data-fa-i2svg=""
>
<path
fill="currentColor"
d="M105.2 24.9c-3.1-8.9-15.7-8.9-18.9 0L29.8 199.7h132c-.1 0-56.6-174.8-56.6-174.8zM.9 287.7c-2.6 8 .3 16.9 7.1 22l247.9 184-226.2-294zm160.8-88l94.3 294 94.3-294zm349.4 88l-28.8-88-226.3 294 247.9-184c6.9-5.1 9.7-14 7.2-22zM425.7 24.9c-3.1-8.9-15.7-8.9-18.9 0l-56.6 174.8h132z"
></path></svg
><!-- <i class="fab fa-gitlab"></i> -->
</span>
</a>
</div>
......
/*
HOW TO UPDATE THAT LIST :
Go to https://fontawesome.com/cheatsheet
Paste the following code into the developper console :
---
var names = new Set();
var icons = document.getElementsByClassName("icon");
for (const icon of icons) {
const name = icon.getElementsByTagName("dd")[0].innerText;
names.add(name);
}
console.log(JSON.stringify(Array.from(names)));
---
*/
export const Icons = [
"ad",
"address-book",
......@@ -100,6 +115,7 @@ export const Icons = [
"bowling-ball",
"box",
"box-open",
"box-tissue",
"boxes",
"braille",
"brain",
......@@ -258,6 +274,7 @@ export const Icons = [
"dice-two",
"digital-tachograph",
"directions",
"disease",
"divide",
"dizzy",
"dna",
......@@ -309,6 +326,7 @@ export const Icons = [
"fan",
"fast-backward",
"fast-forward",
"faucet",
"fax",
"feather",
"feather-alt",
......@@ -413,7 +431,9 @@ export const Icons = [
"hamsa",
"hand-holding",
"hand-holding-heart",
"hand-holding-medical",
"hand-holding-usd",
"hand-holding-water",
"hand-lizard",
"hand-middle-finger",
"hand-paper",
......@@ -425,10 +445,14 @@ export const Icons = [
"hand-pointer",
"hand-rock",
"hand-scissors",
"hand-sparkles",
"hand-spock",
"hands",
"hands-helping",
"hands-wash",
"handshake",
"handshake-alt-slash",
"handshake-slash",
"hanukiah",
"hard-hat",
"hashtag",
......@@ -436,6 +460,10 @@ export const Icons = [
"hat-cowboy-side",
"hat-wizard",
"hdd",
"head-side-cough",
"head-side-cough-slash",
"head-side-mask",
"head-side-virus",
"heading",
"headphones",
"headphones-alt",
......@@ -456,6 +484,7 @@ export const Icons = [
"hospital",
"hospital-alt",
"hospital-symbol",
"hospital-user",
"hot-tub",
"hotdog",
"hotel",
......@@ -464,6 +493,7 @@ export const Icons = [
"hourglass-half",
"hourglass-start",
"house-damage",
"house-user",
"hryvnia",
"i-cursor",
"ice-cream",
......@@ -497,6 +527,7 @@ export const Icons = [
"language",
"laptop",
"laptop-code",
"laptop-house",
"laptop-medical",
"laugh",
"laugh-beam",
......@@ -526,6 +557,8 @@ export const Icons = [
"long-arrow-alt-up",
"low-vision",
"luggage-cart",
"lungs",
"lungs-virus",
"magic",
"magnet",
"mail-bulk",
......@@ -616,6 +649,7 @@ export const Icons = [
"pen-square",
"pencil-alt",
"pencil-ruler",
"people-arrows",
"people-carry",
"pepper-hot",
"percent",
......@@ -635,6 +669,7 @@ export const Icons = [
"plane",
"plane-arrival",
"plane-departure",
"plane-slash",
"play",
"play-circle",
"plug",
......@@ -658,6 +693,8 @@ export const Icons = [
"print",
"procedures",
"project-diagram",
"pump-medical",
"pump-soap",
"puzzle-piece",
"qrcode",
"question",
......@@ -720,6 +757,7 @@ export const Icons = [
"share-square",
"shekel-sign",
"shield-alt",
"shield-virus",
"ship",
"shipping-fast",
"shoe-prints",
......@@ -755,6 +793,7 @@ export const Icons = [
"snowflake",
"snowman",
"snowplow",
"soap",
"socks",
"solar-panel",
"sort",
......@@ -796,8 +835,11 @@ export const Icons = [
"stop",
"stop-circle",
"stopwatch",
"stopwatch-20",
"store",
"store-alt",
"store-alt-slash",
"store-slash",
"stream",
"street-view",
"strikethrough",
......@@ -858,6 +900,7 @@ export const Icons = [
"toggle-on",
"toilet",
"toilet-paper",
"toilet-paper-slash",
"toolbox",
"tools",
"tooth",
......@@ -933,6 +976,9 @@ export const Icons = [
"video",
"video-slash",
"vihara",
"virus",
"virus-slash",
"viruses",
"voicemail",
"volleyball-ball",
"volume-down",
......@@ -962,5 +1008,5 @@ export const Icons = [
"wrench",
"x-ray",
"yen-sign",
"yin-yang"
"yin-yang",
];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment