Skip to content

Commit 9c2af2f

Browse files
authored
(fix) Remove non-functional view links from stock metrics cards (#296)
Removes the `View ->` links from the metrics cards on the stock management dashboard. These links don't currently navigate anywhere. Removing them clears up potential confusion for users.
1 parent e463006 commit 9c2af2f

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed

src/core/components/card/metrics-card-component.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ import React from 'react';
22
import dayjs from 'dayjs';
33
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
44
import { useTranslation } from 'react-i18next';
5-
import { ArrowRight } from '@carbon/react/icons';
65
import { isEmpty } from 'lodash-es';
76
import { Tile } from '@carbon/react';
8-
import { ConfigurableLink } from '@openmrs/esm-framework';
97
import styles from './metrics-card.scss';
108

119
dayjs.extend(isSameOrBefore);
@@ -15,7 +13,6 @@ interface MetricsCardProps {
1513
value: number;
1614
headerLabel: string;
1715
children?: React.ReactNode;
18-
view: string;
1916
count?: { expiry6months: Array<any> };
2017
outOfStockCount?: { itemsBelowMin: Array<any>; itemsAboveMax: Array<any> };
2118
disposedCount?: { expired: Array<any>; poorQuality: Array<any> };
@@ -25,7 +22,6 @@ const MetricsCard: React.FC<MetricsCardProps> = ({
2522
value,
2623
headerLabel,
2724
children,
28-
view,
2925
count,
3026
outOfStockCount,
3127
disposedCount,
@@ -39,12 +35,6 @@ const MetricsCard: React.FC<MetricsCardProps> = ({
3935
<label className={styles.headerLabel}>{headerLabel}</label>
4036
{children}
4137
</div>
42-
{view && (
43-
<ConfigurableLink className={styles.link} to={`\${openmrsSpaBase}/stock-management/orders`}>
44-
<span>{t('view', 'View')}</span>
45-
<ArrowRight size={16} />
46-
</ConfigurableLink>
47-
)}
4838
</div>
4939
<div className={styles.metricsGrid}>
5040
<div>

src/stock-home/stock-home-metrics.component.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ const StockManagementMetrics: React.FC = (filter: StockOperationFilter) => {
5656
headerLabel={t('expiringStock', 'Expiring stock')}
5757
label={t('expiringStock', 'Expiring stock')}
5858
value={filteredData?.length || 0}
59-
view="items"
6059
/>
6160
<MetricsCard
6261
label={t('outOfStock', 'Out of stock')}
@@ -66,7 +65,6 @@ const StockManagementMetrics: React.FC = (filter: StockOperationFilter) => {
6665
itemsAboveMax: [],
6766
}}
6867
value={allStocks?.length}
69-
view="items"
7068
/>
7169
<MetricsCard
7270
disposedCount={{
@@ -76,7 +74,6 @@ const StockManagementMetrics: React.FC = (filter: StockOperationFilter) => {
7674
headerLabel={t('disposedStock', 'Disposed stock')}
7775
label={t('disposedStock', 'Disposed stock')}
7876
value={items?.length || 0}
79-
view="items"
8077
/>
8178
</div>
8279
);

translations/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@
339339
"updatePackingUnitTitle": "Package Unit",
340340
"uploadStockItems": "Upload stock items",
341341
"user": "User",
342-
"view": "View",
343342
"viewAll": "View All",
344343
"whoIsThePreferredVendor": "Who is the preferred vendor?",
345344
"yes": "Yes"

0 commit comments

Comments
 (0)