Skip to content

Commit 0967358

Browse files
format the credits in orga view (#8780)
This PR add formatting for the displayed credits in the organization page again. ### Issues: - Fixes a regression from #8679 ------ (Please delete unneeded items, merge only when none are left open) - [ ] Added changelog entry (create a `$PR_NUMBER.md` file in `unreleased_changes` or use `./tools/create-changelog-entry.py`) - [ ] Added migration guide entry if applicable (edit the same file as for the changelog) - [ ] Updated [documentation](../blob/master/docs) if applicable - [ ] Adapted [wk-libs python client](https://github.com/scalableminds/webknossos-libs/tree/master/webknossos/webknossos/client) if relevant API parts change - [ ] Removed dev-only changes like prints and application.conf edits - [ ] Considered [common edge cases](../blob/master/.github/common_edge_cases.md) - [ ] Needs datastore update after deployment --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 76e3882 commit 0967358

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

frontend/javascripts/admin/account/account_auth_token_view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function AccountAuthTokenView() {
8686
<div>
8787
<SettingsTitle
8888
title="API Authorization"
89-
description="Access the WEBKNOSSO Python API with your API token"
89+
description="Access the WEBKNOSSOS Python API with your API token"
9090
/>
9191
<Spin size="large" spinning={isLoading}>
9292
<Row gutter={[24, 24]} style={{ marginBottom: 24 }}>

frontend/javascripts/admin/organization/organization_overview_view.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { PlusOutlined } from "@ant-design/icons";
22
import { SettingsTitle } from "admin/account/helpers/settings_title";
33
import { getPricingPlanStatus, getUsers, updateOrganization } from "admin/rest_api";
44
import { Button, Col, Row, Spin, Tooltip, Typography } from "antd";
5-
import { formatCountToDataAmountUnit } from "libs/format_utils";
5+
import { formatCountToDataAmountUnit, formatCreditsString } from "libs/format_utils";
66
import Toast from "libs/toast";
77
import { useEffect, useState } from "react";
88
import type { APIOrganization, APIPricingPlanStatus } from "types/api_types";
@@ -159,7 +159,10 @@ export function OrganizationOverviewView({ organization }: { organization: APIOr
159159
{
160160
key: "credits",
161161
title: "WEBKNOSSOS Credits",
162-
value: organization.creditBalance || "N/A",
162+
value:
163+
organization.creditBalance != null
164+
? formatCreditsString(organization.creditBalance)
165+
: "N/A",
163166
action: buyMoreCreditsAction,
164167
},
165168
];

0 commit comments

Comments
 (0)