@uplab/vendure-plugin-exchange-rates 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @uplab/vendure-plugin-exchange-rates
|
|
2
2
|
|
|
3
|
+
## 0.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#43](https://github.com/Uplab/uplab-vendure-plugins/pull/43) [`c1a7435`](https://github.com/Uplab/uplab-vendure-plugins/commit/c1a7435d95b0835a24ee51ff2ff529c5153afc9c) Thanks [@brmk](https://github.com/brmk)! - Keep the grey badges grey on the Vendure 3.8 dashboard. Its Badge no longer has a `secondary` variant and shows such a badge as plain text. That hit the «System change» badge in the change history, and the «Disabled» and «Fetched rate» badges on the exchange-rate pages. They look the same as before on 3.7.
|
|
8
|
+
|
|
9
|
+
- [#43](https://github.com/Uplab/uplab-vendure-plugins/pull/43) [`c7d7775`](https://github.com/Uplab/uplab-vendure-plugins/commit/c7d777541307cf7be3a80b07f9e3438e9c03c2f1) Thanks [@brmk](https://github.com/brmk)! - Install alongside Vendure 3.8: the `@nestjs/common` and `@nestjs/core` peers now accept `^11 || ^12`, and `@nestjs/graphql` accepts `^13 || ^14`. Vendure 3.8 moved to NestJS 12, so `npm install` failed with `ERESOLVE` against the old `^11` / `^13` ranges. Nothing changes on Vendure 3.7.
|
|
10
|
+
|
|
3
11
|
## 0.1.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Trans, useLingui } from '@lingui/react/macro';
|
|
2
2
|
import {
|
|
3
|
-
Badge,
|
|
4
3
|
Button,
|
|
5
4
|
DashboardRouteDefinition,
|
|
6
5
|
DetailFormGrid,
|
|
@@ -22,6 +21,7 @@ import {
|
|
|
22
21
|
import { useMemo } from 'react';
|
|
23
22
|
import { formatRate } from '../format-rate';
|
|
24
23
|
import { getCurrencyExchangeRateDetailDocument, updateCurrencyExchangeRateDocument } from '../graphql';
|
|
24
|
+
import { StateBadge } from '../state-badge';
|
|
25
25
|
|
|
26
26
|
const pageId = 'currency-exchange-rate-detail';
|
|
27
27
|
|
|
@@ -122,9 +122,7 @@ function CurrencyExchangeRateDetailPage({ route }: { route: Route }) {
|
|
|
122
122
|
<Trans>Status</Trans>
|
|
123
123
|
</dt>
|
|
124
124
|
<dd>
|
|
125
|
-
<
|
|
126
|
-
{entity?.enabled ? t`Enabled` : t`Disabled`}
|
|
127
|
-
</Badge>
|
|
125
|
+
<StateBadge on={!!entity?.enabled}>{entity?.enabled ? t`Enabled` : t`Disabled`}</StateBadge>
|
|
128
126
|
</dd>
|
|
129
127
|
</div>
|
|
130
128
|
<div className="flex flex-col">
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Trans, useLingui } from '@lingui/react/macro';
|
|
2
|
-
import {
|
|
2
|
+
import { DashboardRouteDefinition, DetailPageButton, ListPage, useLocalFormat } from '@vendure/dashboard';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { formatRate } from '../format-rate';
|
|
5
5
|
import { getCurrencyExchangeRateListDocument } from '../graphql';
|
|
6
|
+
import { StateBadge } from '../state-badge';
|
|
6
7
|
|
|
7
8
|
const pageId = 'currency-exchange-rate-list';
|
|
8
9
|
|
|
@@ -83,17 +84,15 @@ function CurrencyExchangeRateListPage({ route }: { route: Parameters<DashboardRo
|
|
|
83
84
|
},
|
|
84
85
|
enabled: {
|
|
85
86
|
cell: ({ row }) => (
|
|
86
|
-
<
|
|
87
|
-
{row.original.enabled ? t`Enabled` : t`Disabled`}
|
|
88
|
-
</Badge>
|
|
87
|
+
<StateBadge on={row.original.enabled}>{row.original.enabled ? t`Enabled` : t`Disabled`}</StateBadge>
|
|
89
88
|
),
|
|
90
89
|
},
|
|
91
90
|
useCustomRate: {
|
|
92
91
|
header: () => <Trans>Custom rate</Trans>,
|
|
93
92
|
cell: ({ row }) => (
|
|
94
|
-
<
|
|
93
|
+
<StateBadge on={row.original.useCustomRate}>
|
|
95
94
|
{row.original.useCustomRate ? t`Using custom rate` : t`Fetched rate`}
|
|
96
|
-
</
|
|
95
|
+
</StateBadge>
|
|
97
96
|
),
|
|
98
97
|
},
|
|
99
98
|
updatedAt: {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Badge } from '@vendure/dashboard';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The look of the dashboard's `secondary` badge, on `outline`: Vendure 3.8's Badge no longer has `secondary`
|
|
6
|
+
* (it renders an unknown variant unstyled), while `outline` and these colours exist on 3.7 and 3.8 alike.
|
|
7
|
+
*/
|
|
8
|
+
const OFF_BADGE = 'border-transparent bg-secondary text-secondary-foreground';
|
|
9
|
+
|
|
10
|
+
/** A yes/no state: green while on, grey while off. */
|
|
11
|
+
export function StateBadge({ on, children }: { on: boolean; children: ReactNode }) {
|
|
12
|
+
return on ? (
|
|
13
|
+
<Badge variant="success">{children}</Badge>
|
|
14
|
+
) : (
|
|
15
|
+
<Badge variant="outline" className={OFF_BADGE}>
|
|
16
|
+
{children}
|
|
17
|
+
</Badge>
|
|
18
|
+
);
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uplab/vendure-plugin-exchange-rates",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Exchange rates for Vendure in any base currency, from the ECB, Frankfurter, Monobank, the NBU or your own source, overridable per currency in the dashboard",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Uplab",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@lingui/react": "^5.0.0",
|
|
57
|
-
"@nestjs/common": "^11.0.0",
|
|
58
|
-
"@nestjs/core": "^11.0.0",
|
|
59
|
-
"@nestjs/graphql": "^13.0.0",
|
|
57
|
+
"@nestjs/common": "^11.0.0 || ^12.0.0",
|
|
58
|
+
"@nestjs/core": "^11.0.0 || ^12.0.0",
|
|
59
|
+
"@nestjs/graphql": "^13.0.0 || ^14.0.0",
|
|
60
60
|
"@vendure/core": "^3.7.0",
|
|
61
61
|
"@vendure/dashboard": "^3.7.0",
|
|
62
62
|
"react": "^19.0.0",
|
|
@@ -75,16 +75,16 @@
|
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@lingui/react": "^5.9.5",
|
|
78
|
-
"@nestjs/common": "^
|
|
79
|
-
"@nestjs/core": "^
|
|
80
|
-
"@nestjs/graphql": "^
|
|
78
|
+
"@nestjs/common": "^12.1.3",
|
|
79
|
+
"@nestjs/core": "^12.1.3",
|
|
80
|
+
"@nestjs/graphql": "^14.0.3",
|
|
81
81
|
"@testing-library/dom": "^10.4.2",
|
|
82
82
|
"@testing-library/react": "^16.3.3",
|
|
83
83
|
"@types/react": "19.3.0",
|
|
84
84
|
"@types/react-dom": "19.2.4",
|
|
85
|
-
"@vendure/core": "3.
|
|
86
|
-
"@vendure/dashboard": "3.
|
|
87
|
-
"@vendure/testing": "3.
|
|
85
|
+
"@vendure/core": "3.8.0",
|
|
86
|
+
"@vendure/dashboard": "3.8.0",
|
|
87
|
+
"@vendure/testing": "3.8.0",
|
|
88
88
|
"graphql": "^16.11.0",
|
|
89
89
|
"jsdom": "^26.1.0",
|
|
90
90
|
"react": "^19.3.0",
|