Skip to content

Commit

Permalink
fix: merge 0.0.257.1 hotfixes in main (#767)
Browse files Browse the repository at this point in the history
* feat: allow creating a 0 price offer (#763)

* feat: allow to promote a seller in the carousel on the landing page (#762)

* local reference to reusable workflow - see https://github.blog/changelog/2022-01-25-github-actions-reusable-workflows-can-be-referenced-locally/

* add missing new secret in reusable workflow
  • Loading branch information
levalleux-ludo authored Aug 8, 2023
1 parent 460688c commit 8c75ef3
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ REACT_APP_RELEASE_NAME=

REACT_APP_WALLET_CONNECT_PROJECT_ID=

REACT_APP_CAROUSEL_PROMOTED_SELLER_ID=

REACT_APP_VIEW_MODE=dapp
# REACT_APP_VIEW_MODE=dr_center
# REACT_APP_VIEW_MODE=dapp,dr_center
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
id: name

call-reusable-workflow-PR:
uses: bosonprotocol/interface/.github/workflows/ci_reusable.yaml@main
uses: ./.github/workflows/ci_reusable.yaml
if: github.event_name == 'pull_request'
needs: prejob
with:
Expand All @@ -61,10 +61,11 @@ jobs:
REACT_APP_META_TX_API_KEY: ${{ secrets.REACT_APP_META_TX_API_KEY_TESTING }}
REACT_APP_META_TX_API_IDS: ${{ secrets.REACT_APP_META_TX_API_IDS_TESTING }}
REACT_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID_TESTING }}
REACT_APP_CAROUSEL_PROMOTED_SELLER_ID: ${{ secrets.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_TESTING }}
REACT_APP_FAIR_EXCHANGE_POLICY_RULES: ${{ secrets.REACT_APP_FAIR_EXCHANGE_POLICY_RULES_TESTING }}

call-reusable-workflow-testing:
uses: bosonprotocol/interface/.github/workflows/ci_reusable.yaml@main
uses: ./.github/workflows/ci_reusable.yaml
if: github.event_name == 'push'
needs: prejob
with:
Expand Down Expand Up @@ -96,10 +97,11 @@ jobs:
REACT_APP_META_TX_API_KEY: ${{ secrets.REACT_APP_META_TX_API_KEY_TESTING }}
REACT_APP_META_TX_API_IDS: ${{ secrets.REACT_APP_META_TX_API_IDS_TESTING }}
REACT_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID_TESTING }}
REACT_APP_CAROUSEL_PROMOTED_SELLER_ID: ${{ secrets.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_TESTING }}
REACT_APP_FAIR_EXCHANGE_POLICY_RULES: ${{ secrets.REACT_APP_FAIR_EXCHANGE_POLICY_RULES_TESTING }}

call-reusable-workflow-staging:
uses: bosonprotocol/interface/.github/workflows/ci_reusable.yaml@main
uses: ./.github/workflows/ci_reusable.yaml
if: github.event_name == 'release' && github.event.action == 'created'
needs: prejob
with:
Expand Down Expand Up @@ -131,10 +133,11 @@ jobs:
REACT_APP_META_TX_API_KEY: ${{ secrets.REACT_APP_META_TX_API_KEY_STAGING }}
REACT_APP_META_TX_API_IDS: ${{ secrets.REACT_APP_META_TX_API_IDS_STAGING }}
REACT_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID_STAGING }}
REACT_APP_CAROUSEL_PROMOTED_SELLER_ID: ${{ secrets.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_STAGING }}
REACT_APP_FAIR_EXCHANGE_POLICY_RULES: ${{ secrets.REACT_APP_FAIR_EXCHANGE_POLICY_RULES_STAGING }}

call-reusable-workflow-production:
uses: bosonprotocol/interface/.github/workflows/ci_reusable.yaml@main
uses: ./.github/workflows/ci_reusable.yaml
if: github.event_name == 'workflow_dispatch'
needs: prejob
with:
Expand Down Expand Up @@ -166,6 +169,7 @@ jobs:
REACT_APP_META_TX_API_KEY: ${{ secrets.REACT_APP_META_TX_API_KEY_PRODUCTION }}
REACT_APP_META_TX_API_IDS: ${{ secrets.REACT_APP_META_TX_API_IDS_PRODUCTION }}
REACT_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID_PRODUCTION }}
REACT_APP_CAROUSEL_PROMOTED_SELLER_ID: ${{ secrets.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID_PRODUCTION }}
REACT_APP_FAIR_EXCHANGE_POLICY_RULES: ${{ secrets.REACT_APP_FAIR_EXCHANGE_POLICY_RULES_PRODUCTION }}

