Signup fix (#798)

Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov
2022-01-11 14:35:21 +01:00
committed by GitHub
parent 459d7b3261
commit d188eaec91
11 changed files with 71 additions and 36 deletions
+6 -2
View File
@@ -10653,13 +10653,14 @@ packages:
dev: false
file:projects/account.tgz:
resolution: {integrity: sha512-g8Jj5vatEBYxczIayNpyhAJypuGS17w8t4htZB0ljRlctQ9IQ69fMKfuVYDb8OTKMZuhuadDthRAqqsJevuxvA==, tarball: file:projects/account.tgz}
resolution: {integrity: sha512-/BBGpjzh87DsWYJmHFtYyTBH2FerxHMoGT3xQ4A5IHVtKmx2gTP5mdaY09h+vaNp+a4iTs5rqa7h+Y7l/5uX2w==, tarball: file:projects/account.tgz}
name: '@rush-temp/account'
version: 0.0.0
dependencies:
'@rushstack/heft': 0.41.8
'@types/heft-jest': 1.0.2
'@types/minio': 7.0.11
'@types/ws': 8.2.2
'@typescript-eslint/eslint-plugin': 5.7.0_c25e8c1f4f4f7aaed27aa6f9ce042237
'@typescript-eslint/parser': 5.7.0_eslint@7.32.0+typescript@4.5.4
eslint: 7.32.0
@@ -10672,8 +10673,11 @@ packages:
mongodb: 4.2.2
prettier: 2.5.1
typescript: 4.5.4
ws: 8.3.0
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
dev: false
file:projects/activity-assets.tgz:
@@ -10922,7 +10926,7 @@ packages:
dev: false
file:projects/contact-resources.tgz_096c09b0b673a57c275d9767a12070b1:
resolution: {integrity: sha512-4SUPVPcAFE83qvwymkwI7i+z0ioEgAmM+H08vsjXRkEeD0vOlRLD3tEBX+0W49mL93EZG0TUEPP8zPcl7wiiAg==, tarball: file:projects/contact-resources.tgz}
resolution: {integrity: sha512-5c2Hkvtnj+3t/r1Z+RFQuoxDwYm6ndTPCxFns6PK3SqCs/KfWREism8tiswJXrB2FNSQkb2CE7yvsftKZFcbPQ==, tarball: file:projects/contact-resources.tgz}
id: file:projects/contact-resources.tgz
name: '@rush-temp/contact-resources'
version: 0.0.0
+2
View File
@@ -42,6 +42,8 @@ services:
image: anticrm/account
links:
- mongodb
- minio
- transactor
ports:
- 3000:3000
environment:
+10 -9
View File
@@ -18,13 +18,14 @@ import { createApp } from '@anticrm/ui'
import { configurePlatform } from './platform'
import { configurePlatformDev, configurePlatformDevServer } from './platform-dev'
configurePlatform()
configurePlatform().then(() => {
if (process.env.CLIENT_TYPE === 'dev') {
configurePlatformDev()
}
if (process.env.CLIENT_TYPE === 'dev-server') {
configurePlatformDevServer()
}
createApp(document.body)
})
if (process.env.CLIENT_TYPE === 'dev') {
configurePlatformDev()
}
if (process.env.CLIENT_TYPE === 'dev-server') {
configurePlatformDevServer()
}
createApp(document.body)
+3 -2
View File
@@ -17,5 +17,6 @@
import { createApp } from '@anticrm/ui'
import { configurePlatform } from './platform'
configurePlatform()
createApp(document.body)
configurePlatform().then(() => {
createApp(document.body)
})
+2 -2
View File
@@ -45,8 +45,8 @@ import '@anticrm/gmail-assets'
import '@anticrm/workbench-assets'
import { setMetadata } from '@anticrm/platform'
export function configurePlatform() {
fetch('/config.json').then(config => {
export async function configurePlatform() {
await fetch('/config.json').then(config => {
config.json().then(value => {
console.log('loading configuration', value)
setMetadata(login.metadata.AccountsUrl, value.ACCOUNTS_URL)
+4 -1
View File
@@ -22,6 +22,9 @@
"SelectWorkspace": "Select workspace",
"Copy": "Copy",
"Close": "Close",
"InviteDescription": "Share this link to invite other users"
"InviteDescription": "Share this link to invite other users",
"WantAnotherWorkspace": "Want to create another workspace?",
"ChangeAccount": "Change account",
"NotSeeingWorkspace": "Not seeing your workspace?"
}
}
@@ -45,6 +45,13 @@
loc.path.length = 2
navigate(loc)
}
function changeAccount (): void {
const loc = getCurrentLocation()
loc.path[1] = 'login'
loc.path.length = 2
navigate(loc)
}
</script>
<form class="container">
@@ -72,8 +79,14 @@
<div class="grow-separator" />
{#if workspaces.length}
<div class="footer">
<span><Label label={login.string.CreateWorkspace} /></span>
<a href="." on:click|preventDefault={createWorkspace}><Label label={login.string.CreateWorkspace} /></a>
<div>
<span><Label label={login.string.WantAnotherWorkspace} /></span>
<a href="." on:click|preventDefault={createWorkspace}><Label label={login.string.CreateWorkspace} /></a>
</div>
<div>
<span><Label label={login.string.NotSeeingWorkspace} /></span>
<a href="." on:click|preventDefault={changeAccount}><Label label={login.string.ChangeAccount} /></a>
</div>
</div>
{/if}
{/await}
+4 -1
View File
@@ -43,6 +43,9 @@ export default mergeIds(loginId, login, {
DoNotHaveAnAccount: '' as IntlString,
Copy: '' as IntlString,
Close: '' as IntlString,
InviteDescription: '' as IntlString
InviteDescription: '' as IntlString,
WantAnotherWorkspace: '' as IntlString,
NotSeeingWorkspace: '' as IntlString,
ChangeAccount: '' as IntlString
}
})
+4 -2
View File
@@ -24,7 +24,8 @@
"prettier": "^2.4.1",
"@rushstack/heft": "^0.41.1",
"typescript": "^4.3.5",
"@types/minio": "^7.0.10"
"@types/minio": "^7.0.10",
"@types/ws": "^8.2.1"
},
"dependencies": {
"mongodb": "^4.1.1",
@@ -35,6 +36,7 @@
"@anticrm/contact": "~0.6.2",
"@anticrm/client-resources": "~0.6.4",
"@anticrm/client": "~0.6.1",
"jwt-simple": "~0.5.6"
"jwt-simple": "~0.5.6",
"ws": "^8.2.0"
}
}
+16 -13
View File
@@ -379,22 +379,25 @@ export async function assignWorkspace (db: Db, email: string, workspace: string)
async function createEmployeeAccount (account: Account, workspace: string): Promise<void> {
const connection = await connect(getEndpoint(), workspace, account.email)
const ops = new TxOperations(connection, core.account.System)
try {
const ops = new TxOperations(connection, core.account.System)
const name = combineName(account.first, account.last)
const name = combineName(account.first, account.last)
const employee = await ops.createDoc(contact.class.Employee, contact.space.Employee, {
name,
city: '',
channels: []
})
const employee = await ops.createDoc(contact.class.Employee, contact.space.Employee, {
name,
city: '',
channels: []
})
await ops.createDoc(contact.class.EmployeeAccount, core.space.Model, {
email: account.email,
employee,
name
})
await connection.close()
await ops.createDoc(contact.class.EmployeeAccount, core.space.Model, {
email: account.email,
employee,
name
})
} finally {
await connection.close()
}
}
/**
+5 -2
View File
@@ -74,8 +74,11 @@ export async function initWorkspace (transactorUrl: string, dbName: string): Pro
console.log('creating data...')
const connection = await connect(transactorUrl, dbName)
await createDeps(connection)
await connection.close()
try {
await createDeps(connection)
} finally {
await connection.close()
}
console.log('create minio bucket')
if (!(await minio.bucketExists(dbName))) {