Skip to content

Commit

Permalink
feat(ui): Rare Evo clean up (#901)
Browse files Browse the repository at this point in the history
* feat(ui): clean RareEvo card

* feat(ui): remove rare evo image

---------

Co-authored-by: Vu Van Duc <[email protected]>
  • Loading branch information
Sotatek-DukeVu and Vu Van Duc authored Jan 13, 2025
1 parent fbe48d3 commit 6b53db1
Show file tree
Hide file tree
Showing 21 changed files with 41 additions and 482 deletions.
4 changes: 2 additions & 2 deletions src/core/agent/services/connectionService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -812,15 +812,15 @@ describe("Connection service of agent", () => {
};
const mockHistoryIpexMessage = {
id: "id",
credentialType: "rare evo",
credentialType: "lei",
historyType: ConnectionHistoryType.CREDENTIAL_ISSUANCE,
type: ConnectionHistoryType.CREDENTIAL_ISSUANCE,
dt: new Date().toISOString(),
connectionId: "connectionId",
};
const mockHistoryRevokeMessage = {
id: "id",
credentialType: "rare evo",
credentialType: "lei",
historyType: ConnectionHistoryType.CREDENTIAL_REVOKED,
type: ConnectionHistoryType.CREDENTIAL_REVOKED,
dt: new Date().toISOString(),
Expand Down
3 changes: 0 additions & 3 deletions src/core/agent/services/ipexCommunicationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ class IpexCommunicationService extends AgentService {
static readonly IPEX_ALREADY_REPLIED = "IPEX message has already been responded to or proposed to group";
static readonly NO_CURRENT_IPEX_MSG_TO_JOIN = "Cannot join IPEX message as there is no current exn to join from the group leader";

static readonly SCHEMA_SAID_RARE_EVO_DEMO =
"EJxnJdxkHbRw2wVFNe4IUOPLt8fEtg9Sr3WyTjlgKoIb";

protected readonly identifierStorage: IdentifierStorage;
protected readonly credentialStorage: CredentialStorage;
protected readonly notificationStorage: NotificationStorage;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/__fixtures__/connectionsFix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const connectionsFix: ConnectionDetails[] = [
{
type: 1,
timestamp: "2017-01-14T19:23:24Z",
credentialType: "Rare EVO Attendee",
credentialType: "Cardano Foundation",
},
],
},
Expand Down
4 changes: 2 additions & 2 deletions src/ui/__fixtures__/credsFix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const pendingCredFixs: ACDCDetails[] = [
LEI: "5493001KJTIIGC8Y1R17",
},
s: {
title: "Rare EVO 2024 Attendee",
title: "Qualified vLEI Issuer Credential",
description:
"A vLEI Credential issued by GLEIF to Qualified vLEI Issuers which allows the Qualified vLEI Issuers to issue, verify and revoke Legal Entity vLEI Credentials and Legal Entity Official Organizational Role vLEI Credentials",
version: "1.0.0",
Expand All @@ -85,7 +85,7 @@ const revokedCredFixs: ACDCDetails[] = [
LEI: "5493001KJTIIGC8Y1R17",
},
s: {
title: "Rare EVO 2024 Attendee",
title: "Qualified vLEI Issuer Credential",
description:
"A vLEI Credential issued by GLEIF to Qualified vLEI Issuers which allows the Qualified vLEI Issuers to issue, verify and revoke Legal Entity vLEI Credentials and Legal Entity Official Organizational Role vLEI Credentials",
version: "1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/ui/__fixtures__/filteredCredsFix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ const filteredCredsFix: CredentialShortDetails[] = [
{
id: "EAzzrBvrVEYt3kvlXTZgulQhFq4CtkO8zA61eg6JtlMj",
issuanceDate: "2024-10-21T12:35:26.597Z",
credentialType: "Rare EVO 2024 Attendee",
credentialType: "Qualified vLEI Issuer Credential",
status: CredentialStatus.CONFIRMED,
schema: "EJxnJdxkHbRw2wVFNe4IUOPLt8fEtg9Sr3WyTjlgKoIb",
schema: "EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao",
identifierType: IdentifierType.Group,
identifierId: "EIRdVIgcPYj6LbN4DdxzJFnsvELV-7eWDBQ4a-VsRDQb",
},
Expand Down
8 changes: 4 additions & 4 deletions src/ui/__fixtures__/shortCredsFix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ const shortCredsFix: CredentialShortDetails[] = [
{
id: "EKfweht5lOkjaguB5dz42BMkfejhBFIF2-ghumzCJ6nv",
issuanceDate: "2024-01-23T16:03:44.643Z",
credentialType: "Rare EVO 2024 Attendee",
credentialType: "Qualified vLEI Issuer Credential",
status: CredentialStatus.CONFIRMED,
schema: "EJxnJdxkHbRw2wVFNe4IUOPLt8fEtg9Sr3WyTjlgKoIb",
schema: "EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao",
identifierType: IdentifierType.Individual,
identifierId: memberIdentifierRecord.id,
},
{
id: "EKfweht5lOkjaguB5dz42BMkfejhBFIF3-ghumzCJ6nv",
issuanceDate: "2024-01-23T16:03:44.643Z",
credentialType: "Rare EVO 2024 Attendee",
credentialType: "Qualified vLEI Issuer Credential",
status: CredentialStatus.PENDING,
schema: "EJxnJdxkHbRw2wVFNe4IUOPLt8fEtg9Sr3WyTjlgKoIb",
schema: "EBfdlu8R27Fbx-ehrqwImnK-8Cm79sqbAQ4MmvEAYqao",
identifierType: IdentifierType.Individual,
identifierId: memberIdentifierRecord.id,
},
Expand Down
Binary file removed src/ui/assets/images/rare-evo-bg.jpg
Binary file not shown.
20 changes: 3 additions & 17 deletions src/ui/components/ArchivedCredentials/CredentialItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import {
IonLabel,
} from "@ionic/react";
import { CredentialStatus } from "../../../core/agent/services/credentialService.types";
import { IpexCommunicationService } from "../../../core/agent/services/ipexCommunicationService";
import { i18n } from "../../../i18n";
import { formatShortDate } from "../../utils/formatters";
import { CardTheme } from "../CardTheme";
import "./ArchivedCredentials.scss";
import { CredentialItemProps } from "./ArchivedCredentials.types";
import BackgroundRAREVO from "../../assets/images/rare-evo-bg.jpg";

const CredentialItem = ({
credential,
Expand All @@ -25,8 +23,6 @@ const CredentialItem = ({
onRestore,
}: CredentialItemProps) => {
const isRevoked = credential.status === CredentialStatus.REVOKED;
const isRareEvo =
credential.schema === IpexCommunicationService.SCHEMA_SAID_RARE_EVO_DEMO;

return (
<IonItemSliding>
Expand All @@ -45,19 +41,9 @@ const CredentialItem = ({
aria-label=""
/>
)}
{
isRareEvo ? (
<img
src={BackgroundRAREVO}
alt="credential-miniature"
className="credential-miniature"
/>
) : (
<div className="credential-miniature">
<CardTheme />
</div>
)
}
<div className="credential-miniature">
<CardTheme />
</div>
<div className="credential-info">
<div
data-testid={`credential-name-${credential.id}`}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,12 @@
import { fireEvent, render } from "@testing-library/react";import { act } from "react";
import { fireEvent, render } from "@testing-library/react";
import { act } from "react";
import { Provider } from "react-redux";
import { CredentialCardTemplate } from "./CredentialCardTemplate";
import { store } from "../../../store";
import { shortCredsFix } from "../../__fixtures__/shortCredsFix";
import { formatShortDate } from "../../utils/formatters";
import { CredentialCardTemplate } from "./CredentialCardTemplate";


describe("Credential Card Template", () => {
it("Renders Rare Evo Card Template", async () => {
const handleShowCardDetails = jest.fn();
const { getByText, getByTestId, getByAltText } = render(
<Provider store={store}>
<CredentialCardTemplate
name="name"
index={0}
cardData={shortCredsFix[5]}
isActive={true}
onHandleShowCardDetails={() => handleShowCardDetails(0)}
/>
</Provider>
);
const card = getByTestId("rare-card-template-name-index-0");
expect(getByText(shortCredsFix[5].credentialType)).toBeInTheDocument();
expect(
getByText(formatShortDate(shortCredsFix[5].issuanceDate))
).toBeInTheDocument();
expect(getByAltText(/card-logo/i)).toBeInTheDocument();
act(() => {
fireEvent.click(card);
});
expect(handleShowCardDetails).toBeCalledTimes(1);
});

it("Renders Keri Card Template", async () => {
const handleShowCardDetails = jest.fn();
const { getByText, getByTestId, getByAltText } = render(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
import { IpexCommunicationService } from "../../../core/agent/services/ipexCommunicationService";
import { KeriCardTemplate, RareEvoCardTemplate } from "./components";
import { KeriCardTemplate } from "./components";
import { CredentialCardTemplateProps } from "./CredentialCardTemplate.types";

const CredentialCardTemplate = ({
name = "default",
...props
}: CredentialCardTemplateProps) => {
if (
props.cardData.schema === IpexCommunicationService.SCHEMA_SAID_RARE_EVO_DEMO
) {
return (
<RareEvoCardTemplate
name={name}
{...props}
/>
);
}

return (
<KeriCardTemplate
name={name}
Expand Down

This file was deleted.

Loading

0 comments on commit 6b53db1

Please sign in to comment.