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

TSK-651: Fix Team editing #2611

Merged
merged 1 commit into from
Feb 9, 2023
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
395 changes: 226 additions & 169 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions dev/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ services:
- MINIO_ENDPOINT=minio
- MINIO_ACCESS_KEY=minioadmin
- MINIO_SECRET_KEY=minioadmin
- FRONT_URL=http://localhost:8087
- FRONT_URL=http://front:8080
- SES_URL=http://localhost:8091
restart: unless-stopped
collaborator:
Expand Down Expand Up @@ -87,8 +87,9 @@ services:
- SERVER_PORT=8080
- SERVER_SECRET=secret
- ACCOUNTS_URL=http://localhost:3000
- REKONI_URL=http://localhost:4004
- COLLABORATOR_URL=ws://localhost:3078
- FRONT_URL=http://localhost:8087
- FRONT_URL=http://front:8080
- UPLOAD_URL=/files
- TRANSACTOR_URL=ws://localhost:3333
- ELASTIC_URL=http://elastic:9200
Expand Down
23 changes: 6 additions & 17 deletions dev/generator/src/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,16 @@ import faker from 'faker'

import contact from '@hcengineering/contact'
import core, {
TxOperations,
MeasureMetricsContext,
metricsToString,
AttachedData,
generateId,
MeasureMetricsContext,
metricsToString,
Ref,
SortingOrder,
TxOperations,
WorkspaceId
} from '@hcengineering/core'
import tracker, {
calcRank,
Issue,
IssuePriority,
IssueStatus,
TimeReportDayType,
WorkDayLength
} from '../../../plugins/tracker/lib'
import tracker, { calcRank, Issue, IssuePriority, IssueStatus } from '../../../plugins/tracker/lib'

import { connect } from './connect'

Expand All @@ -42,9 +35,7 @@ const object: AttachedData<Issue> = {
reportedTime: 0,
estimation: 0,
reports: 0,
childInfo: [],
workDayLength: WorkDayLength.EIGHT_HOURS,
defaultTimeReportDay: TimeReportDayType.PreviousWorkDay
childInfo: []
}

