Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
333 changes: 188 additions & 145 deletions __tests__/components/waves/create-wave/services/multiPartUpload.test.ts

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion components/drop-forge/claimTraitsData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,24 @@ const ATTRIBUTE_TRAIT_KEYS = (
Object.keys(getInitialTraitsValues()) as (keyof TraitsData)[]
).filter((k) => k !== "title" && k !== "description");

export function stringifyClaimAttributeValue(value: unknown): string {
if (
typeof value === "string" ||
typeof value === "number" ||
typeof value === "boolean"
) {
return String(value);
}
return "";
}

export function getClaimSeason(claim: MintingClaim): string {
const attr = (claim.attributes ?? []).find(
(a) => a.trait_type?.trim().toLowerCase() === "type - season"
);
if (attr?.value != null) return String(attr.value).trim();

if (attr?.value != null)
return stringifyClaimAttributeValue(attr.value).trim();
return "";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import DropForgeLaunchIcon from "@/components/common/icons/DropForgeLaunchIcon";
import CircleLoader, {
CircleLoaderSize,
} from "@/components/distribution-plan-tool/common/CircleLoader";
import { getClaimSeason } from "@/components/drop-forge/claimTraitsData";
import {
getClaimSeason,
stringifyClaimAttributeValue,
} from "@/components/drop-forge/claimTraitsData";
import {
type ClaimPrimaryStatus,
getClaimArweaveSectionStatus,
Expand Down Expand Up @@ -801,18 +804,19 @@ function DropForgeLaunchClaimTraitsSection({
>
{claim.attributes?.length ? (
<div className="tw-grid tw-grid-cols-1 tw-gap-x-4 tw-gap-y-6 sm:tw-grid-cols-2 lg:tw-grid-cols-3 xl:tw-grid-cols-4">
{claim.attributes.map((attribute, index) => (
<DropForgeFieldBox
key={`${attribute.trait_type ?? "trait"}-${index}`}
label={attribute.trait_type || "Trait"}
>
{attribute.value !== null &&
attribute.value !== undefined &&
String(attribute.value).trim()
? String(attribute.value)
: "—"}
</DropForgeFieldBox>
))}
{claim.attributes.map((attribute, index) => {
const attributeValue = stringifyClaimAttributeValue(
attribute.value
).trim();
return (
<DropForgeFieldBox
key={`${attribute.trait_type ?? "trait"}-${index}`}
label={attribute.trait_type || "Trait"}
>
{attributeValue || "—"}
</DropForgeFieldBox>
);
})}
</div>
) : (
<p className="tw-mb-0 tw-text-sm tw-text-iron-400">No traits found.</p>
Expand Down
29 changes: 15 additions & 14 deletions components/waves/create-wave/voting/CreateWaveVoting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const VOTING_TYPES_ORDER: Record<ApiWaveCreditType, number | undefined> = {
[ApiWaveCreditType.Tdh]: 1,
[ApiWaveCreditType.Rep]: 2,
[ApiWaveCreditType.Xtdh]: undefined,
[ApiWaveCreditType.CardSetTdh]: undefined,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
};

export default function CreateWaveVoting({
Expand Down Expand Up @@ -58,22 +59,22 @@ export default function CreateWaveVoting({

return (
<div>
<p className="tw-mb-0 tw-text-lg sm:tw-text-xl tw-font-semibold tw-text-iron-50">
<p className="tw-mb-0 tw-text-lg tw-font-semibold tw-text-iron-50 sm:tw-text-xl">
{TITLES[waveType]}
</p>
<div className="tw-mt-3 tw-grid lg:tw-grid-cols-3 tw-gap-x-4 tw-gap-y-4">
{(
Object.keys(VOTING_TYPES_ORDER) as ApiWaveCreditType[]
).filter((votingType) => VOTING_TYPES_ORDER[votingType] !== undefined).map((votingType) => (
<CommonBorderedRadioButton
key={votingType}
type={votingType}
selected={selectedType}
disabled={false}
label={`By ${WAVE_VOTING_LABELS[votingType]}`}
onChange={onTypeChange}
/>
))}
<div className="tw-mt-3 tw-grid tw-gap-x-4 tw-gap-y-4 lg:tw-grid-cols-3">
{(Object.keys(VOTING_TYPES_ORDER) as ApiWaveCreditType[])
.filter((votingType) => VOTING_TYPES_ORDER[votingType] !== undefined)
.map((votingType) => (
<CommonBorderedRadioButton
key={votingType}
type={votingType}
selected={selectedType}
disabled={false}
label={`By ${WAVE_VOTING_LABELS[votingType]}`}
onChange={onTypeChange}
/>
))}
{selectedType === ApiWaveCreditType.Rep && (
<div className="tw-col-span-full">
<CreateWaveVotingRep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export const buildPreviewDrop = ({
pinned: wave.pinned,
identity_wave: wave.identity_wave,
submission_type: wave.participation.submission_strategy?.type ?? null,
voting_credit_nfts: wave.voting.credit_nfts,
},
author: {
id: connectedProfile?.id ?? "preview-user",
Expand Down
1 change: 1 addition & 0 deletions components/waves/specs/WaveRating.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const CREDIT_TYPE_LABELS: Record<ApiWaveCreditType, string> = {
[ApiWaveCreditType.Xtdh]: "XTDH",
[ApiWaveCreditType.TdhPlusXtdh]: "TDH + XTDH",
[ApiWaveCreditType.Rep]: "REP",
[ApiWaveCreditType.CardSetTdh]: "Card Set TDH",
};

interface WaveRatingProps {
Expand Down
1 change: 1 addition & 0 deletions components/waves/utils/getOptimisticDrop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const getOptimisticDrop = (
forbid_negative_votes: wave.voting.forbid_negative_votes,
submission_type: wave.participation.submission_strategy?.type ?? null,
identity_wave: wave.identity_wave,
voting_credit_nfts: wave.voting.credit_nfts,
},
author: {
id: connectedProfile.id,
Expand Down
3 changes: 1 addition & 2 deletions generated/models/AcceptActionRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export class AcceptActionRequest {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "action",
Expand All @@ -36,6 +34,7 @@ export class AcceptActionRequest {
}
}


export enum AcceptActionRequestActionEnum {
Accept = 'ACCEPT',
Reject = 'REJECT',
Expand Down
3 changes: 1 addition & 2 deletions generated/models/AddActionToProxyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export class AddActionToProxyRequest {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "action_type",
Expand Down Expand Up @@ -57,3 +55,4 @@ export class AddActionToProxyRequest {
}



3 changes: 1 addition & 2 deletions generated/models/AirdropAddressResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export class AirdropAddressResponse {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "tdh_wallet",
Expand All @@ -43,3 +41,4 @@ export class AirdropAddressResponse {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/AirdropAddressResponseTdhWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export class AirdropAddressResponseTdhWallet {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "address",
Expand All @@ -42,3 +40,4 @@ export class AirdropAddressResponseTdhWallet {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/AllowlistNormalizedEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ export class AllowlistNormalizedEntry {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "phase",
Expand Down Expand Up @@ -56,3 +54,4 @@ export class AllowlistNormalizedEntry {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiAddReactionToDropRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export class ApiAddReactionToDropRequest {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "reaction",
Expand All @@ -35,3 +33,4 @@ export class ApiAddReactionToDropRequest {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiAggregatedActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ export class ApiAggregatedActivity {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "consolidation_key",
Expand Down Expand Up @@ -399,3 +397,4 @@ export class ApiAggregatedActivity {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiAggregatedActivityMemes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export class ApiAggregatedActivityMemes {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "consolidation_key",
Expand Down Expand Up @@ -126,3 +124,4 @@ export class ApiAggregatedActivityMemes {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiAggregatedActivityPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ export class ApiAggregatedActivityPage {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "data",
Expand Down Expand Up @@ -57,3 +55,4 @@ export class ApiAggregatedActivityPage {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiArtistNameItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export class ApiArtistNameItem {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "name",
Expand All @@ -42,3 +40,4 @@ export class ApiArtistNameItem {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiAvailableRatingCredit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export class ApiAvailableRatingCredit {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "cic_credit",
Expand All @@ -42,3 +40,4 @@ export class ApiAvailableRatingCredit {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiBlockItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export class ApiBlockItem {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "block_number",
Expand Down Expand Up @@ -49,3 +47,4 @@ export class ApiBlockItem {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiBlocksPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ export class ApiBlocksPage {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "data",
Expand Down Expand Up @@ -57,3 +55,4 @@ export class ApiBlocksPage {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiBulkRateRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export class ApiBulkRateRequest {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "matter",
Expand Down Expand Up @@ -62,3 +60,4 @@ export class ApiBulkRateRequest {
}



3 changes: 1 addition & 2 deletions generated/models/ApiBulkRateResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export class ApiBulkRateResponse {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "skipped",
Expand All @@ -36,3 +34,4 @@ export class ApiBulkRateResponse {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiBulkRateSkippedIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export class ApiBulkRateSkippedIdentity {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "identity",
Expand All @@ -42,3 +40,4 @@ export class ApiBulkRateSkippedIdentity {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiBulkRepRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export class ApiBulkRepRequest {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "targets",
Expand All @@ -36,3 +34,4 @@ export class ApiBulkRepRequest {
public constructor() {
}
}

3 changes: 1 addition & 2 deletions generated/models/ApiBulkRepTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export class ApiBulkRepTarget {

static readonly discriminator: string | undefined = undefined;

static readonly mapping: {[index: string]: string} | undefined = undefined;

static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
{
"name": "address",
Expand Down Expand Up @@ -49,3 +47,4 @@ export class ApiBulkRepTarget {
public constructor() {
}
}

Loading
Loading