Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the name of Lambda to Function everywhere it occurs in the UI #682

Merged
merged 3 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/modules/explorer/components/CodeCollapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const CodeCollapse: React.FC<Props> = ({ code }) => {
<TableHeader item container justifyContent="space-between">
<Grid item>
<Typography variant="body2" style={{ fontWeight: "500" }} color="textPrimary">
View Lambda Parameter Code
View Function Parameter Code
</Typography>
</Grid>
<Grid item>
Expand Down
18 changes: 9 additions & 9 deletions src/modules/explorer/components/ConfigProposalFormLambda.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ enum LambdaProposalState {
}

const codeEditorPlaceholder = {
addLambda: `Write Michelson Code for Lambda's Implementation
addLambda: `Write Michelson Code for Function's Implementation

Eg:-

Expand All @@ -98,9 +98,9 @@ Eg:-
{ DROP ; UNIT })
"sample")))
`,
existingLambda: `Choose a Lambda from the Dropdown, the implementation will appear here
existingLambda: `Choose a Function from the Dropdown, the implementation will appear here
`,
lambdaExecuteArgumentsCode: `Write Michelson Code for the input Paramerers of your Lambda
lambdaExecuteArgumentsCode: `Write Michelson Code for the input Paramerers of your Function

Eg:-

Expand Down Expand Up @@ -277,7 +277,7 @@ export const ProposalFormLambda: React.FC<Props> = ({ open, handleClose, action
const renderRemoveProposal = () => {
return (
<>
<ProposalFormInput label="Lambda Name">
<ProposalFormInput label="Function Name">
<SearchLambda lambdas={daoLambdas} handleChange={handleSearchChange} />
</ProposalFormInput>
<ProposalCodeEditorInput
Expand All @@ -300,7 +300,7 @@ export const ProposalFormLambda: React.FC<Props> = ({ open, handleClose, action
const renderExecuteProposal = () => {
return (
<>
<ProposalFormInput label="Lambda Name">
<ProposalFormInput label="Function Name">
<SearchLambda lambdas={daoLambdas} handleChange={handleSearchChange} />
</ProposalFormInput>
<ProposalCodeEditorInput
Expand All @@ -317,7 +317,7 @@ export const ProposalFormLambda: React.FC<Props> = ({ open, handleClose, action
placeholder={codeEditorPlaceholder.existingLambda}
/>
<ProposalCodeEditorInput
label="Lambda Arguments Code"
label="Function Arguments Code"
containerstyle={codeEditorcontainerstyles}
insertSpaces
ignoreTabKey={false}
Expand Down Expand Up @@ -351,18 +351,18 @@ export const ProposalFormLambda: React.FC<Props> = ({ open, handleClose, action
<ResponsiveDialog
open={open}
onClose={handleClose}
title={ProposalAction[action] + " Lambda Proposal"}
title={ProposalAction[action] + " Function Proposal"}
template="md"
>
{state === LambdaProposalState.write_action ? (
<>
<Grid container direction="row" spacing={4}>
<Grid container direction="row">
{action === ProposalAction.new ? renderNewProposal() : null}
{action === ProposalAction.remove ? renderRemoveProposal() : null}
{action === ProposalAction.execute ? renderExecuteProposal() : null}
</Grid>

<StyledRow container direction="row" spacing={4} justifyContent="flex-end">
<StyledRow container direction="row" justifyContent="flex-end">
<StyledSendButton onClick={lambdaForm.handleSubmit(onSubmit)} disabled={!code}>
Submit
</StyledSendButton>
Expand Down
12 changes: 6 additions & 6 deletions src/modules/explorer/components/ProposalActionsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,20 @@ interface Action {

const getActions = (): Action[] => [
{
name: "Add Lambda",
description: "Write Michelson code to add Lambda",
name: "Add Function",
description: "Write Michelson code to add Function",
id: ProposalAction.new,
isLambda: true
},
{
name: "Remove Lambda",
description: "Choose which Lambda to remove",
name: "Remove Function",
description: "Choose which Function to remove",
id: ProposalAction.remove,
isLambda: true
},
{
name: "Execute Lambda",
description: "Execute a Lambda already installed on DAO",
name: "Execute Function",
description: "Execute a Function already installed on DAO",
id: ProposalAction.execute,
isLambda: true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,19 @@ export const ProposalSelectionMenuLambda: React.FC<Props> = ({ open, handleClose
</Grid>
<Grid container justifyContent="center" style={{ gap: 20 }} direction="column">
<MainButton variant="contained" onClick={() => handleOpenCustomProposalModal(ProposalAction.new)}>
Add Lambda
Add Function
</MainButton>

<MainButton
variant="contained"
color="secondary"
onClick={() => handleOpenCustomProposalModal(ProposalAction.remove)}
>
Remove Lambda
Remove Function
</MainButton>

<MainButton variant="contained" color="secondary" onClick={toggleExecuteUI}>
Execute Lambda
Execute Function
</MainButton>
</Grid>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/explorer/components/ResponsiveDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import CloseButton from "modules/common/CloseButton"
import BackButton from "modules/common/BackButton"

const Content = styled(Grid)({
padding: "41px 46px"
padding: "40px 48px"
})

const TitleText = styled(Typography)(({ theme }) => ({
Expand Down
12 changes: 6 additions & 6 deletions src/modules/explorer/pages/Config/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ const getActions = (): Action[] => [
isLambda: true
},
{
name: "Add Lambda",
description: "Write Michelson code to add Lambda",
name: "Add Function",
description: "Write Michelson code to add Function",
id: ProposalAction.new,
isLambda: true
},
{
name: "Remove Lambda",
description: "Choose which Lambda to remove",
name: "Remove Function",
description: "Choose which Function to remove",
id: ProposalAction.remove,
isLambda: true
},
{
name: "Execute Lambda",
description: "Execute a Lambda already installed on DAO",
name: "Execute Function",
description: "Execute a Function already installed on DAO",
id: ProposalAction.execute,
isLambda: true
},
Expand Down
9 changes: 3 additions & 6 deletions src/modules/explorer/pages/ProposalDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ import { CopyButton } from "modules/common/CopyButton"
import { ProposalCodeEditorInput } from "modules/explorer/components/ProposalFormInput"
import Prism, { highlight } from "prismjs"
import { CodeCollapse } from "modules/explorer/components/CodeCollapse"
import { useDAOLambdas } from "services/contracts/baseDAO/hooks/useDAOLambdas"
import { useDAOLambda } from "services/contracts/baseDAO/hooks/useDAOLambda"
import { parseLambdaCode } from "utils"

const Container = styled(ContentContainer)({
padding: "36px 45px"
Expand Down Expand Up @@ -378,7 +375,7 @@ export const ProposalDetails: React.FC = () => {
<HighlightedBadge justifyContent="center" alignItems="center" direction="row" container>
<Grid item>
<DetailsText variant="body1" color="textPrimary">
Execute Lambda{" "}
Execute Function{" "}
<Typography variant="body1" color="secondary" display={"inline"}>
{_.startCase((proposal as LambdaProposal).metadata.lambdaHandler.handler_name)}
</Typography>{" "}
Expand Down Expand Up @@ -445,7 +442,7 @@ export const ProposalDetails: React.FC = () => {
<HighlightedBadge justifyContent="center" alignItems="center" direction="row" container>
<Grid item>
<DetailsText variant="body1" color="textPrimary">
Add Lambda{" "}
Add Function{" "}
<Typography variant="body1" color="secondary" display={"inline"}>
{(proposal as LambdaProposal).metadata.lambdaHandler.name}
</Typography>{" "}
Expand Down Expand Up @@ -479,7 +476,7 @@ export const ProposalDetails: React.FC = () => {
<HighlightedBadge justifyContent="center" alignItems="center" direction="row" container>
<Grid item>
<DetailsText variant="body1" color="textPrimary">
Remove Lambda{" "}
Remove Function{" "}
<Typography variant="body1" color="secondary" display={"inline"}>
{_.startCase((proposal as LambdaProposal).metadata.lambdaHandler)}
</Typography>{" "}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const useLambdaAddPropose = () => {
// setProposalDone()

openNotification({
message: "Add Lambda proposal transaction confirmed!",
message: "Add Function proposal transaction confirmed!",
autoHideDuration: 10000,
variant: "success",
detailsLink: `https://${networkNameMap[network]}.tzkt.io/` + data.opHash
Expand Down