export interface IssueOptions {
Expand Down Expand Up @@ -106,9 +97,7 @@ async function genIssue (client: TxOperations): Promise<void> {
estimation: object.estimation,
reports: 0,
relations: [],
childInfo: [],
workDayLength: object.workDayLength,
defaultTimeReportDay: object.defaultTimeReportDay
childInfo: []
}
await client.addCollection(
tracker.class.Issue,
Expand Down
2 changes: 1 addition & 1 deletion dev/prod/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ LOGIN_ENDPOINT=ws://localhost:3333

TELEGRAM_URL=http://localhost:8086
GMAIL_URL=http://localhost:8088
FRONT_URL=http://localhost:8080
FRONT_URL=http://front:8080

REKONI_URL=http://localhost:4004

Expand Down
3 changes: 2 additions & 1 deletion dev/prod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"postcss-loader": "^7.0.2",
"postcss-load-config": "^4.0.1",
"compression-webpack-plugin": "^10.0.0",
"html-webpack-plugin": "^5.5.0"
"html-webpack-plugin": "^5.5.0",
"fork-ts-checker-webpack-plugin": "~7.3.0"
},
"dependencies": {
"@hcengineering/platform": "^0.6.8",
Expand Down
27 changes: 23 additions & 4 deletions dev/prod/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ const CompressionPlugin = require('compression-webpack-plugin')
const DefinePlugin = require('webpack').DefinePlugin
const { resolve } = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { Configuration } = require('webpack')

const mode = process.env.NODE_ENV || 'development'
const prod = mode === 'production'
const devServer = (process.env.CLIENT_TYPE ?? '') === 'dev-server'
const dev = (process.env.CLIENT_TYPE ?? '') === 'dev' || devServer
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');

/**
* @type {Configuration}
*/
module.exports = {
entry: {
bundle: [
Expand Down Expand Up @@ -57,14 +62,21 @@ module.exports = {
path: __dirname + '/dist',
filename: '[name].[contenthash].js',
chunkFilename: '[name].[contenthash].js',
publicPath: '/'
publicPath: '/',
pathinfo: false
},
optimization: {
minimize: prod
},
module: {
rules: [
{
test: /\.ts?$/,
use: 'ts-loader',
exclude: /node_modules/
loader:'ts-loader',
options: {
transpileOnly: true
},
exclude: /node_modules/,
},
{
test: /\.svelte$/,
Expand Down Expand Up @@ -190,8 +202,15 @@ module.exports = {
new Dotenv({path: prod ? '.env-prod' : '.env'}),
new DefinePlugin({
'process.env.CLIENT_TYPE': JSON.stringify(process.env.CLIENT_TYPE)
})
}),
new ForkTsCheckerWebpackPlugin()
],
watchOptions: {
// for some systems, watching many files can result in a lot of CPU or memory usage
// https://webpack.js.org/configuration/watch/#watchoptionsignored
// don't use this pattern, if you have a monorepo with linked packages
ignored: /node_modules/,
},
devtool: prod ? false : 'inline-source-map',
devServer: {
static: {
Expand Down
18 changes: 18 additions & 0 deletions models/recruit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,24 @@ export function createModel (builder: Builder): void {
},
recruit.action.MoveApplicant
)

createAction(
builder,
{
label: recruit.string.RecognizeAttachment,
action: recruit.actionImpl.MoveApplicant,
icon: view.icon.Move,
input: 'any',
category: view.category.General,
target: recruit.class.Applicant,
context: {
mode: ['context', 'browser'],
group: 'tools'
},
override: [task.action.Move]
},
recruit.action.MoveApplicant
)
}

export { recruitOperation } from './migration'
Expand Down
3 changes: 2 additions & 1 deletion models/recruit/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export default mergeIds(recruitId, recruit, {
GotoAssigned: '' as IntlString,
GotoApplicants: '' as IntlString,
GotoRecruitApplication: '' as IntlString,
VacancyList: '' as IntlString
VacancyList: '' as IntlString,
RecognizeAttachment: '' as IntlString
},
validator: {
ApplicantValidator: '' as Resource<<T extends Doc>(doc: T, client: Client) => Promise<Status>>
Expand Down
3 changes: 0 additions & 3 deletions models/tracker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@ export class TIssue extends TAttachedDoc implements Issue {
reports!: number

declare childInfo: IssueChildInfo[]

declare workDayLength: WorkDayLength
declare defaultTimeReportDay: TimeReportDayType
}

/**
Expand Down
37 changes: 4 additions & 33 deletions models/tracker/src/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,18 @@
// limitations under the License.
//

import core, {
Doc,
DocumentUpdate,
generateId,
Ref,
SortingOrder,
toIdMap,
TxOperations,
TxResult
} from '@hcengineering/core'
import core, { Doc, DocumentUpdate, generateId, Ref, SortingOrder, TxOperations, TxResult } from '@hcengineering/core'
import { createOrUpdate, MigrateOperation, MigrationClient, MigrationUpgradeClient } from '@hcengineering/model'
import tags from '@hcengineering/tags'
import {
genRanks,
Issue,
IssueStatus,
IssueStatusCategory,
Team,
genRanks,
Issue,
TimeReportDayType,
WorkDayLength
} from '@hcengineering/tracker'
import tags from '@hcengineering/tags'
import { DOMAIN_TRACKER } from '.'
import tracker from './plugin'

Expand Down Expand Up @@ -212,25 +203,6 @@ async function upgradeIssueStatuses (tx: TxOperations): Promise<void> {
}
}

async function upgradeIssueTimeReportSettings (tx: TxOperations): Promise<void> {
const issues = await tx.findAll(tracker.class.Issue, {
defaultTimeReportDay: { $exists: false },
workDayLength: { $exists: false }
})

const teams = await tx.findAll(tracker.class.Team, {
_id: { $in: Array.from(new Set(issues.map((issue) => issue.space))) }
})
const teamsById = toIdMap(teams)

await Promise.all(
issues.map((issue) => {
const team = teamsById.get(issue.space)
return tx.update(issue, { defaultTimeReportDay: team?.defaultTimeReportDay, workDayLength: team?.workDayLength })
})
)
}

async function migrateParentIssues (client: MigrationClient): Promise<void> {
let { updated } = await client.update(
DOMAIN_TRACKER,
Expand Down Expand Up @@ -363,7 +335,6 @@ async function upgradeTeams (tx: TxOperations): Promise<void> {

async function upgradeIssues (tx: TxOperations): Promise<void> {
await upgradeIssueStatuses(tx)
await upgradeIssueTimeReportSettings(tx)

const issues = await tx.findAll(tracker.class.Issue, {
$or: [{ blockedBy: { $exists: true } }, { relatedIssue: { $exists: true } }]
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/components/PopupInstance.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
on:keydown={handleKeydown}
/>

{JSON.stringify(options)}
<div
class="popup {showing === undefined ? 'endShow' : showing === false ? 'preShow' : 'startShow'}"
class:anim={element === 'float'}
Expand Down
88 changes: 0 additions & 88 deletions packages/ui/src/components/PopupItem.svelte.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@
async function createCandidate () {
const candidate: Data<Person> = {
name: combineName(firstName, lastName),
city: object.city
city: object.city,
createOn: Date.now()
}
if (avatar !== undefined) {
candidate.avatar = await avatarEditor.createAvatar()
Expand Down Expand Up @@ -349,7 +350,8 @@

async function recognize (contentType: string): Promise<void> {
const token = getMetadata(login.metadata.LoginToken) ?? ''
const fileUrl = window.location.origin + getFileUrl(resume.uuid)
const frontUrl = getMetadata(login.metadata.FrontUrl) ?? ''
const fileUrl = frontUrl + getFileUrl(resume.uuid)

try {
const doc = await recognizeDocument(token, fileUrl, contentType)
Expand Down
6 changes: 2 additions & 4 deletions plugins/recruit-resources/src/components/CreateVacancy.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import { Card, createQuery, getClient, UserBox } from '@hcengineering/presentation'
import { Vacancy as VacancyClass } from '@hcengineering/recruit'
import task, { createKanban, KanbanTemplate } from '@hcengineering/task'
import tracker, { IssueStatus, IssueTemplate, TimeReportDayType, WorkDayLength } from '@hcengineering/tracker'
import tracker, { IssueStatus, IssueTemplate } from '@hcengineering/tracker'
import { Button, Component, createFocusManager, EditBox, FocusHandler, IconAttachment } from '@hcengineering/ui'
import { createEventDispatcher } from 'svelte'
import recruit from '../plugin'
Expand Down Expand Up @@ -118,9 +118,7 @@
estimation: issueTemplate.estimation,
reports: 0,
relations: [{ _id: id, _class: recruit.class.Vacancy }],
childInfo: [],
workDayLength: WorkDayLength.EIGHT_HOURS,
defaultTimeReportDay: TimeReportDayType.PreviousWorkDay
childInfo: []
}
)
}
Expand Down
Loading