Skip to content

Commit

Permalink
Add correct handling of nova.path values
Browse files Browse the repository at this point in the history
  • Loading branch information
dm-pf committed Mar 2, 2023
1 parent 038ed5a commit 61cfa27
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 19 deletions.
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.vue]
indent_style = space
indent_size = 4

[*.js]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion dist/github.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/githubDark.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/gradient.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/tool.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"/js/tool.js": "/js/tool.js",
"/atomDark.js": "/atomDark.js?id=8e8e9a36d05f057438a5",
"/atom.js": "/atom.js?id=c31a1ac1955d918e9e95",
"/monokai.js": "/monokai.js?id=d7bb0d9d0aa3421604fa",
"/gradientDark.js": "/gradientDark.js?id=f87d1ae84d66987c4ebd",
"/gradient.js": "/gradient.js?id=e9c462f8f4175b882c55",
"/githubDark.js": "/githubDark.js?id=099190303503e8a8787a",
"/github.js": "/github.js?id=b3821e587eab01a8ac70",
"/atomDark.js": "/atomDark.js?id=f56ce784fa5895ba4747",
"/atom.js": "/atom.js?id=60b6e627f812617c190a",
"/monokai.js": "/monokai.js?id=e710c2dd8b4bbca5f350",
"/gradientDark.js": "/gradientDark.js?id=055add45f40b2c8e1538",
"/gradient.js": "/gradient.js?id=31c6a1d136619e153436",
"/githubDark.js": "/githubDark.js?id=8d7a51e52a7816ce08c1",
"/github.js": "/github.js?id=107b829682caf275ed63",
"/css/tool.css": "/css/tool.css"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@vue/compiler-sfc": "^3.2.22",
"cross-env": "^5.0.0",
"laravel-mix": "^6.0.41",
"laravel-mix-purgecss": "^4.2.0",
"laravel-mix-purgecss": "^6.0.0",
"postcss": "^8.3.11",
"sass": "^1.23.1",
"sass-loader": "^12.1.0",
Expand Down
15 changes: 10 additions & 5 deletions resources/js/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,19 @@
},
parseRoute(item) {
const { route, isHome } = item;
const basePath = Nova.config('base');
const urlPrfix = Nova.config('urlPrefix');
const root = `${basePath}/${urlPrfix}`;
const basePath = this.strFinish(Nova.config('base'), '/')
const urlPrefix = Nova.config('urlPrefix');
const root = `${basePath}${urlPrefix}`;
if (isHome) {
return root;
}
return `${root}${route}`;
}
},
strFinish(str, value) {
return str.endsWith(value) ? str : str + value;
},
}
}
</script>
Expand All @@ -49,4 +54,4 @@
.router-link-exact-active.router-link-active {
color: var(--primary);
}
</style>
</style>
2 changes: 1 addition & 1 deletion src/Library/MarkdownUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private function addFilesToPath($path, $directory)
$filePath = '';

for ($i = ($index + 1); $i < (count($pathParts) - 1); $i++) {
$filePath .= $pathParts[$i].'/';
$filePath .= \Str::finish($pathParts[$i], '/');
}

$fullFileName = $pathParts[count($pathParts) - 1];
Expand Down
2 changes: 1 addition & 1 deletion src/ToolServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected function routes()
}

Route::middleware(['nova', Authorize::class])
->prefix(config('nova.path').'/'.$this->prefix)
->prefix(\Str::finish(config('nova.path'), '/').$this->prefix)
->group(__DIR__.'/../routes/inertia.php');
}

Expand Down

0 comments on commit 61cfa27

Please sign in to comment.