Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qfix: QMS signature dialog login info in tests #6100

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { createEventDispatcher } from 'svelte'
import login from '@hcengineering/login'
import { ERROR, IntlString, OK, Severity, Status, getMetadata, translate } from '@hcengineering/platform'
import { EditBox, StylishEdit, ModernDialog } from '@hcengineering/ui'
import { EditBox, StylishEdit, ModernDialog, fetchMetadataLocalStorage } from '@hcengineering/ui'

import documents from '../plugin'
import StatusControl from './requests/StatusControl.svelte'
Expand All @@ -33,7 +33,8 @@
let rejectionNote = ''

const accountsUrl = getMetadata(login.metadata.AccountsUrl) ?? ''
const email: string = getMetadata(login.metadata.LoginEmail) ?? ''
const email: string =
getMetadata(login.metadata.LoginEmail) ?? fetchMetadataLocalStorage(login.metadata.LoginEmail) ?? ''
const disableEmailField = email !== ''

const object: LoginInfo = {
Expand Down
16 changes: 16 additions & 0 deletions qms-tests/create-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Create init workspace
./tool-local.sh create-workspace init-ws-qms -w InitTest
./tool-local.sh configure init-ws-qms --enable=*
./tool-local.sh configure init-ws-qms --list

# Create workspace record in accounts
./tool-local.sh create-workspace sanity-ws-qms -w SanityTest
# Create user record in accounts
./tool-local.sh create-account user1 -f John -l Appleseed -p 1234
./tool-local.sh confirm-email user1
# Create second user record in accounts
./tool-local.sh create-account user2 -f Kainin -l Dirak -p 1234
./tool-local.sh confirm-email user2

./tool-local.sh create-account user_qara -f Qara -l Admin -p 1234
./tool-local.sh confirm-email user_qara
22 changes: 22 additions & 0 deletions qms-tests/restore-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

export MINIO_ACCESS_KEY=minioadmin
export MINIO_SECRET_KEY=minioadmin
export MINIO_ENDPOINT=localhost:9000
export MONGO_URL=mongodb://localhost:27017
export ELASTIC_URL=http://localhost:9200
export SERVER_SECRET=secret

# Restore workspace contents in mongo/elastic
./tool-local.sh backup-restore ./sanity-ws-qms sanity-ws-qms

./tool-local.sh upgrade-workspace sanity-ws-qms

# Re-assign user to workspace.
./tool-local.sh assign-workspace user1 sanity-ws-qms
./tool-local.sh assign-workspace user2 sanity-ws-qms
./tool-local.sh assign-workspace user_qara sanity-ws-qms
./tool-local.sh set-user-role user1 sanity-ws-qms OWNER
./tool-local.sh set-user-role user2 sanity-ws-qms OWNER

./tool-local.sh configure sanity-ws-qms --enable=*
./tool-local.sh configure sanity-ws-qms --list
12 changes: 12 additions & 0 deletions qms-tests/tool-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

export MINIO_ACCESS_KEY=minioadmin
export MINIO_SECRET_KEY=minioadmin
export MINIO_ENDPOINT=localhost:9000
export MONGO_URL=mongodb://localhost:27017
export ACCOUNTS_URL=http://localhost:3000
export TRANSACTOR_URL=ws://localhost:3333
export ELASTIC_URL=http://localhost:9200
export SERVER_SECRET=secret

# Restore workspace contents in mongo/elastic
node ../dev/tool/bundle/bundle.js $@