Story/nxtgen#3
Conversation
Signed-off-by: AsamaSumer <sumer@asama.ai>
Signed-off-by: AsamaSumer <sumer@asama.ai>
WalkthroughThe changes update URLs in both an HTML template and a JavaScript file, replacing all occurrences of "https://console.asama.cloud" with "https://nxtgen.asama.cloud". No other logic, structure, or control flow has been altered in either file. Changes
Poem
✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
web/templates/approval.html (1)
42-46: Avoid hard-coding absolute origins; derive the host from config orwindow.locationThe new hard-coded
"https://nxtgen.asama.cloud"will break in non-prod environments (staging, localhost) and requires code edits for each host change. Prefer:- <a href="https://nxtgen.asama.cloud" > + <a href="{{ .BaseURL }}" >or compute the origin client-side:
<a href="/" >This keeps templates portable across environments and reduces maintenance overhead.
web/templates/password.html (1)
33-34: ParameteriseBASE_URLinstead of embedding a literalHard-coding the origin ties the JS to a single deployment. Consider injecting it from the server (template variable) or falling back to
window.location.origin:- const BASE_URL = 'https://nxtgen.asama.cloud'; + const BASE_URL = '{{ .BaseURL | default window.location.origin }}';This eliminates future search-and-replace tasks and keeps dev/stage environments functional.
| window.location.href = `https://nxtgen.asama.cloud`; | ||
| } catch (error) { |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Reuse the existing BASE_URL constant to avoid string drift
You already define BASE_URL; re-use it here to stay DRY and prevent accidental divergence:
- window.location.href = `https://nxtgen.asama.cloud`;
+ window.location.href = BASE_URL;If you adopt the earlier suggestion to parameterise BASE_URL, this line will automatically respect whatever environment you’re running in.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| window.location.href = `https://nxtgen.asama.cloud`; | |
| } catch (error) { | |
| window.location.href = BASE_URL; | |
| } catch (error) { |
🤖 Prompt for AI Agents
In web/templates/password.html around lines 107 to 108, replace the hardcoded
URL string with the existing BASE_URL constant to avoid duplication and ensure
consistency. Use the BASE_URL variable in the assignment to window.location.href
so that the URL dynamically reflects the configured environment and prevents
string drift.
Master sync
Overview
What this PR does / why we need it
Special notes for your reviewer
Summary by CodeRabbit