Skip to content

Feat/overwrite currency#176

Open
AftAb-25 wants to merge 4 commits into
opencost:mainfrom
AftAb-25:feat/overwrite-currency
Open

Feat/overwrite currency#176
AftAb-25 wants to merge 4 commits into
opencost:mainfrom
AftAb-25:feat/overwrite-currency

Conversation

@AftAb-25
Copy link
Copy Markdown

@AftAb-25 AftAb-25 commented Jan 29, 2026

Fixes #3

What does this PR change?

  • This PR lets you change the default currency from USD ($) to something else, like Euro (€).

*You just need to set the DEFAULT_CURRENCY environment variable when running the app. If you don't set it, it stays as USD.

How will this PR impact users?

  • Users who want to see costs in their local currency (like Euros, Pounds, or Yen) can now do so simply by adding one line to their configuration (DEFAULT_CURRENCY=EUR).

*They no longer have to mentally convert USD prices or modify the source code themselves.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 29, 2026

Deploy Preview for opencost-ui ready!

Name Link
🔨 Latest commit 3204cbd
🔍 Latest deploy log https://app.netlify.com/projects/opencost-ui/deploys/6999e2575dee790008a37f68
😎 Deploy Preview https://deploy-preview-176--opencost-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Member

@ameijer ameijer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AftAb-25 can you reduce the changeset to just the currency changes so we can have a more focused look?

@AftAb-25 AftAb-25 force-pushed the feat/overwrite-currency branch from 8a6577d to 0b7a673 Compare February 20, 2026 04:57
@AftAb-25
Copy link
Copy Markdown
Author

@ameijer I reduced the changes please review it Thank you for your time...

Comment thread src/pages/Assets.js Outdated
@@ -0,0 +1,46 @@
import React, { useEffect, useState } from "react";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this assets page

Comment thread src/components/AssetReport.js Outdated
@@ -0,0 +1,50 @@
import React from "react";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

Comment thread src/components/Nav/SidebarNav.js Outdated
href: "/allocation",
icon: <BarChart />,
},
{ name: "Assets", href: "/assets", icon: <Storage /> },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

AftAb-25 added a commit to AftAb-25/opencost-ui that referenced this pull request Feb 21, 2026
Per maintainer review feedback on PR opencost#176:
- Remove src/pages/Assets.js
- Remove src/components/AssetReport.js
- Remove src/services/assets.js and assets.mock.js
- Remove Assets nav item from SidebarNav.js
- Remove /assets route from route.js

Keeping only the DEFAULT_CURRENCY feature changes in util.js
and docker-entrypoint.sh as requested.
This commit implements the Assets view to visualize data from the /assets API. It includes:
- New Assets page and route
- AssetService with mock data fallback
- AssetReport component
- Navigation updates

Fixes opencost#28

Signed-off-by: AftAb-25 <aftab123215@gmail.com>
Signed-off-by: aftab <aftab123215@gmail.com>
This change allows users to configure the default currency using the DEFAULT_CURRENCY environment variable, overriding the hardcoded 'USD'.

Signed-off-by: aftab <aftab123215@gmail.com>
Per maintainer review feedback on PR opencost#176:
- Remove src/pages/Assets.js
- Remove src/components/AssetReport.js
- Remove src/services/assets.js and assets.mock.js
- Remove Assets nav item from SidebarNav.js
- Remove /assets route from route.js

Keeping only the DEFAULT_CURRENCY feature changes in util.js
and docker-entrypoint.sh as requested.

Signed-off-by: aftab <aftab123215@gmail.com>
@AftAb-25 AftAb-25 force-pushed the feat/overwrite-currency branch from 2bdbc5c to 3204cbd Compare February 21, 2026 16:50
@AftAb-25
Copy link
Copy Markdown
Author

@ameijer thank you for the feedback! I have reduced the changeset to focus exclusively on the DEFAULT_CURRENCY feature. I removed all the Assets-specific files, routes, and navigation items. I also fixed the DCO issues in my commits. Please let me know if there’s anything else!

@ameijer
Copy link
Copy Markdown
Member

ameijer commented Apr 16, 2026

@AftAb-25 we have updated our UI to a new 2.0 version! can you check out demo.infra.opencost.io and see if your changes can be ported over?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat Request: Overwrite default currency

2 participants