Commit 0b508144 authored by Nicolas Pernoud's avatar Nicolas Pernoud
Browse files

fix: code smells

parent b29b803c
Pipeline #6146 passed with stages
in 2 minutes and 49 seconds
...@@ -17,7 +17,7 @@ func (u user) String() string { ...@@ -17,7 +17,7 @@ func (u user) String() string {
return fmt.Sprintf("Login: %v, Password: %v", u.Login, u.Password) return fmt.Sprintf("Login: %v, Password: %v", u.Login, u.Password)
} }
func Test_manager_CreateToken_unStoreData(t *testing.T) { func TestManagerCreateTokenUnStoreData(t *testing.T) {
key, _ := common.GenerateRandomBytes(32) key, _ := common.GenerateRandomBytes(32)
key2, _ := common.GenerateRandomBytes(32) key2, _ := common.GenerateRandomBytes(32)
type fields struct { type fields struct {
......
...@@ -82,9 +82,9 @@ export class Explorer { ...@@ -82,9 +82,9 @@ export class Explorer {
await this.navigate("/"); await this.navigate("/");
} }
async navigate(path) { async navigate(destPath) {
if (!path.endsWith("/")) path += "/"; if (!destPath.endsWith("/")) destPath += "/";
this.path = path; this.path = destPath;
this.progress.classList.remove("is-hidden"); this.progress.classList.remove("is-hidden");
try { try {
const response = await fetch(this.fullHostname + this.path, { const response = await fetch(this.fullHostname + this.path, {
...@@ -577,11 +577,11 @@ function parseWebDavResponse(txt) { ...@@ -577,11 +577,11 @@ function parseWebDavResponse(txt) {
return files.sort(fileSortFunction); return files.sort(fileSortFunction);
} }
function goUp(path) { function goUp(destPath) {
if (path === "/") return path; if (destPath === "/") return destPath;
if (path.endsWith("/")) path = path.substring(0, path.length - 1); if (destPath.endsWith("/")) destPath = destPath.substring(0, destPath.length - 1);
const lastSlashPosition = path.lastIndexOf("/"); const lastSlashPosition = destPath.lastIndexOf("/");
return lastSlashPosition === 0 ? "/" : path.substring(0, lastSlashPosition + 1); return lastSlashPosition === 0 ? "/" : destPath.substring(0, lastSlashPosition + 1);
} }
function sizeToHuman(size) { function sizeToHuman(size) {
...@@ -625,6 +625,6 @@ export async function LoadImage(image, url, user) { ...@@ -625,6 +625,6 @@ export async function LoadImage(image, url, user) {
} }
} }
function path(path, name) { function path(destPath, name) {
return path + encodeURIComponent(name); return destPath + encodeURIComponent(name);
} }
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" class="has-navbar-fixed-top"> <html lang="en" class="has-navbar-fixed-top">
<title>Vestibule</title> <head>
<meta charset="UTF-8" /> <title>Vestibule</title>
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta charset="UTF-8" />
<link rel="icon" href="assets/brand/icons/icon-152x152.png" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="manifest" href="assets/brand/manifest.json" /> <link rel="icon" href="assets/brand/icons/icon-152x152.png" />
<link rel="stylesheet" href="assets/bulma.min.css" /> <link rel="manifest" href="assets/brand/manifest.json" />
<link rel="stylesheet" href="assets/animate.css" /> <link rel="stylesheet" href="assets/bulma.min.css" />
<style> <link rel="stylesheet" href="assets/animate.css" />
:root { <style>
--animate-duration: 0.25s; :root {
} --animate-duration: 0.25s;
</style> }
<script defer src="assets/fontawesome/solid.min.js"></script> </style>
<script defer src="assets/fontawesome/fontawesome.min.js"></script> <script defer src="assets/fontawesome/solid.min.js"></script>
<script defer type="module" src="main.js"></script> <script defer src="assets/fontawesome/fontawesome.min.js"></script>
<script defer type="module" src="main.js"></script>
</head>
<body> <body>
<!-- Navbar --> <!-- Navbar -->
<nav id="navbar" class="navbar is-fixed-top" role="navigation" aria-label="main navigation"></nav> <nav id="navbar" class="navbar is-fixed-top" role="navigation" aria-label="main navigation"></nav>
......
Supports Markdown
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