job-summary:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci_reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ on:
required: true
REACT_APP_WALLET_CONNECT_PROJECT_ID:
required: true
REACT_APP_CAROUSEL_PROMOTED_SELLER_ID:
required: true
REACT_APP_FAIR_EXCHANGE_POLICY_RULES:
required: true
outputs:
Expand Down Expand Up @@ -111,6 +113,7 @@ jobs:
REACT_APP_DEFAULT_TOKENS_LIST_TESTING: ${{ secrets.REACT_APP_DEFAULT_TOKENS_LIST_TESTING }}
REACT_APP_DEFAULT_TOKENS_LIST_STAGING: ${{ secrets.REACT_APP_DEFAULT_TOKENS_LIST_STAGING }}
REACT_APP_DEFAULT_TOKENS_LIST_PRODUCTION: ${{ secrets.REACT_APP_DEFAULT_TOKENS_LIST_PRODUCTION }}
REACT_APP_CAROUSEL_PROMOTED_SELLER_ID: ${{ secrets.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID }}
REACT_APP_GOOGLE_TAG_ID: ${{ secrets.REACT_APP_GOOGLE_TAG_ID }}
REACT_APP_META_TX_API_KEY: ${{ secrets.REACT_APP_META_TX_API_KEY }}
REACT_APP_META_TX_API_IDS: ${{ secrets.REACT_APP_META_TX_API_IDS }}
Expand Down
7 changes: 4 additions & 3 deletions src/components/product/utils/validationSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ function testPrice(price: number | null | undefined) {
if (!this.parent.currency?.value) {
return true;
}
if (!price || price < 1e-100) {
const _price = price as number;
if (_price === null || isNaN(_price) || (_price > 0 && _price < 1e-100)) {
return false;
}
try {
Expand All @@ -64,7 +65,7 @@ function testPrice(price: number | null | undefined) {
);
const decimals = exchangeToken?.decimals || 18;
const priceWithoutEnotation =
price < 0.1 ? fixformattedString(price) : price.toString();
_price < 0.1 ? fixformattedString(_price) : _price.toString();
parseUnits(priceWithoutEnotation, decimals);
return true;
} catch (error) {
Expand Down Expand Up @@ -300,7 +301,7 @@ export const termsOfExchangeValidationSchema = Yup.object({
}),
sellerDeposit: Yup.string().required(validationMessage.required),
sellerDepositUnit: Yup.object({
value: Yup.string(),
value: Yup.string().required(validationMessage.required),
label: Yup.string()
}),
disputeResolver: Yup.object({
Expand Down
2 changes: 2 additions & 0 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ export const CONFIG = {
walletConnect: {
projectId: process.env.REACT_APP_WALLET_CONNECT_PROJECT_ID || ""
},
carouselPromotedSellerId:
process.env.REACT_APP_CAROUSEL_PROMOTED_SELLER_ID || undefined,
envViewMode: {
current: Object.values(ViewMode).includes(
(process.env.REACT_APP_VIEW_MODE as ViewMode) || ""
Expand Down
4 changes: 4 additions & 0 deletions src/pages/about/AboutPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ function AboutPage() {
{CONFIG.ipfsImageGateway}
</a>
</Text>
<Text margin="0 0 0.5rem 0">
<span>Carousel Promoted SellerId:</span>
<span>{CONFIG.carouselPromotedSellerId || "-"}</span>
</Text>
</Wrapper>
);
}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/landing/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import styled, { css } from "styled-components";

import ProductCard from "../../components/productCard/ProductCard";
import Loading from "../../components/ui/Loading";
import { CONFIG } from "../../lib/config";
import { breakpoint } from "../../lib/styles/breakpoint";
import { zIndex } from "../../lib/styles/zIndex";
import { Offer } from "../../lib/types/offer";
Expand Down Expand Up @@ -198,7 +199,8 @@ export default function Carousel() {
voided: false,
valid: true,
first: numCells,
quantityAvailable_gte: 1
quantityAvailable_gte: 1,
sellerId: CONFIG.carouselPromotedSellerId
});

const uiOffers = useMemo(() => {
Expand Down

0 comments on commit 8c75ef3

Please sign in to comment.