forked from cerc-io/snowballtools-base
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1bb778699 |
@@ -19,7 +19,6 @@
|
|||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"express-async-errors": "^3.1.1",
|
|
||||||
"express-session": "^1.18.0",
|
"express-session": "^1.18.0",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
"graphql": "^16.8.1",
|
"graphql": "^16.8.1",
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'express-async-errors';
|
|
||||||
import 'reflect-metadata';
|
import 'reflect-metadata';
|
||||||
import debug from 'debug';
|
import debug from 'debug';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ router.get('/registration/:email', async (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.post('/register', async (req, res) => {
|
router.post('/register', async (req, res) => {
|
||||||
console.log('Register', req.body);
|
|
||||||
const { email, challenge, attestation } = req.body;
|
const { email, challenge, attestation } = req.body;
|
||||||
const user = await createUser(req.app.get('service'), {
|
const user = await createUser(req.app.get('service'), {
|
||||||
challenge,
|
challenge,
|
||||||
@@ -32,7 +31,6 @@ router.post('/register', async (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
router.post('/authenticate', async (req, res) => {
|
router.post('/authenticate', async (req, res) => {
|
||||||
console.log('Authenticate', req.body);
|
|
||||||
const { signedWhoamiRequest } = req.body;
|
const { signedWhoamiRequest } = req.body;
|
||||||
const user = await authenticateUser(
|
const user = await authenticateUser(
|
||||||
req.app.get('service'),
|
req.app.get('service'),
|
||||||
@@ -68,10 +66,10 @@ router.post('/validate', async (req, res) => {
|
|||||||
}
|
}
|
||||||
const newUser = await service.createUser({
|
const newUser = await service.createUser({
|
||||||
ethAddress: data.address,
|
ethAddress: data.address,
|
||||||
email: '',
|
email: data.address,
|
||||||
name: '',
|
name: data.address,
|
||||||
subOrgId: '',
|
subOrgId: data.address,
|
||||||
turnkeyWalletId: '',
|
turnkeyWalletId: data.address, // TODO: fix fields
|
||||||
});
|
});
|
||||||
req.session.userId = newUser.id;
|
req.session.userId = newUser.id;
|
||||||
} else if (action === 'login') {
|
} else if (action === 'login') {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Router } from 'express';
|
|||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
router.get('/version', async (req, res) => {
|
router.get('/version', async (req, res) => {
|
||||||
return res.send({ version: '0.0.7' });
|
return res.send({ version: '0.0.2' });
|
||||||
});
|
});
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
|||||||
@@ -112,11 +112,6 @@ export const createAndStartServer = async (
|
|||||||
app.use('/api/github', githubRouter);
|
app.use('/api/github', githubRouter);
|
||||||
app.use('/staging', stagingRouter);
|
app.use('/staging', stagingRouter);
|
||||||
|
|
||||||
app.use((err: any, req: any, res: any, next: any) => {
|
|
||||||
console.error(err);
|
|
||||||
res.status(500).json({ error: err.message });
|
|
||||||
});
|
|
||||||
|
|
||||||
httpServer.listen(port, host, () => {
|
httpServer.listen(port, host, () => {
|
||||||
log(`Server is listening on ${host}:${port}${server.graphqlPath}`);
|
log(`Server is listening on ${host}:${port}${server.graphqlPath}`);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -414,6 +414,9 @@ export class Service {
|
|||||||
if (!user) {
|
if (!user) {
|
||||||
user = await this.db.addUser({
|
user = await this.db.addUser({
|
||||||
email: data.email,
|
email: data.email,
|
||||||
|
ethAddress: data.email,
|
||||||
|
subOrgId: data.email,
|
||||||
|
turnkeyWalletId: data.email,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ services:
|
|||||||
restEndpoint: 'http://console.laconic.com:1317'
|
restEndpoint: 'http://console.laconic.com:1317'
|
||||||
gqlEndpoint: 'http://console.laconic.com:9473/api'
|
gqlEndpoint: 'http://console.laconic.com:9473/api'
|
||||||
userKey: 87d00f66a73e2ca428adeb49ba9164d0ad9a87edc60e33d46ad3031b9c5701fe
|
userKey: 87d00f66a73e2ca428adeb49ba9164d0ad9a87edc60e33d46ad3031b9c5701fe
|
||||||
bondId: 89c75c7bc5759861d10285aff6f9e7227d6855e446b77ad5d8324822dfec7deb
|
bondId: 098c906850b87412f02200e41f449bc79e055eab77acfef32c0b22443bb46661
|
||||||
chainId: laconic_9000-1
|
chainId: laconic_9000-1
|
||||||
gas: 1200000
|
gas: 550000
|
||||||
fees: 200000aphoton
|
fees: 200000aphoton
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Repository URL
|
# Repository URL
|
||||||
REPO_URL="https://github.com/snowball-tools/snowballtools-base"
|
REPO_URL="https://git.vdb.to/cerc-io/snowballtools-base"
|
||||||
|
|
||||||
# Get the latest commit hash from the repository
|
# Get the latest commit hash from the repository
|
||||||
LATEST_HASH=$(git ls-remote $REPO_URL HEAD | awk '{print $1}')
|
LATEST_HASH=$(git ls-remote $REPO_URL HEAD | awk '{print $1}')
|
||||||
@@ -64,13 +64,7 @@ echo "Files generated successfully."
|
|||||||
RECORD_FILE=records/application-record.yml
|
RECORD_FILE=records/application-record.yml
|
||||||
|
|
||||||
# Publish ApplicationRecord
|
# Publish ApplicationRecord
|
||||||
publish_response=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE)
|
RECORD_ID=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE | jq -r '.id')
|
||||||
rc=$?
|
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to publish record"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
RECORD_ID=$(echo $publish_response | jq -r '.id')
|
|
||||||
echo "ApplicationRecord published"
|
echo "ApplicationRecord published"
|
||||||
echo $RECORD_ID
|
echo $RECORD_ID
|
||||||
|
|
||||||
@@ -79,36 +73,15 @@ REGISTRY_APP_CRN="crn://snowballtools/applications/snowballtools-base-frontend"
|
|||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${PACKAGE_VERSION}" "$RECORD_ID"
|
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${PACKAGE_VERSION}" "$RECORD_ID"
|
||||||
rc=$?
|
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to set name: $REGISTRY_APP_CRN@${PACKAGE_VERSION}"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
sleep 2
|
sleep 2
|
||||||
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${LATEST_HASH}" "$RECORD_ID"
|
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${LATEST_HASH}" "$RECORD_ID"
|
||||||
rc=$?
|
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to set hash"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
sleep 2
|
sleep 2
|
||||||
# Set name if latest release
|
# Set name if latest release
|
||||||
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN" "$RECORD_ID"
|
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN" "$RECORD_ID"
|
||||||
rc=$?
|
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to set release"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
echo "$REGISTRY_APP_CRN set for ApplicationRecord"
|
echo "$REGISTRY_APP_CRN set for ApplicationRecord"
|
||||||
|
|
||||||
# Check if record found for REGISTRY_APP_CRN
|
# Check if record found for REGISTRY_APP_CRN
|
||||||
query_response=$(yarn --silent laconic -c $CONFIG_FILE cns name resolve "$REGISTRY_APP_CRN")
|
APP_RECORD=$(yarn --silent laconic -c $CONFIG_FILE cns name resolve "$REGISTRY_APP_CRN" | jq '.[0]')
|
||||||
rc=$?
|
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to query name"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
APP_RECORD=$(echo $query_response | jq '.[0]')
|
|
||||||
if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then
|
if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then
|
||||||
echo "No record found for $REGISTRY_APP_CRN."
|
echo "No record found for $REGISTRY_APP_CRN."
|
||||||
exit 1
|
exit 1
|
||||||
@@ -117,11 +90,6 @@ fi
|
|||||||
RECORD_FILE=records/application-deployment-request.yml
|
RECORD_FILE=records/application-deployment-request.yml
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
deployment_response=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE)
|
DEPLOYMENT_REQUEST_ID=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE | jq -r '.id')
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to query deployment request"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
DEPLOYMENT_REQUEST_ID=$(echo $deployment_response | jq -r '.id')
|
|
||||||
echo "ApplicationDeploymentRequest published"
|
echo "ApplicationDeploymentRequest published"
|
||||||
echo $DEPLOYMENT_REQUEST_ID
|
echo $DEPLOYMENT_REQUEST_ID
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Repository URL
|
# Repository URL
|
||||||
REPO_URL="https://github.com/snowball-tools/snowballtools-base"
|
REPO_URL="https://git.vdb.to/cerc-io/snowballtools-base"
|
||||||
|
|
||||||
# Get the latest commit hash from the repository
|
# Get the latest commit hash from the repository
|
||||||
LATEST_HASH=$(git ls-remote $REPO_URL HEAD | awk '{print $1}')
|
LATEST_HASH=$(git ls-remote $REPO_URL HEAD | awk '{print $1}')
|
||||||
@@ -44,8 +44,8 @@ record:
|
|||||||
LACONIC_HOSTED_CONFIG_lit_relay_api_key: 15DDD969-E75F-404D-AAD9-58A37C4FD354_snowball
|
LACONIC_HOSTED_CONFIG_lit_relay_api_key: 15DDD969-E75F-404D-AAD9-58A37C4FD354_snowball
|
||||||
LACONIC_HOSTED_CONFIG_aplchemy_api_key: THvPart_gqI5x02RNYSBntlmwA66I_qc
|
LACONIC_HOSTED_CONFIG_aplchemy_api_key: THvPart_gqI5x02RNYSBntlmwA66I_qc
|
||||||
LACONIC_HOSTED_CONFIG_bugsnag_api_key: 8c480cd5386079f9dd44f9581264a073
|
LACONIC_HOSTED_CONFIG_bugsnag_api_key: 8c480cd5386079f9dd44f9581264a073
|
||||||
LACONIC_HOSTED_CONFIG_passkey_wallet_rpid: dashboard.staging.apps.snowballtools.com
|
LACONIC_HOSTED_CONFIG_passkey_wallet_rpid: localhost
|
||||||
LACONIC_HOSTED_CONFIG_turnkey_api_base_url: https://api.turnkey.com
|
LACONIC_HOSTED_CONFIG_turnkey_api_base_url: https://api.turnkey.com/
|
||||||
LACONIC_HOSTED_CONFIG_turnkey_organization_id: 5049ae99-5bca-40b3-8317-504384d4e591
|
LACONIC_HOSTED_CONFIG_turnkey_organization_id: 5049ae99-5bca-40b3-8317-504384d4e591
|
||||||
meta:
|
meta:
|
||||||
note: Added by Snowball @ $CURRENT_DATE_TIME
|
note: Added by Snowball @ $CURRENT_DATE_TIME
|
||||||
@@ -70,13 +70,7 @@ echo "Files generated successfully."
|
|||||||
RECORD_FILE=staging-records/application-record.yml
|
RECORD_FILE=staging-records/application-record.yml
|
||||||
|
|
||||||
# Publish ApplicationRecord
|
# Publish ApplicationRecord
|
||||||
publish_response=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE)
|
RECORD_ID=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE | jq -r '.id')
|
||||||
rc=$?
|
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to publish record"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
RECORD_ID=$(echo $publish_response | jq -r '.id')
|
|
||||||
echo "ApplicationRecord published"
|
echo "ApplicationRecord published"
|
||||||
echo $RECORD_ID
|
echo $RECORD_ID
|
||||||
|
|
||||||
@@ -85,36 +79,15 @@ REGISTRY_APP_CRN="crn://staging-snowballtools/applications/staging-snowballtools
|
|||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${PACKAGE_VERSION}" "$RECORD_ID"
|
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${PACKAGE_VERSION}" "$RECORD_ID"
|
||||||
rc=$?
|
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to set name: $REGISTRY_APP_CRN@${PACKAGE_VERSION}"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
sleep 2
|
sleep 2
|
||||||
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${LATEST_HASH}" "$RECORD_ID"
|
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN@${LATEST_HASH}" "$RECORD_ID"
|
||||||
rc=$?
|
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to set hash"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
sleep 2
|
sleep 2
|
||||||
# Set name if latest release
|
# Set name if latest release
|
||||||
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN" "$RECORD_ID"
|
yarn --silent laconic -c $CONFIG_FILE cns name set "$REGISTRY_APP_CRN" "$RECORD_ID"
|
||||||
rc=$?
|
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to set release"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
echo "$REGISTRY_APP_CRN set for ApplicationRecord"
|
echo "$REGISTRY_APP_CRN set for ApplicationRecord"
|
||||||
|
|
||||||
# Check if record found for REGISTRY_APP_CRN
|
# Check if record found for REGISTRY_APP_CRN
|
||||||
query_response=$(yarn --silent laconic -c $CONFIG_FILE cns name resolve "$REGISTRY_APP_CRN")
|
APP_RECORD=$(yarn --silent laconic -c $CONFIG_FILE cns name resolve "$REGISTRY_APP_CRN" | jq '.[0]')
|
||||||
rc=$?
|
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to query name"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
APP_RECORD=$(echo $query_response | jq '.[0]')
|
|
||||||
if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then
|
if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then
|
||||||
echo "No record found for $REGISTRY_APP_CRN."
|
echo "No record found for $REGISTRY_APP_CRN."
|
||||||
exit 1
|
exit 1
|
||||||
@@ -123,11 +96,6 @@ fi
|
|||||||
RECORD_FILE=staging-records/application-deployment-request.yml
|
RECORD_FILE=staging-records/application-deployment-request.yml
|
||||||
|
|
||||||
sleep 2
|
sleep 2
|
||||||
deployment_response=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE)
|
DEPLOYMENT_REQUEST_ID=$(yarn --silent laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE | jq -r '.id')
|
||||||
if [ $rc -ne 0 ]; then
|
|
||||||
echo "FATAL: Failed to query deployment request"
|
|
||||||
exit $rc
|
|
||||||
fi
|
|
||||||
DEPLOYMENT_REQUEST_ID=$(echo $deployment_response | jq -r '.id')
|
|
||||||
echo "ApplicationDeploymentRequest published"
|
echo "ApplicationDeploymentRequest published"
|
||||||
echo $DEPLOYMENT_REQUEST_ID
|
echo $DEPLOYMENT_REQUEST_ID
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ record:
|
|||||||
LACONIC_HOSTED_CONFIG_app_wallet_connect_id: eda9ba18042a5ea500f358194611ece2
|
LACONIC_HOSTED_CONFIG_app_wallet_connect_id: eda9ba18042a5ea500f358194611ece2
|
||||||
meta:
|
meta:
|
||||||
note: Added by Snowball @ Thu Apr 4 14:49:41 UTC 2024
|
note: Added by Snowball @ Thu Apr 4 14:49:41 UTC 2024
|
||||||
repository: "https://github.com/snowball-tools/snowballtools-base"
|
repository: "https://git.vdb.to/cerc-io/snowballtools-base"
|
||||||
repository_ref: 351db16336eacc3e1f9119ceb8d1282b8e27a27e
|
repository_ref: 351db16336eacc3e1f9119ceb8d1282b8e27a27e
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ record:
|
|||||||
type: ApplicationRecord
|
type: ApplicationRecord
|
||||||
version: 0.0.2
|
version: 0.0.2
|
||||||
repository_ref: 351db16336eacc3e1f9119ceb8d1282b8e27a27e
|
repository_ref: 351db16336eacc3e1f9119ceb8d1282b8e27a27e
|
||||||
repository: ["https://github.com/snowball-tools/snowballtools-base"]
|
repository: ["https://git.vdb.to/cerc-io/snowballtools-base"]
|
||||||
app_type: webapp
|
app_type: webapp
|
||||||
name: snowballtools-base-frontend
|
name: snowballtools-base-frontend
|
||||||
app_version: 0.1.8
|
app_version: 0.1.8
|
||||||
|
|||||||
@@ -20,5 +20,5 @@ record:
|
|||||||
LACONIC_HOSTED_CONFIG_turnkey_organization_id: 5049ae99-5bca-40b3-8317-504384d4e591
|
LACONIC_HOSTED_CONFIG_turnkey_organization_id: 5049ae99-5bca-40b3-8317-504384d4e591
|
||||||
meta:
|
meta:
|
||||||
note: Added by Snowball @ Tuesday 21 May 2024 06:17:23 AM UTC
|
note: Added by Snowball @ Tuesday 21 May 2024 06:17:23 AM UTC
|
||||||
repository: "https://github.com/snowball-tools/snowballtools-base"
|
repository: "https://git.vdb.to/cerc-io/snowballtools-base"
|
||||||
repository_ref: 8488cfab8353321ed05c4234bf1b914c9ad3aa99
|
repository_ref: 8488cfab8353321ed05c4234bf1b914c9ad3aa99
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ record:
|
|||||||
type: ApplicationRecord
|
type: ApplicationRecord
|
||||||
version: 0.0.2
|
version: 0.0.2
|
||||||
repository_ref: 8488cfab8353321ed05c4234bf1b914c9ad3aa99
|
repository_ref: 8488cfab8353321ed05c4234bf1b914c9ad3aa99
|
||||||
repository: ["https://github.com/snowball-tools/snowballtools-base"]
|
repository: ["https://git.vdb.to/cerc-io/snowballtools-base"]
|
||||||
app_type: webapp
|
app_type: webapp
|
||||||
name: staging-snowballtools-base-frontend
|
name: staging-snowballtools-base-frontend
|
||||||
app_version: 0.0.0
|
app_version: 0.0.0
|
||||||
|
|||||||
+37
-27
@@ -1,8 +1,13 @@
|
|||||||
import { CopyBlock, atomOneLight } from 'react-code-blocks';
|
import { CopyBlock, atomOneLight } from 'react-code-blocks';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import { Modal } from 'components/shared/Modal';
|
import {
|
||||||
import { Button } from 'components/shared/Button';
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogHeader,
|
||||||
|
DialogBody,
|
||||||
|
DialogFooter,
|
||||||
|
} from '@snowballtools/material-tailwind-react-fork';
|
||||||
|
|
||||||
interface AssignDomainProps {
|
interface AssignDomainProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@@ -11,31 +16,36 @@ interface AssignDomainProps {
|
|||||||
|
|
||||||
const AssignDomainDialog = ({ open, handleOpen }: AssignDomainProps) => {
|
const AssignDomainDialog = ({ open, handleOpen }: AssignDomainProps) => {
|
||||||
return (
|
return (
|
||||||
<Modal open={open} onOpenChange={handleOpen}>
|
<Dialog open={open} handler={handleOpen}>
|
||||||
<Modal.Content>
|
<DialogHeader>Assign Domain</DialogHeader>
|
||||||
<Modal.Header>Assign Domain</Modal.Header>
|
<DialogBody>
|
||||||
<Modal.Body>
|
In order to assign a domain to your production deployments, configure it
|
||||||
In order to assign a domain to your production deployments, configure
|
in the{' '}
|
||||||
it in the{' '}
|
{/* TODO: Fix selection of project settings tab on navigation to domains */}
|
||||||
{/* TODO: Fix selection of project settings tab on navigation to domains */}
|
<Link to="../settings/domains" className="text-light-blue-800 inline">
|
||||||
<Link to="../settings/domains" className="text-light-blue-800 inline">
|
project settings{' '}
|
||||||
project settings{' '}
|
</Link>
|
||||||
</Link>
|
(recommended). If you want to assign to this specific deployment,
|
||||||
(recommended). If you want to assign to this specific deployment,
|
however, you can do so using our command-line interface:
|
||||||
however, you can do so using our command-line interface:
|
{/* https://github.com/rajinwonderland/react-code-blocks/issues/138 */}
|
||||||
{/* https://github.com/rajinwonderland/react-code-blocks/issues/138 */}
|
<CopyBlock
|
||||||
<CopyBlock
|
text="snowball alias <deployment> <domain>"
|
||||||
text="snowball alias <deployment> <domain>"
|
language=""
|
||||||
language=""
|
showLineNumbers={false}
|
||||||
showLineNumbers={false}
|
theme={atomOneLight}
|
||||||
theme={atomOneLight}
|
/>
|
||||||
/>
|
</DialogBody>
|
||||||
</Modal.Body>
|
<DialogFooter className="flex justify-start">
|
||||||
<Modal.Footer className="flex justify-start">
|
<Button
|
||||||
<Button onClick={handleOpen}>Okay</Button>
|
className="rounded-3xl"
|
||||||
</Modal.Footer>
|
variant="gradient"
|
||||||
</Modal.Content>
|
color="blue"
|
||||||
</Modal>
|
onClick={handleOpen}
|
||||||
|
>
|
||||||
|
<span>Okay</span>
|
||||||
|
</Button>
|
||||||
|
</DialogFooter>
|
||||||
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,5 @@
|
|||||||
import { useState, ComponentPropsWithRef } from 'react';
|
import { useState } from 'react';
|
||||||
|
import toast from 'react-hot-toast';
|
||||||
import {
|
|
||||||
Menu,
|
|
||||||
MenuHandler,
|
|
||||||
MenuItem,
|
|
||||||
MenuList,
|
|
||||||
} from '@snowballtools/material-tailwind-react-fork';
|
|
||||||
|
|
||||||
import { Deployment, Domain, Environment, Project } from 'gql-client';
|
import { Deployment, Domain, Environment, Project } from 'gql-client';
|
||||||
import { Button } from 'components/shared/Button';
|
import { Button } from 'components/shared/Button';
|
||||||
import {
|
import {
|
||||||
@@ -18,11 +11,17 @@ import {
|
|||||||
UndoIcon,
|
UndoIcon,
|
||||||
CrossCircleIcon,
|
CrossCircleIcon,
|
||||||
} from 'components/shared/CustomIcon';
|
} from 'components/shared/CustomIcon';
|
||||||
|
import {
|
||||||
|
Menu,
|
||||||
|
MenuHandler,
|
||||||
|
MenuItem,
|
||||||
|
MenuList,
|
||||||
|
} from '@snowballtools/material-tailwind-react-fork';
|
||||||
|
import { ComponentPropsWithRef } from 'react';
|
||||||
import AssignDomainDialog from './AssignDomainDialog';
|
import AssignDomainDialog from './AssignDomainDialog';
|
||||||
import { useGQLClient } from 'context/GQLClientContext';
|
import { useGQLClient } from 'context/GQLClientContext';
|
||||||
import { cn } from 'utils/classnames';
|
import { cn } from 'utils/classnames';
|
||||||
import { ChangeStateToProductionDialog } from 'components/projects/Dialog/ChangeStateToProductionDialog';
|
import { ChangeStateToProductionDialog } from 'components/projects/Dialog/ChangeStateToProductionDialog';
|
||||||
import { useToast } from 'components/shared/Toast';
|
|
||||||
|
|
||||||
interface DeploymentMenuProps extends ComponentPropsWithRef<'div'> {
|
interface DeploymentMenuProps extends ComponentPropsWithRef<'div'> {
|
||||||
deployment: Deployment;
|
deployment: Deployment;
|
||||||
@@ -42,7 +41,6 @@ export const DeploymentMenu = ({
|
|||||||
...props
|
...props
|
||||||
}: DeploymentMenuProps) => {
|
}: DeploymentMenuProps) => {
|
||||||
const client = useGQLClient();
|
const client = useGQLClient();
|
||||||
const { toast, dismiss } = useToast();
|
|
||||||
|
|
||||||
const [changeToProduction, setChangeToProduction] = useState(false);
|
const [changeToProduction, setChangeToProduction] = useState(false);
|
||||||
const [redeployToProduction, setRedeployToProduction] = useState(false);
|
const [redeployToProduction, setRedeployToProduction] = useState(false);
|
||||||
@@ -53,19 +51,9 @@ export const DeploymentMenu = ({
|
|||||||
const isUpdated = await client.updateDeploymentToProd(deployment.id);
|
const isUpdated = await client.updateDeploymentToProd(deployment.id);
|
||||||
if (isUpdated) {
|
if (isUpdated) {
|
||||||
await onUpdate();
|
await onUpdate();
|
||||||
toast({
|
toast.success('Deployment changed to production');
|
||||||
id: 'deployment_changed_to_production',
|
|
||||||
title: 'Deployment changed to production',
|
|
||||||
variant: 'success',
|
|
||||||
onDismiss: dismiss,
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
toast({
|
toast.error('Unable to change deployment to production');
|
||||||
id: 'deployment_not_changed_to_production',
|
|
||||||
title: 'Error changing deployment to production',
|
|
||||||
variant: 'error',
|
|
||||||
onDismiss: dismiss,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -73,19 +61,9 @@ export const DeploymentMenu = ({
|
|||||||
const isRedeployed = await client.redeployToProd(deployment.id);
|
const isRedeployed = await client.redeployToProd(deployment.id);
|
||||||
if (isRedeployed) {
|
if (isRedeployed) {
|
||||||
await onUpdate();
|
await onUpdate();
|
||||||
toast({
|
toast.success('Redeployed to production');
|
||||||
id: 'redeployed_to_production',
|
|
||||||
title: 'Redeployed to production',
|
|
||||||
variant: 'success',
|
|
||||||
onDismiss: dismiss,
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
toast({
|
toast.error('Unable to redeploy to production');
|
||||||
id: 'redeployed_to_production_failed',
|
|
||||||
title: 'Error redeploying to production',
|
|
||||||
variant: 'error',
|
|
||||||
onDismiss: dismiss,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -96,19 +74,9 @@ export const DeploymentMenu = ({
|
|||||||
);
|
);
|
||||||
if (isRollbacked) {
|
if (isRollbacked) {
|
||||||
await onUpdate();
|
await onUpdate();
|
||||||
toast({
|
toast.success('Deployment rolled back');
|
||||||
id: 'deployment_rolled_back',
|
|
||||||
title: 'Deployment rolled back',
|
|
||||||
variant: 'success',
|
|
||||||
onDismiss: dismiss,
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
toast({
|
toast.error('Unable to rollback deployment');
|
||||||
id: 'deployment_rollback_failed',
|
|
||||||
title: 'Error rolling back deployment',
|
|
||||||
variant: 'error',
|
|
||||||
onDismiss: dismiss,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -116,19 +84,9 @@ export const DeploymentMenu = ({
|
|||||||
const isDeleted = await client.deleteDeployment(deployment.id);
|
const isDeleted = await client.deleteDeployment(deployment.id);
|
||||||
if (isDeleted) {
|
if (isDeleted) {
|
||||||
await onUpdate();
|
await onUpdate();
|
||||||
toast({
|
toast.success('Deleted deployment');
|
||||||
id: 'deployment_deleted',
|
|
||||||
title: 'Deployment deleted',
|
|
||||||
variant: 'success',
|
|
||||||
onDismiss: dismiss,
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
toast({
|
toast.error('Unable to delete deployment');
|
||||||
id: 'deployment_not_deleted',
|
|
||||||
title: 'Error deleting deployment',
|
|
||||||
variant: 'error',
|
|
||||||
onDismiss: dismiss,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10575,11 +10575,6 @@ exponential-backoff@^3.1.1:
|
|||||||
resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6"
|
resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6"
|
||||||
integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==
|
integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==
|
||||||
|
|
||||||
express-async-errors@^3.1.1:
|
|
||||||
version "3.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/express-async-errors/-/express-async-errors-3.1.1.tgz#6053236d61d21ddef4892d6bd1d736889fc9da41"
|
|
||||||
integrity sha512-h6aK1da4tpqWSbyCa3FxB/V6Ehd4EEB15zyQq9qe75OZBp0krinNKuH4rAY+S/U/2I36vdLAUFSjQJ+TFmODng==
|
|
||||||
|
|
||||||
express-session@^1.18.0:
|
express-session@^1.18.0:
|
||||||
version "1.18.0"
|
version "1.18.0"
|
||||||
resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.18.0.tgz#a6ae39d9091f2efba5f20fc5c65a3ce7c9ce16a3"
|
resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.18.0.tgz#a6ae39d9091f2efba5f20fc5c65a3ce7c9ce16a3"
|
||||||
|
|||||||
Reference in New Issue
Block a user