From a8484cd5bae04d3a26f702165f39f35e2e278476 Mon Sep 17 00:00:00 2001
From: Aleksei Lunin <alexey.lunin@vereign.com>
Date: Wed, 1 Nov 2023 02:25:55 +0300
Subject: [PATCH] infra fixes

---
 apps/dashboard/src/main.tsx                            |  9 ++++++++-
 .../src/routes/pages/ConnectionListPage/index.tsx      |  4 +++-
 infra/ingress.yaml                                     |  4 ++--
 infra/{ocm-deployment.yaml => ocm-api-deployment.yaml} | 10 +++++-----
 infra/{ocm-service.yaml => ocm-api-service.yaml}       |  4 ++--
 libs/askar/src/askar/agent.service.ts                  |  7 ++++++-
 6 files changed, 26 insertions(+), 12 deletions(-)
 rename infra/{ocm-deployment.yaml => ocm-api-deployment.yaml} (94%)
 rename infra/{ocm-service.yaml => ocm-api-service.yaml} (88%)

diff --git a/apps/dashboard/src/main.tsx b/apps/dashboard/src/main.tsx
index d544d334..8b921a27 100644
--- a/apps/dashboard/src/main.tsx
+++ b/apps/dashboard/src/main.tsx
@@ -26,7 +26,14 @@ const root = ReactDOM.createRoot(
 );
 root.render(
   <BrowserRouter>
-    <ConfigProvider>
+    <ConfigProvider
+      theme={{
+        token: {
+          colorPrimary: "#06b4cb",
+          fontFamily: "Roboto",
+        }
+      }}
+    >
       <App />
     </ConfigProvider>
   </BrowserRouter>
diff --git a/apps/dashboard/src/routes/pages/ConnectionListPage/index.tsx b/apps/dashboard/src/routes/pages/ConnectionListPage/index.tsx
index a3a120bc..cf522aa7 100644
--- a/apps/dashboard/src/routes/pages/ConnectionListPage/index.tsx
+++ b/apps/dashboard/src/routes/pages/ConnectionListPage/index.tsx
@@ -24,7 +24,9 @@ const ConnectionListPage = observer(() => {
       </h2>
       <Space>
         <Link to={config.connection_create.getLink()}>
-          <Button>
+          <Button
+            type="primary"
+          >
             Create new invitation
           </Button>
         </Link>
diff --git a/infra/ingress.yaml b/infra/ingress.yaml
index 1ca5c903..5951b29a 100644
--- a/infra/ingress.yaml
+++ b/infra/ingress.yaml
@@ -12,7 +12,7 @@ spec:
             path: "/"
             backend:
               service:
-                name: ocm-service
+                name: ocm-api-service
                 port:
                   number: 8081
 
@@ -33,6 +33,6 @@ spec:
             path: "/"
             backend:
               service:
-                name: ocm-service
+                name: ocm-api-service
                 port:
                   number: 8001
diff --git a/infra/ocm-deployment.yaml b/infra/ocm-api-deployment.yaml
similarity index 94%
rename from infra/ocm-deployment.yaml
rename to infra/ocm-api-deployment.yaml
index da1c6868..909c45d1 100644
--- a/infra/ocm-deployment.yaml
+++ b/infra/ocm-api-deployment.yaml
@@ -1,20 +1,20 @@
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: ocm
+  name: ocm-api
   namespace: vereign
 spec:
   replicas: 1
   selector:
     matchLabels:
-      app: ocm
+      app: ocm-api
   template:
     metadata:
       labels:
-        app: ocm
+        app: ocm-api
     spec:
       containers:
-        - name: ocm
+        - name: ocm-api
           image: alexeylunin0/ggio-ocm-engine:latest
           ports:
             - containerPort: 8080
@@ -29,7 +29,7 @@ spec:
             - name: AGENT_PEER_URL
               value: "https://ocm-agent.vereign-labs.com"
             - name: AGENT_NAME
-              value: "OCM_labs" # this should be changed to company name
+              value: "OCM_LABS" # this should be changed to company name
             - name: AGENT_KEY
               value: OCM_LABS #example random string
             - name: AGENT_DID_SEED
diff --git a/infra/ocm-service.yaml b/infra/ocm-api-service.yaml
similarity index 88%
rename from infra/ocm-service.yaml
rename to infra/ocm-api-service.yaml
index e2cf1879..f0b18132 100644
--- a/infra/ocm-service.yaml
+++ b/infra/ocm-api-service.yaml
@@ -1,11 +1,11 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: ocm-service
+  name: ocm-api-service
   namespace: vereign
 spec:
   selector:
-    app: ocm
+    app: ocm-api
   ports:
     - name: api
       port: 8080
diff --git a/libs/askar/src/askar/agent.service.ts b/libs/askar/src/askar/agent.service.ts
index 3c6fa853..8febc4aa 100644
--- a/libs/askar/src/askar/agent.service.ts
+++ b/libs/askar/src/askar/agent.service.ts
@@ -634,7 +634,12 @@ export class AgentService {
     const proofRecord = await this.askar.agent.proofs.findById(proofRecordId);
 
     if (!proofRecord) {
-      return proofRecord;
+      return null;
+    }
+
+    if (proofRecord.state === ProofState.Done) {
+      const data = await this.askar.agent.proofs.getFormatData(proofRecord.id);
+      console.log(JSON.stringify(data, null, 2));
     }
 
     const proofResponse = new ProofRecordDto();
-- 
GitLab