-
+
#{String(block.height).padStart(3, "0")}
- {firstTransaction && (
- <>
-
-
-
-
- {transactionName ?? "Unknown"}
-
- >
+
+ {transaction && (
+
+ {transactionName ?? "Unknown"}
+
)}
-
+ {transaction?.status && (
+
+ )}
);
diff --git a/frontend/src/modules/interactions/components/interaction-icon/InteractionIcon.module.scss b/frontend/src/modules/interactions/components/InteractionIcon/InteractionIcon.module.scss
similarity index 100%
rename from frontend/src/modules/interactions/components/interaction-icon/InteractionIcon.module.scss
rename to frontend/src/modules/interactions/components/InteractionIcon/InteractionIcon.module.scss
diff --git a/frontend/src/modules/interactions/components/interaction-icon/InteractionIcon.tsx b/frontend/src/modules/interactions/components/InteractionIcon/InteractionIcon.tsx
similarity index 100%
rename from frontend/src/modules/interactions/components/interaction-icon/InteractionIcon.tsx
rename to frontend/src/modules/interactions/components/InteractionIcon/InteractionIcon.tsx
diff --git a/frontend/src/modules/interactions/components/interaction-label/InteractionLabel.module.scss b/frontend/src/modules/interactions/components/InteractionLabel/InteractionLabel.module.scss
similarity index 100%
rename from frontend/src/modules/interactions/components/interaction-label/InteractionLabel.module.scss
rename to frontend/src/modules/interactions/components/InteractionLabel/InteractionLabel.module.scss
diff --git a/frontend/src/modules/interactions/components/interaction-label/InteractionLabel.tsx b/frontend/src/modules/interactions/components/InteractionLabel/InteractionLabel.tsx
similarity index 94%
rename from frontend/src/modules/interactions/components/interaction-label/InteractionLabel.tsx
rename to frontend/src/modules/interactions/components/InteractionLabel/InteractionLabel.tsx
index 40067766..47e355e6 100644
--- a/frontend/src/modules/interactions/components/interaction-label/InteractionLabel.tsx
+++ b/frontend/src/modules/interactions/components/InteractionLabel/InteractionLabel.tsx
@@ -1,5 +1,5 @@
import React, { ReactElement } from "react";
-import { InteractionIcon } from "../interaction-icon/InteractionIcon";
+import { InteractionIcon } from "../InteractionIcon/InteractionIcon";
import { SizedBox } from "../../../../components/sized-box/SizedBox";
import { CoreInteractionDefinition } from "../../contexts/interaction-registry.context";
import { useGetParsedInteraction } from "../../../../hooks/use-api";
diff --git a/frontend/src/modules/interactions/components/outcome/InteractionOutcome.module.scss b/frontend/src/modules/interactions/components/InteractionOutcome/InteractionOutcome.module.scss
similarity index 100%
rename from frontend/src/modules/interactions/components/outcome/InteractionOutcome.module.scss
rename to frontend/src/modules/interactions/components/InteractionOutcome/InteractionOutcome.module.scss
diff --git a/frontend/src/modules/interactions/components/outcome/InteractionOutcome.tsx b/frontend/src/modules/interactions/components/InteractionOutcome/InteractionOutcome.tsx
similarity index 78%
rename from frontend/src/modules/interactions/components/outcome/InteractionOutcome.tsx
rename to frontend/src/modules/interactions/components/InteractionOutcome/InteractionOutcome.tsx
index f6ea05a9..3b771b0c 100644
--- a/frontend/src/modules/interactions/components/outcome/InteractionOutcome.tsx
+++ b/frontend/src/modules/interactions/components/InteractionOutcome/InteractionOutcome.tsx
@@ -1,10 +1,6 @@
import React, { ReactElement, useEffect, useState } from "react";
import { useInteractionOutcomeManager } from "../../contexts/outcome.context";
-import { TransactionOverview } from "../../../transactions/details/TransactionOverview";
-import {
- ScriptError,
- TransactionError,
-} from "../../../../components/status/ErrorMessage";
+import { ScriptError } from "../../../../components/status/ErrorMessage";
import { JsonView } from "../../../../components/json-view/JsonView";
import { useGetTransaction } from "../../../../hooks/use-api";
import classes from "./InteractionOutcome.module.scss";
@@ -16,10 +12,11 @@ import { TabItem } from "../../../../components/tabs/Tabs";
import { Callout } from "../../../../components/callout/Callout";
import { useInteractionDefinitionManager } from "../../contexts/definition.context";
import { InteractionKind } from "@flowser/shared";
-import { ExternalLink } from "../../../../components/link/ExternalLink";
+import { ExternalLink } from "../../../../components/links/ExternalLink";
import { LineSeparator } from "../../../../components/line-separator/LineSeparator";
import { SpinnerWithLabel } from "../../../../components/spinner/SpinnerWithLabel";
import { StyledTabs } from "../../../../components/tabs/StyledTabs";
+import { TransactionDetailsTabs } from "../../../transactions/TransactionDetailsTabs/TransactionDetailsTabs";
export function InteractionOutcome(): ReactElement {
const { outcome } = useInteractionOutcomeManager();
@@ -103,54 +100,21 @@ function EmptyState() {
function TransactionOutcome(props: { outcome: FlowTransactionOutcome }) {
const { outcome } = props;
const { data } = useGetTransaction(outcome.transactionId);
- const error = outcome.error ?? data?.transaction?.status?.errorMessage;
- const overviewTabId = "overview";
- const errorTabId = "error";
- const [currentTabId, setCurrentTabId] = useState(
- error ? errorTabId : overviewTabId
- );
- useEffect(() => {
- if (error && currentTabId !== errorTabId) {
- setCurrentTabId(errorTabId);
- }
- }, [error]);
+ if (outcome.error) {
+ return
;
+ }
if (!data?.transaction) {
return
;
}
- const tabs: TabItem[] = [];
-
- tabs.push({
- id: overviewTabId,
- label: "Overview",
- content: (
-
- ),
- });
-
- if (error) {
- tabs.push({
- id: errorTabId,
- label: "Error",
- content: data.transaction.status?.errorMessage ? (
-
- ) : (
-
{outcome.error}
- ),
- });
- }
-
return (
-
setCurrentTabId(tab.id)}
- tabs={tabs}
+ includeOverviewTab={true}
+ includeScriptTab={false}
+ transaction={data.transaction}
/>
);
}
diff --git a/frontend/src/modules/interactions/components/templates/InteractionTemplates.module.scss b/frontend/src/modules/interactions/components/InteractionTemplates/InteractionTemplates.module.scss
similarity index 100%
rename from frontend/src/modules/interactions/components/templates/InteractionTemplates.module.scss
rename to frontend/src/modules/interactions/components/InteractionTemplates/InteractionTemplates.module.scss
diff --git a/frontend/src/modules/interactions/components/templates/InteractionTemplates.tsx b/frontend/src/modules/interactions/components/InteractionTemplates/InteractionTemplates.tsx
similarity index 97%
rename from frontend/src/modules/interactions/components/templates/InteractionTemplates.tsx
rename to frontend/src/modules/interactions/components/InteractionTemplates/InteractionTemplates.tsx
index e9998fd5..0f58b484 100644
--- a/frontend/src/modules/interactions/components/templates/InteractionTemplates.tsx
+++ b/frontend/src/modules/interactions/components/InteractionTemplates/InteractionTemplates.tsx
@@ -7,7 +7,7 @@ import Input from "../../../../components/inputs/input/Input";
import { SearchInput } from "../../../../components/inputs/search-input/SearchInput";
import { useConfirmDialog } from "../../../../contexts/confirm-dialog.context";
import classNames from "classnames";
-import { InteractionLabel } from "../interaction-label/InteractionLabel";
+import { InteractionLabel } from "../InteractionLabel/InteractionLabel";
export function InteractionTemplates(): ReactElement {
return (
diff --git a/frontend/src/modules/interactions/components/parameters/ParamBuilder/ParamBuilder.module.scss b/frontend/src/modules/interactions/components/ParamBuilder/ParamBuilder.module.scss
similarity index 100%
rename from frontend/src/modules/interactions/components/parameters/ParamBuilder/ParamBuilder.module.scss
rename to frontend/src/modules/interactions/components/ParamBuilder/ParamBuilder.module.scss
diff --git a/frontend/src/modules/interactions/components/parameters/ParamBuilder/ParamBuilder.tsx b/frontend/src/modules/interactions/components/ParamBuilder/ParamBuilder.tsx
similarity index 94%
rename from frontend/src/modules/interactions/components/parameters/ParamBuilder/ParamBuilder.tsx
rename to frontend/src/modules/interactions/components/ParamBuilder/ParamBuilder.tsx
index daa84892..a3ca633a 100644
--- a/frontend/src/modules/interactions/components/parameters/ParamBuilder/ParamBuilder.tsx
+++ b/frontend/src/modules/interactions/components/ParamBuilder/ParamBuilder.tsx
@@ -2,7 +2,7 @@ import React from "react";
import { Parameter } from "@flowser/shared";
import { ReactElement } from "react";
import { ValueBuilder } from "../ValueBuilder/ValueBuilder";
-import { InteractionParameterBuilder } from "../../../contexts/definition.context";
+import { InteractionParameterBuilder } from "../../contexts/definition.context";
import classes from "./ParamBuilder.module.scss";
import { CadenceValueBuilder } from "../ValueBuilder/interface";
diff --git a/frontend/src/modules/interactions/components/parameters/ValueBuilder/AddressBuilder/AddressBuilder.module.scss b/frontend/src/modules/interactions/components/ValueBuilder/AddressBuilder/AddressBuilder.module.scss
similarity index 88%
rename from frontend/src/modules/interactions/components/parameters/ValueBuilder/AddressBuilder/AddressBuilder.module.scss
rename to frontend/src/modules/interactions/components/ValueBuilder/AddressBuilder/AddressBuilder.module.scss
index ec63fb54..30a5ab9d 100644
--- a/frontend/src/modules/interactions/components/parameters/ValueBuilder/AddressBuilder/AddressBuilder.module.scss
+++ b/frontend/src/modules/interactions/components/ValueBuilder/AddressBuilder/AddressBuilder.module.scss
@@ -20,12 +20,17 @@ $avatar-size: 30px;
padding: $spacing-base;
.selectAccountButton {
+ background: none;
+ outline: none;
+ border: none;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
- cursor: pointer;
color: white;
+ &:not(:disabled) {
+ cursor: pointer;
+ }
.accountName {
color: $gray-10;
margin-top: $spacing-s;
@@ -34,14 +39,16 @@ $avatar-size: 30px;
border-color: $blue !important;
}
.avatarWrapper {
+ &__enabled {
+ &:hover {
+ border-color: $blue;
+ }
+ }
height: $avatar-size;
width: $avatar-size;
padding: $spacing-s;
border-radius: 50%;
border: 2px solid transparent;
- &:hover {
- border-color: $blue;
- }
.avatar {
width: 100%;
height: 100%;
diff --git a/frontend/src/modules/interactions/components/parameters/ValueBuilder/AddressBuilder/AddressBuilder.tsx b/frontend/src/modules/interactions/components/ValueBuilder/AddressBuilder/AddressBuilder.tsx
similarity index 77%
rename from frontend/src/modules/interactions/components/parameters/ValueBuilder/AddressBuilder/AddressBuilder.tsx
rename to frontend/src/modules/interactions/components/ValueBuilder/AddressBuilder/AddressBuilder.tsx
index dd111d93..447bdb54 100644
--- a/frontend/src/modules/interactions/components/parameters/ValueBuilder/AddressBuilder/AddressBuilder.tsx
+++ b/frontend/src/modules/interactions/components/ValueBuilder/AddressBuilder/AddressBuilder.tsx
@@ -1,17 +1,17 @@
import React, { ReactElement, useEffect, useMemo, useState } from "react";
import classes from "./AddressBuilder.module.scss";
import { CadenceValueBuilder } from "../interface";
-import { useGetPollingAccounts } from "../../../../../../hooks/use-api";
-import { AccountAvatar } from "../../../../../accounts/AccountAvatar/AccountAvatar";
-import { AccountName } from "../../../../../accounts/AccountName/AccountName";
-import { FlowserIcon } from "../../../../../../components/icons/Icons";
+import { useGetPollingAccounts } from "../../../../../hooks/use-api";
+import { AccountAvatar } from "../../../../accounts/AccountAvatar/AccountAvatar";
+import { AccountName } from "../../../../accounts/AccountName/AccountName";
+import { FlowserIcon } from "../../../../../components/icons/Icons";
import classNames from "classnames";
-import { ServiceRegistry } from "../../../../../../services/service-registry";
+import { ServiceRegistry } from "../../../../../services/service-registry";
import { Account, FclValues } from "@flowser/shared";
-import { Spinner } from "../../../../../../components/spinner/Spinner";
+import { Spinner } from "../../../../../components/spinner/Spinner";
export function AddressBuilder(props: CadenceValueBuilder): ReactElement {
- const { value, setValue, addressBuilderOptions } = props;
+ const { disabled, value, setValue, addressBuilderOptions } = props;
const { data, refresh } = useGetPollingAccounts();
const managedAccounts = useMemo(
() =>
@@ -47,12 +47,15 @@ export function AddressBuilder(props: CadenceValueBuilder): ReactElement {
{managedAccounts.map((account) => (
setValue(account.address)}
/>
))}
-
+ {!disabled && (
+
+ )}
);
@@ -62,15 +65,21 @@ type AccountButtonProps = {
isSelected: boolean;
onSelect: () => void;
account: Account;
+ disabled?: boolean;
};
function AccountButton(props: AccountButtonProps) {
- const { isSelected, account, onSelect } = props;
+ const { disabled, isSelected, account, onSelect } = props;
return (
- onSelect()}>
+
);
}
diff --git a/frontend/src/modules/interactions/components/parameters/ValueBuilder/ArrayBuilder/ArrayBuilder.module.scss b/frontend/src/modules/interactions/components/ValueBuilder/ArrayBuilder/ArrayBuilder.module.scss
similarity index 100%
rename from frontend/src/modules/interactions/components/parameters/ValueBuilder/ArrayBuilder/ArrayBuilder.module.scss
rename to frontend/src/modules/interactions/components/ValueBuilder/ArrayBuilder/ArrayBuilder.module.scss
diff --git a/frontend/src/modules/interactions/components/parameters/ValueBuilder/ArrayBuilder/ArrayBuilder.tsx b/frontend/src/modules/interactions/components/ValueBuilder/ArrayBuilder/ArrayBuilder.tsx
similarity index 88%
rename from frontend/src/modules/interactions/components/parameters/ValueBuilder/ArrayBuilder/ArrayBuilder.tsx
rename to frontend/src/modules/interactions/components/ValueBuilder/ArrayBuilder/ArrayBuilder.tsx
index a7d64130..782fcbf7 100644
--- a/frontend/src/modules/interactions/components/parameters/ValueBuilder/ArrayBuilder/ArrayBuilder.tsx
+++ b/frontend/src/modules/interactions/components/ValueBuilder/ArrayBuilder/ArrayBuilder.tsx
@@ -3,11 +3,11 @@ import { CadenceValueBuilder } from "../interface";
import { ValueBuilder } from "../ValueBuilder";
import classes from "./ArrayBuilder.module.scss";
import { FclArrayValue, FclValue, FclValues } from "@flowser/shared";
-import { SimpleButton } from "../../../../../../components/buttons/simple-button/SimpleButton";
-import { SizedBox } from "../../../../../../components/sized-box/SizedBox";
+import { SimpleButton } from "../../../../../components/buttons/simple-button/SimpleButton";
+import { SizedBox } from "../../../../../components/sized-box/SizedBox";
export function ArrayBuilder(props: CadenceValueBuilder): ReactElement {
- const { type, value, setValue } = props;
+ const { disabled, type, value, setValue } = props;
const { array } = type;
if (array === undefined) {
@@ -61,6 +61,7 @@ export function ArrayBuilder(props: CadenceValueBuilder): ReactElement {
{index}:
setElement(index, value)}
@@ -68,7 +69,7 @@ export function ArrayBuilder(props: CadenceValueBuilder): ReactElement {
);
})}
- {!isConstantArray && (
+ {!isConstantArray && !disabled && (
increaseSize()}>Add
diff --git a/frontend/src/modules/interactions/components/parameters/ValueBuilder/BoolBuilder/BoolBuilder.tsx b/frontend/src/modules/interactions/components/ValueBuilder/BoolBuilder/BoolBuilder.tsx
similarity index 88%
rename from frontend/src/modules/interactions/components/parameters/ValueBuilder/BoolBuilder/BoolBuilder.tsx
rename to frontend/src/modules/interactions/components/ValueBuilder/BoolBuilder/BoolBuilder.tsx
index 0b36ac27..8e9bd035 100644
--- a/frontend/src/modules/interactions/components/parameters/ValueBuilder/BoolBuilder/BoolBuilder.tsx
+++ b/frontend/src/modules/interactions/components/ValueBuilder/BoolBuilder/BoolBuilder.tsx
@@ -1,10 +1,10 @@
import React, { ReactElement, useEffect } from "react";
import { CadenceValueBuilder } from "../interface";
import { FclValues } from "@flowser/shared";
-import SelectInput from "../../../../../../components/inputs/select-input/SelectInput";
+import SelectInput from "../../../../../components/inputs/select-input/SelectInput";
export function BoolBuilder(props: CadenceValueBuilder): ReactElement {
- const { value, setValue } = props;
+ const { disabled, value, setValue } = props;
const isInitialised = FclValues.isFclBoolValue(value);
@@ -22,6 +22,7 @@ export function BoolBuilder(props: CadenceValueBuilder): ReactElement {
return (
Key:{" "}
updateEntryKey(entry.key, newKey)}
/>
@@ -142,6 +143,7 @@ export function DictionaryBuilder(props: CadenceValueBuilder): ReactElement {
Value:
updateEntryValue(entry.key, newValue)}
/>
@@ -149,11 +151,13 @@ export function DictionaryBuilder(props: CadenceValueBuilder): ReactElement {
);
})}
-
- addEntry()}>Add
-
- removeLastEntry()}>Remove
-
+ {!disabled && (
+
+ addEntry()}>Add
+
+ removeLastEntry()}>Remove
+
+ )}
);
}
diff --git a/frontend/src/modules/interactions/components/parameters/ValueBuilder/FixedPointNumberBuilder/FixedPointNumberBuilder.tsx b/frontend/src/modules/interactions/components/ValueBuilder/FixedPointNumberBuilder/FixedPointNumberBuilder.tsx
similarity index 84%
rename from frontend/src/modules/interactions/components/parameters/ValueBuilder/FixedPointNumberBuilder/FixedPointNumberBuilder.tsx
rename to frontend/src/modules/interactions/components/ValueBuilder/FixedPointNumberBuilder/FixedPointNumberBuilder.tsx
index 06f2b171..a78d5d3f 100644
--- a/frontend/src/modules/interactions/components/parameters/ValueBuilder/FixedPointNumberBuilder/FixedPointNumberBuilder.tsx
+++ b/frontend/src/modules/interactions/components/ValueBuilder/FixedPointNumberBuilder/FixedPointNumberBuilder.tsx
@@ -1,12 +1,12 @@
import React, { ReactElement, useEffect } from "react";
import { CadenceValueBuilder } from "../interface";
-import Input from "../../../../../../components/inputs/input/Input";
+import Input from "../../../../../components/inputs/input/Input";
import { FclValues } from "@flowser/shared";
export function FixedPointNumberBuilder(
props: CadenceValueBuilder
): ReactElement {
- const { value, setValue } = props;
+ const { disabled, value, setValue } = props;
const isInitialised = FclValues.isFclFixedPointNumberValue(value);
@@ -25,6 +25,7 @@ export function FixedPointNumberBuilder(
return (