mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 19:21:36 +00:00
refactor: use Laravel route() helper for shared variable URLs
- Replace hardcoded URL paths in getScopeUrl() with Laravel's route() helper - Add scopeUrls property to EnvVarInput component with named routes - Pass projectUuid and environmentUuid to enable context-specific environment links - Environment scope link now navigates to the specific project/environment shared variables page 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
currentScope: null,
|
||||
availableScopes: ['team', 'project', 'environment'],
|
||||
availableVars: @js($availableVars),
|
||||
scopeUrls: @js($scopeUrls),
|
||||
|
||||
isAutocompleteDisabled() {
|
||||
const hasAnyVars = Object.values(this.availableVars).some(vars => vars.length > 0);
|
||||
@@ -28,13 +29,14 @@
|
||||
const input = this.$refs.input;
|
||||
if (!input) return;
|
||||
|
||||
const value = input.value || '';
|
||||
|
||||
if (this.isAutocompleteDisabled()) {
|
||||
this.showDropdown = false;
|
||||
return;
|
||||
}
|
||||
|
||||
this.cursorPosition = input.selectionStart || 0;
|
||||
const value = input.value || '';
|
||||
const textBeforeCursor = value.substring(0, this.cursorPosition);
|
||||
|
||||
const openBraces = '{' + '{';
|
||||
@@ -107,14 +109,7 @@
|
||||
},
|
||||
|
||||
getScopeUrl(scope) {
|
||||
if (scope === 'team') {
|
||||
return '/shared-variables/team';
|
||||
} else if (scope === 'project') {
|
||||
return '/shared-variables/projects';
|
||||
} else if (scope === 'environment') {
|
||||
return '/shared-variables/environments';
|
||||
}
|
||||
return '/shared-variables';
|
||||
return this.scopeUrls[scope] || this.scopeUrls['default'];
|
||||
},
|
||||
|
||||
selectSuggestion(suggestion) {
|
||||
|
||||
Reference in New Issue
Block a user