Skip to content

Commit 5726578

Browse files
authored
Merge pull request #2667 from IntersectMBO/feat/2658-tweaks-to-drep-ids---change-default-id-to-cip129
feat: make CIP-129 identifiers default ones
2 parents e8fd264 + 38078a5 commit 5726578

File tree

8 files changed

+63
-38
lines changed

8 files changed

+63
-38
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ changes.
2121
### Changed
2222

2323
- Bump cardano-node to 10.1.4
24+
- Make CIP-129 governance identifiers the default ones
2425

2526
### Removed
2627

govtool/frontend/src/components/molecules/GovernanceActionCard.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,19 @@ export const GovernanceActionCard: FC<ActionTypeProps> = ({ ...props }) => {
118118
isSliderCard
119119
/>
120120
<GovernanceActionCardElement
121-
label={t("govActions.governanceActionId")}
122-
text={govActionId}
123-
dataTestId={`${govActionId}-id`}
121+
label={t("govActions.cip129GovernanceActionId")}
122+
text={cip129GovernanceActionId}
123+
dataTestId={`${cip129GovernanceActionId}-id`}
124124
isCopyButton
125125
isSliderCard
126126
/>
127127
<GovernanceActionCardElement
128-
label={t("govActions.cip129GovernanceActionId")}
129-
text={cip129GovernanceActionId}
130-
dataTestId={`${cip129GovernanceActionId}-id`}
128+
label={t("govActions.governanceActionId")}
129+
text={govActionId}
130+
dataTestId={`${govActionId}-id`}
131131
isCopyButton
132132
isSliderCard
133+
isSemiTransparent
133134
/>
134135
</Box>
135136
<Box

govtool/frontend/src/components/molecules/GovernanceActionCardElement.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type BaseProps = {
1212
isSliderCard?: boolean;
1313
tooltipProps?: Omit<TooltipProps, "children">;
1414
marginBottom?: number;
15+
isSemiTransparent?: boolean;
1516
};
1617

1718
type PillVariantProps = BaseProps & {
@@ -39,6 +40,7 @@ export const GovernanceActionCardElement = ({
3940
tooltipProps,
4041
marginBottom,
4142
isMarkdown = false,
43+
isSemiTransparent = false,
4244
}: GovernanceActionCardElementProps) => {
4345
if (!text) {
4446
return null;
@@ -161,6 +163,9 @@ export const GovernanceActionCardElement = ({
161163
...(isCopyButton && {
162164
color: "primaryBlue",
163165
}),
166+
...(isSemiTransparent && {
167+
opacity: 0.75,
168+
}),
164169
}}
165170
>
166171
{isMarkdown ? removeMarkdown(text) : text}

govtool/frontend/src/components/molecules/GovernanceVotedOnCard.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,19 @@ export const GovernanceVotedOnCard = ({ votedProposal, inProgress }: Props) => {
108108
isSliderCard
109109
/>
110110
<GovernanceActionCardElement
111-
label={t("govActions.governanceActionId")}
112-
text={govActionId}
113-
dataTestId={`${govActionId}-id`}
111+
label={t("govActions.cip129GovernanceActionId")}
112+
text={cip129GovernanceActionId}
113+
dataTestId={`${cip129GovernanceActionId}-id`}
114114
isCopyButton
115115
isSliderCard
116116
/>
117117
<GovernanceActionCardElement
118-
label={t("govActions.cip129GovernanceActionId")}
119-
text={cip129GovernanceActionId}
120-
dataTestId={`${cip129GovernanceActionId}-id`}
118+
label={t("govActions.governanceActionId")}
119+
text={govActionId}
120+
dataTestId={`${govActionId}-id`}
121121
isCopyButton
122122
isSliderCard
123+
isSemiTransparent
123124
/>
124125
{vote && (
125126
<GovernanceActionCardMyVote

govtool/frontend/src/components/organisms/DRepCard.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ export const DRepCard = ({
152152
}}
153153
>
154154
<ButtonBase
155-
data-testid={`${view}-copy-id-button`}
155+
data-testid={`${cip129Identifier}-copy-id-button`}
156156
onClick={(e) => {
157-
navigator.clipboard.writeText(view);
157+
navigator.clipboard.writeText(cip129Identifier);
158158
addSuccessAlert(t("alerts.copiedToClipboard"));
159159
e.stopPropagation();
160160
}}
@@ -169,21 +169,23 @@ export const DRepCard = ({
169169
opacity: 0.6,
170170
transition: "opacity 0.3s",
171171
},
172+
display: "flex",
173+
flexDirection: "row",
172174
}}
173175
>
174176
<Typography
175177
color="primary"
176178
variant="body2"
177179
sx={ellipsisStyles}
178180
>
179-
{view}
181+
{cip129Identifier}
180182
</Typography>
181183
<img alt="" src={ICONS.copyBlueIcon} />
182184
</ButtonBase>
183185
<ButtonBase
184-
data-testid={`${cip129Identifier}-copy-id-button`}
186+
data-testid={`${view}-copy-id-button`}
185187
onClick={(e) => {
186-
navigator.clipboard.writeText(cip129Identifier);
188+
navigator.clipboard.writeText(view);
187189
addSuccessAlert(t("alerts.copiedToClipboard"));
188190
e.stopPropagation();
189191
}}
@@ -198,18 +200,16 @@ export const DRepCard = ({
198200
opacity: 0.6,
199201
transition: "opacity 0.3s",
200202
},
201-
display: "flex",
202-
flexDirection: "row",
203203
}}
204204
>
205205
<Typography variant="body2" sx={ellipsisStyles}>
206-
(CIP-129){" "}
206+
(CIP-105){" "}
207207
<Typography
208208
color="primary"
209209
variant="body2"
210210
component="span"
211211
>
212-
{cip129Identifier}
212+
{view}
213213
</Typography>
214214
</Typography>
215215
<img alt="" src={ICONS.copyBlueIcon} />

govtool/frontend/src/components/organisms/DRepDetailsCard.tsx

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,7 @@ export const DRepDetailsCard = ({
112112
/>
113113
)}
114114
{/* ERROR MESSAGES END */}
115-
<DRepDetailsInfoItem label={t("drepId")} dataTestId="drep-id">
116-
<CopyableText value={view} dataTestId="copy-drep-id-button" />
117-
</DRepDetailsInfoItem>
118-
<DRepDetailsInfoItem
119-
label={t("cip129DrepId")}
120-
dataTestId="cip-129-drep-id"
121-
>
115+
<DRepDetailsInfoItem label={t("drepId")} dataTestId="cip-129-drep-id">
122116
<CopyableText
123117
value={encodeCIP129Identifier({
124118
txID: `${isScriptBased ? "23" : "22"}${drepId}`,
@@ -127,6 +121,18 @@ export const DRepDetailsCard = ({
127121
dataTestId="copy-cip-129-drep-id-button"
128122
/>
129123
</DRepDetailsInfoItem>
124+
125+
<DRepDetailsInfoItem
126+
label={t("cip105DRepId")}
127+
dataTestId="cip-105-drep-id"
128+
>
129+
<CopyableText
130+
isSemiTransparent
131+
value={view}
132+
dataTestId="copy-drep-id-button"
133+
/>
134+
</DRepDetailsInfoItem>
135+
130136
<DRepDetailsInfoItem label={t("status")} dataTestId="drep-status">
131137
<StatusPill status={status} />
132138
</DRepDetailsInfoItem>
@@ -296,9 +302,14 @@ const DRepDetailsInfoItem = ({
296302
type CopyableTextProps = {
297303
value: string;
298304
dataTestId: string;
305+
isSemiTransparent?: boolean;
299306
};
300307

301-
const CopyableText = ({ value, dataTestId }: CopyableTextProps) => (
308+
const CopyableText = ({
309+
value,
310+
dataTestId,
311+
isSemiTransparent,
312+
}: CopyableTextProps) => (
302313
<ButtonBase
303314
onClick={(e) => {
304315
navigator.clipboard.writeText(value.toString());
@@ -314,7 +325,11 @@ const CopyableText = ({ value, dataTestId }: CopyableTextProps) => (
314325
},
315326
}}
316327
>
317-
<Typography color="primary" fontWeight={500} sx={ellipsisStyles}>
328+
<Typography
329+
color="primary"
330+
fontWeight={500}
331+
sx={{ ...ellipsisStyles, opacity: isSemiTransparent ? 0.75 : 1 }}
332+
>
318333
{value}
319334
</Typography>
320335
<img alt="" src={ICONS.copyBlueIcon} />

govtool/frontend/src/components/organisms/GovernanceActionDetailsCardData.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,18 +256,19 @@ export const GovernanceActionDetailsCardData = ({
256256
/>
257257
)}
258258
<GovernanceActionCardElement
259-
label={t("govActions.governanceActionId")}
260-
text={govActionId}
259+
label={t("govActions.cip129GovernanceActionId")}
260+
text={cip129GovernanceActionId}
261+
dataTestId={`${cip129GovernanceActionId}-id`}
261262
isCopyButton
262-
dataTestId={`${govActionId}-id`}
263263
textVariant={screenWidth > 1600 ? "longText" : "oneLine"}
264264
/>
265265
<GovernanceActionCardElement
266-
label={t("govActions.cip129GovernanceActionId")}
267-
text={cip129GovernanceActionId}
268-
dataTestId={`${cip129GovernanceActionId}-id`}
266+
label={t("govActions.governanceActionId")}
267+
text={govActionId}
269268
isCopyButton
269+
dataTestId={`${govActionId}-id`}
270270
textVariant={screenWidth > 1600 ? "longText" : "oneLine"}
271+
isSemiTransparent
271272
/>
272273

273274
{tabs?.length === 1 ? (

govtool/frontend/src/i18n/locales/en.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@
361361
"dReps": "DReps",
362362
"sPos": "SPOs",
363363
"ccCommittee": "Constitutional Committee",
364-
"governanceActionId": "Governance Action ID:",
365-
"cip129GovernanceActionId": "(CIP-129) Governance Action ID:",
364+
"governanceActionId": "Legacy Governance Action ID (CIP-105):",
365+
"cip129GovernanceActionId": "Governance Action ID:",
366366
"governanceActionType": "Governance Action Type:",
367367
"goToVote": "Go to Vote",
368368
"membersToBeRemovedFromTheCommittee": "Members to be removed from the Committee",
@@ -760,6 +760,7 @@
760760
"delegate": "Delegate",
761761
"drepId": "DRep ID",
762762
"cip129DrepId": "(CIP-129) DRep ID",
763+
"cip105DRepId": "Legacy DRep ID (CIP-105)",
763764
"email": "Email",
764765
"feedback": "Feedback",
765766
"filter": "Filter",

0 commit comments

Comments
 (0)