mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 11:50:56 +00:00
Extract github domains (#7420)
Some checks are pending
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
Some checks are pending
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
d3e74aeba0
commit
087cf2a43f
@ -251,6 +251,15 @@ const docSyncInfo: Schema = {
|
||||
}
|
||||
}
|
||||
|
||||
const githubLogin: Schema = {
|
||||
...baseSchema,
|
||||
login: {
|
||||
type: 'text',
|
||||
notNull: true,
|
||||
index: true
|
||||
}
|
||||
}
|
||||
|
||||
export function addSchema (domain: string, schema: Schema): void {
|
||||
domainSchemas[translateDomain(domain)] = schema
|
||||
domainSchemaFields.set(domain, createSchemaFields(schema))
|
||||
@ -271,7 +280,8 @@ export const domainSchemas: Record<string, Schema> = {
|
||||
notification: notificationSchema,
|
||||
[translateDomain('notification-dnc')]: dncSchema,
|
||||
[translateDomain('notification-user')]: userNotificationSchema,
|
||||
github: docSyncInfo
|
||||
[translateDomain('github_sync')]: docSyncInfo,
|
||||
[translateDomain('github_user')]: githubLogin
|
||||
}
|
||||
|
||||
export function getSchema (domain: string): Schema {
|
||||
|
@ -95,9 +95,11 @@ export { githubId } from '@hcengineering/github'
|
||||
export { githubOperation, githubOperationPreTime } from './migration'
|
||||
export { default } from './plugin'
|
||||
export const DOMAIN_GITHUB = 'github' as Domain
|
||||
export const DOMAIN_GITHUB_SYNC = 'github_sync' as Domain
|
||||
export const DOMAIN_GITHUB_USER = 'github_user' as Domain
|
||||
export const DOMAIN_GITHUB_COMMENTS = 'github_comments' as Domain
|
||||
|
||||
@Model(github.class.DocSyncInfo, core.class.Doc, DOMAIN_GITHUB)
|
||||
@Model(github.class.DocSyncInfo, core.class.Doc, DOMAIN_GITHUB_SYNC)
|
||||
export class TDocSyncInfo extends TDoc implements DocSyncInfo {
|
||||
// _id === objectId
|
||||
@Prop(TypeNumber(), getEmbeddedLabel('Github number'))
|
||||
@ -152,7 +154,7 @@ export class TDocSyncInfo extends TDoc implements DocSyncInfo {
|
||||
deleted!: boolean
|
||||
}
|
||||
|
||||
@Model(github.class.GithubUserInfo, core.class.Doc, DOMAIN_GITHUB)
|
||||
@Model(github.class.GithubUserInfo, core.class.Doc, DOMAIN_GITHUB_USER)
|
||||
export class TGithubUserInfo extends TDoc implements GithubUserInfo {
|
||||
@Prop(TypeString(), getEmbeddedLabel('ID'))
|
||||
@ReadOnly()
|
||||
|
@ -32,7 +32,7 @@ import github from './plugin'
|
||||
import { DOMAIN_TIME } from '@hcengineering/model-time'
|
||||
import { DOMAIN_TRACKER } from '@hcengineering/model-tracker'
|
||||
import time from '@hcengineering/time'
|
||||
import { DOMAIN_GITHUB } from '.'
|
||||
import { DOMAIN_GITHUB, DOMAIN_GITHUB_SYNC, DOMAIN_GITHUB_USER } from '.'
|
||||
|
||||
export async function guessStatus (status: Status, statuses: Status[]): Promise<Status> {
|
||||
const active = (): Status => statuses.find((it) => it.category === task.statusCategory.Active) as Status
|
||||
@ -328,6 +328,13 @@ export const githubOperationPreTime: MigrateOperation = {
|
||||
func: async (client) => {
|
||||
await client.deleteMany(DOMAIN_TX, { objectClass: github.class.DocSyncInfo })
|
||||
}
|
||||
},
|
||||
{
|
||||
state: 'migrate-github-sync-domain',
|
||||
func: async (client) => {
|
||||
await client.move(DOMAIN_GITHUB, { _class: github.class.DocSyncInfo }, DOMAIN_GITHUB_SYNC)
|
||||
await client.move(DOMAIN_GITHUB, { _class: github.class.GithubUserInfo }, DOMAIN_GITHUB_USER)
|
||||
}
|
||||
}
|
||||
])
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user