Skip to content

Commit

Permalink
Merge pull request #3639 from threefoldtech/update_development2.7
Browse files Browse the repository at this point in the history
Update development2.7
  • Loading branch information
AhmedHanafy725 authored Nov 13, 2024
2 parents bead750 + 8b4c92c commit 88613b5
Show file tree
Hide file tree
Showing 27 changed files with 154 additions and 98 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "2.6.0-rc3",
"version": "2.6.0",
"npmClient": "yarn"
}
2 changes: 1 addition & 1 deletion packages/UI/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@threefold/ui",
"version": "2.6.0-rc3",
"version": "2.6.0",
"private": false,
"main": "dist/threefold-ui.umd.js",
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql_client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@threefold/graphql_client",
"version": "2.6.0-rc3",
"version": "2.6.0",
"main": "./dist/node/index.js",
"module": "./dist/es6/index.js",
"exports": {
Expand All @@ -18,7 +18,7 @@
"es6-build": "tsc --build tsconfig.json"
},
"dependencies": {
"@threefold/types": "2.6.0-rc3",
"@threefold/types": "2.6.0",
"ts-mixer": "^6.0.2"
},
"devDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions packages/grid_client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@threefold/grid_client",
"author": "Ahmed Hanafy",
"version": "2.6.0-rc3",
"version": "2.6.0",
"license": "ISC",
"homepage": "https://github.com/threefoldtech/tfgrid-sdk-ts/tree/development/packages/grid_client/README.md",
"repository": {
Expand All @@ -14,11 +14,11 @@
"dependencies": {
"@jimber/pkid": "1.0.4",
"@noble/secp256k1": "^1.7.1",
"@threefold/gridproxy_client": "2.6.0-rc3",
"@threefold/monitoring": "2.6.0-rc3",
"@threefold/rmb_direct_client": "2.6.0-rc3",
"@threefold/tfchain_client": "2.6.0-rc3",
"@threefold/types": "2.6.0-rc3",
"@threefold/gridproxy_client": "2.6.0",
"@threefold/monitoring": "2.6.0",
"@threefold/rmb_direct_client": "2.6.0",
"@threefold/tfchain_client": "2.6.0",
"@threefold/types": "2.6.0",
"algosdk": "^1.19.0",
"appdata-path": "^1.0.0",
"await-lock": "^2.2.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/grid_http_server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@threefold/grid_http_server",
"author": "Ahmed Hanafy",
"version": "2.6.0-rc3",
"version": "2.6.0",
"license": "ISC",
"homepage": "https://github.com/threefoldtech/tfgrid-sdk-ts/blob/development/packages/grid_http_server/README.md",
"repository": {
Expand All @@ -12,7 +12,7 @@
"access": "public"
},
"dependencies": {
"@threefold/grid_client": "2.6.0-rc3",
"@threefold/grid_client": "2.6.0",
"express": "^4.21.1",
"http-server": "^14.1.1",
"typescript": "^4.7.4"
Expand Down
8 changes: 4 additions & 4 deletions packages/grid_rmb_server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@threefold/grid_rmb_server",
"author": "Ahmed Hanafy",
"version": "2.6.0-rc3",
"version": "2.6.0",
"license": "ISC",
"homepage": "https://github.com/threefoldtech/tfgrid-sdk-ts/blob/development/packages/grid_rmb_server/README.md",
"repository": {
Expand All @@ -12,12 +12,12 @@
"access": "public"
},
"dependencies": {
"@threefold/grid_client": "2.6.0-rc3",
"@threefold/rmb_peer_server": "2.6.0-rc3",
"@threefold/grid_client": "2.6.0",
"@threefold/rmb_peer_server": "2.6.0",
"typescript": "^4.7.4"
},
"devDependencies": {
"@threefold/rmb_peer_client": "2.6.0-rc3",
"@threefold/rmb_peer_client": "2.6.0",
"ts-node": "^10.9.1"
},
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/gridproxy_client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@threefold/gridproxy_client",
"version": "2.6.0-rc3",
"version": "2.6.0",
"description": "gridproxy_client help to interact with gridproxy based on network",
"main": "./dist/node/public_api.js",
"module": "./dist/es6/public_api.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/monitoring/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@threefold/monitoring",
"version": "2.6.0-rc3",
"version": "2.6.0",
"description": "Threefold monitoring package",
"license": "Apache-2.0",
"main": "./dist/node/index.js",
Expand All @@ -26,9 +26,9 @@
"access": "public"
},
"dependencies": {
"@threefold/rmb_direct_client": "2.6.0-rc3",
"@threefold/tfchain_client": "2.6.0-rc3",
"@threefold/types": "2.6.0-rc3",
"@threefold/rmb_direct_client": "2.6.0",
"@threefold/tfchain_client": "2.6.0",
"@threefold/types": "2.6.0",
"chalk": "4.1.2",
"ts-node": "^10.9.1",
"typescript": "^5.3.3",
Expand Down
12 changes: 6 additions & 6 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@threefold/playground",
"version": "2.6.0-rc3",
"version": "2.6.0",
"private": true,
"scripts": {
"dev": "vite",
Expand All @@ -13,11 +13,11 @@
"dependencies": {
"@mdi/font": "^7.2.96",
"@sentry/vue": "^8.19.0",
"@threefold/graphql_client": "2.6.0-rc3",
"@threefold/grid_client": "2.6.0-rc3",
"@threefold/gridproxy_client": "2.6.0-rc3",
"@threefold/monitoring": "2.6.0-rc3",
"@threefold/types": "2.6.0-rc3",
"@threefold/graphql_client": "2.6.0",
"@threefold/grid_client": "2.6.0",
"@threefold/gridproxy_client": "2.6.0",
"@threefold/monitoring": "2.6.0",
"@threefold/types": "2.6.0",
"@types/ip": "^1.1.3",
"@types/md5": "^2.3.5",
"await-lock": "^2.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/playground-charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v2.6.0-rc3"
appVersion: "v2.6.0"
2 changes: 1 addition & 1 deletion packages/playground/playground-charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ image:
repository: ghcr.io/threefoldtech/playground
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "2.6.0-rc3"
tag: "2.6.0"

env:
- name: "MODE"
Expand Down
4 changes: 2 additions & 2 deletions packages/playground/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,14 @@ const routes: AppRoute[] = [
icon: "mdi-lightbulb-on-outline",
route: DashboardRoutes.Deploy.Applications,
tooltip: "Deploy ready applications on the ThreeFold grid.",
releaseDate: new Date("2024-10-2"),
releaseDate: new Date("2024-11-13"),
},
{
title: "Domains",
icon: "mdi-web-box",
route: DashboardRoutes.Deploy.Domains,
tooltip: "Expose servers hosted on local machines or VMs to the public internet.",
releaseDate: new Date("2024-10-2"),
releaseDate: new Date("2024-11-13"),
},
{
title: "Your Contracts",
Expand Down
105 changes: 82 additions & 23 deletions packages/playground/src/components/KycVerifier.vue
Original file line number Diff line number Diff line change
@@ -1,24 +1,59 @@
<template>
<v-dialog
v-if="!loading && token"
fullscreen
:model-value="moduleValue"
@update:model-value="handleUpdateDialog($event)"
width="100%"
class="w-100 h-100 d-flex justify-center align-center"
>
<iframe
id="iframe"
allowfullscreen
style="width: 100%; height: 100%; border: none"
:src="`https://ui.idenfy.com/?authToken=${token}`"
allow="camera"
/>
<v-dialog opacity="0" :model-value="moduleValue">
<v-dialog
v-if="!loading && agreed && token"
fullscreen
:model-value="kycDialog"
@update:model-value="handleUpdateDialog($event)"
width="100%"
class="w-100 h-100 d-flex justify-center align-center"
>
<iframe
id="iframe"
allowfullscreen
style="width: 100%; height: 100%; border: none"
:src="`https://ui.idenfy.com/?authToken=${token}`"
allow="camera"
/>
</v-dialog>
<v-dialog
v-model="agreementDialog"
@update:model-value="($event: boolean) => !$event ? handleUpdateDialog($event) : undefined"
max-width="700"
>
<v-card>
<v-card-title class="bg-primary d-flex align-center">
<v-icon icon="mdi-security" />
<div class="pl-2">Terms & Conditions</div>
</v-card-title>

<v-card-text class="pb-0">
We use iDenfy to verify your identity.
<br />
Please ensure you review iDenfy’s <span class="font-weight-bold">Security and Compliance</span>, which
includes their <span class="font-weight-bold">Terms & Conditions, Privacy Policy</span>, and other relevant
documents.
<v-checkbox hide-details v-model="agreedCheckbox">
<template v-slot:label>
<div>
I have read and agreed to

<a href="https://www.idenfy.com/security/" target="_blank" @click.stop> iDenfy Terms & Conditions</a>.
</div>
</template>
</v-checkbox>
</v-card-text>
<v-card-actions class="justify-end my-1 mr-2">
<v-btn color="anchor" @click="handleAgreementDialog(false)">Cancel</v-btn>
<v-btn :disabled="!agreedCheckbox" @click="handleAgreementDialog(true)">Continue</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-dialog>
</template>
<script lang="ts">
import { KycErrors } from "@threefold/types";
import { onMounted, ref } from "vue";
import { onMounted, onUnmounted, ref } from "vue";
import { useKYC } from "@/stores/kyc";
import { createCustomToast, ToastType } from "@/utils/custom_toast";
Expand All @@ -35,19 +70,35 @@ export default {
required: true,
},
},
emits: ["update:moduleValue", "loaded"],
emits: ["update:moduleValue", "update:loading"],
setup(props, { emit }) {
const kyc = useKYC();
const token = ref("");
const kycDialog = ref(false);
const agreementDialog = ref(true);
const agreed = ref(false);
const agreedCheckbox = ref(false);
const handleUpdateDialog = (event: boolean) => {
emit("update:moduleValue", event);
};
const handleAgreementDialog = (agreed: boolean) => {
if (!agreed) handleUpdateDialog(false);
else {
agreementDialog.value = false;
getToken();
}
};
const handleUpdateLoading = (event: boolean) => {
emit("update:loading", event);
};
const getToken = async () => {
try {
handleUpdateLoading(true);
agreed.value = true;
if (!kyc.client) throw new Error("KYC client is not initialized");
token.value = await kyc.client.getToken();
window.addEventListener("message", handleReceiveMessage, false);
kycDialog.value = true;
} catch (e) {
handleUpdateDialog(false);
if (e instanceof KycErrors.AlreadyVerified) {
Expand All @@ -58,12 +109,14 @@ export default {
createCustomToast((e as KycErrors.TFGridKycError).message, ToastType.danger);
console.error(e);
} finally {
emit("loaded");
handleUpdateLoading(false);
}
};
const handleReceiveMessage = (event: MessageEvent) => {
const handleReceiveMessage = async (event: MessageEvent) => {
if (event.data?.status == undefined || event.data?.manualStatus == "waiting") return;
window.removeEventListener("message", handleReceiveMessage, false);
await new Promise(r => setTimeout(r, 5000)); // wait for the verification to be completed
handleUpdateDialog(false); // close the dialog
if (!event.data.status) console.error("Can't check the verification status", event.data);
const status = (event.data.status as string).toLowerCase();
Expand All @@ -73,11 +126,17 @@ export default {
} else if (status === "failed") createCustomToast("Verification failed, Please try again", ToastType.danger);
else if (status === "unverified") createCustomToast("Verification canceled", ToastType.info);
};
window.addEventListener("message", handleReceiveMessage, false);
onMounted(getToken);
onMounted(() => (agreementDialog.value = true));
onUnmounted(() => window.removeEventListener("message", handleReceiveMessage, false));
return {
kycDialog,
getToken,
handleUpdateDialog,
handleAgreementDialog,
token,
agreementDialog,
agreed,
agreedCheckbox,
};
},
};
Expand Down
3 changes: 2 additions & 1 deletion packages/playground/src/components/manage_gateway_dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ export default {
suggestName();
layout.value.setStatus("success", "Successfully deployed gateway.");
} catch (error) {
layout.value.setStatus("failed", normalizeError(error, "Something went wrong."));
errorMessage.value = "Failed to add domain";
layout.value.setStatus("failed", normalizeError(errorMessage.value, "Something went wrong."));
}
}
Expand Down
13 changes: 2 additions & 11 deletions packages/playground/src/components/view_layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,7 @@
</template>
<div class="d-flex justify-space-between align-baseline">
<div>{{ title }} requires a KYC verification.</div>
<v-btn
text="Verify now"
size="small"
color="error"
:loading="kycDialogLoading"
@click="
kycDialog = true;
kycDialogLoading = true;
"
/>
<v-btn text="Verify now" size="small" color="error" @click="kycDialog = true" :loading="kycDialogLoading" />
</div>
</VAlert>
</template>
Expand All @@ -59,7 +50,7 @@
<KycVerifier
v-if="kycDialog"
:loading="kycDialogLoading"
@loaded="kycDialogLoading = false"
@update:loading="kycDialogLoading = $event"
:moduleValue="kycDialog"
@update:moduleValue="kycDialog = $event"
/>
Expand Down
Loading

0 comments on commit 88613b5

Please sign in to comment.