@things-factory/organization 7.0.0-alpha.1 → 7.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/pages/department/department-list-page.ts +305 -193
- package/client/pages/department/department-tree-page.ts +153 -403
- package/client/route.ts +4 -4
- package/client/types/department.ts +0 -8
- package/dist-client/pages/department/department-list-page.d.ts +11 -19
- package/dist-client/pages/department/department-list-page.js +305 -179
- package/dist-client/pages/department/department-list-page.js.map +1 -1
- package/dist-client/pages/department/department-tree-page.d.ts +10 -12
- package/dist-client/pages/department/department-tree-page.js +142 -382
- package/dist-client/pages/department/department-tree-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +3 -3
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/types/department.d.ts +0 -6
- package/dist-client/types/department.js +0 -5
- package/dist-client/types/department.js.map +1 -1
- package/dist-server/service/department/department-history.js +4 -15
- package/dist-server/service/department/department-history.js.map +1 -1
- package/dist-server/service/department/department-query.js +15 -10
- package/dist-server/service/department/department-query.js.map +1 -1
- package/dist-server/service/department/department-type.js +0 -8
- package/dist-server/service/department/department-type.js.map +1 -1
- package/dist-server/service/department/department.js +1 -15
- package/dist-server/service/department/department.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/server/service/department/department-history.ts +7 -31
- package/server/service/department/department-query.ts +13 -10
- package/server/service/department/department-type.ts +1 -7
- package/server/service/department/department.ts +0 -15
- package/translations/en.json +3 -0
- package/translations/ja.json +3 -0
- package/translations/ko.json +3 -0
- package/translations/ms.json +3 -0
- package/translations/zh.json +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/organization",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.3",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "dist-client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"@things-factory/contact": "^7.0.0-alpha.1",
|
|
37
37
|
"@things-factory/shell": "^7.0.0-alpha.1"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "8b545949d9f8f915251dabfc633dfb68e1270fff"
|
|
40
40
|
}
|
|
@@ -1,37 +1,22 @@
|
|
|
1
1
|
import { Field, ID, ObjectType } from 'type-graphql'
|
|
2
2
|
import { Column, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId } from 'typeorm'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
HistoryActionColumn,
|
|
6
|
-
HistoryActionType,
|
|
7
|
-
HistoryEntityInterface,
|
|
8
|
-
HistoryOriginalIdColumn
|
|
9
|
-
} from '@operato/typeorm-history'
|
|
4
|
+
import { HistoryActionColumn, HistoryActionType, HistoryEntityInterface, HistoryOriginalIdColumn } from '@operato/typeorm-history'
|
|
10
5
|
import { Role, User } from '@things-factory/auth-base'
|
|
11
6
|
import { config } from '@things-factory/env'
|
|
12
7
|
import { Domain } from '@things-factory/shell'
|
|
13
8
|
|
|
14
|
-
import { Department
|
|
9
|
+
import { Department } from './department'
|
|
15
10
|
import { Employee } from '../employee/employee'
|
|
16
11
|
|
|
17
12
|
const ORMCONFIG = config.get('ormconfig', {})
|
|
18
13
|
const DATABASE_TYPE = ORMCONFIG.type
|
|
19
14
|
|
|
20
15
|
@Entity()
|
|
21
|
-
@Index(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
)
|
|
26
|
-
@Index(
|
|
27
|
-
'ix_department_history_1',
|
|
28
|
-
(departmentHistory: DepartmentHistory) => [
|
|
29
|
-
departmentHistory.domain,
|
|
30
|
-
departmentHistory.originalId,
|
|
31
|
-
departmentHistory.version
|
|
32
|
-
],
|
|
33
|
-
{ unique: true }
|
|
34
|
-
)
|
|
16
|
+
@Index('ix_department_history_0', (departmentHistory: DepartmentHistory) => [departmentHistory.originalId, departmentHistory.version], { unique: true })
|
|
17
|
+
@Index('ix_department_history_1', (departmentHistory: DepartmentHistory) => [departmentHistory.domain, departmentHistory.originalId, departmentHistory.version], {
|
|
18
|
+
unique: true
|
|
19
|
+
})
|
|
35
20
|
@ObjectType({ description: 'History Entity of Department' })
|
|
36
21
|
export class DepartmentHistory implements HistoryEntityInterface<Department> {
|
|
37
22
|
@PrimaryGeneratedColumn('uuid')
|
|
@@ -83,10 +68,6 @@ export class DepartmentHistory implements HistoryEntityInterface<Department> {
|
|
|
83
68
|
@Field({ nullable: true })
|
|
84
69
|
active?: boolean
|
|
85
70
|
|
|
86
|
-
@Column({ nullable: true })
|
|
87
|
-
@Field({ nullable: true })
|
|
88
|
-
state?: DepartmentStatus
|
|
89
|
-
|
|
90
71
|
@Column({ nullable: true })
|
|
91
72
|
@Field({ nullable: true })
|
|
92
73
|
extension?: string
|
|
@@ -125,12 +106,7 @@ export class DepartmentHistory implements HistoryEntityInterface<Department> {
|
|
|
125
106
|
|
|
126
107
|
@HistoryActionColumn({
|
|
127
108
|
nullable: false,
|
|
128
|
-
type:
|
|
129
|
-
DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
|
|
130
|
-
? 'enum'
|
|
131
|
-
: DATABASE_TYPE == 'oracle'
|
|
132
|
-
? 'varchar2'
|
|
133
|
-
: 'smallint',
|
|
109
|
+
type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? 'enum' : DATABASE_TYPE == 'oracle' ? 'varchar2' : 'smallint',
|
|
134
110
|
enum: HistoryActionType
|
|
135
111
|
})
|
|
136
112
|
public action!: HistoryActionType
|
|
@@ -9,13 +9,20 @@ import { Employee } from '../employee/employee'
|
|
|
9
9
|
|
|
10
10
|
@Resolver(Department)
|
|
11
11
|
export class DepartmentQuery {
|
|
12
|
-
@Query(returns =>
|
|
13
|
-
async
|
|
12
|
+
@Query(returns => DepartmentList, { nullable: true, description: 'To fetch a Root Departments' })
|
|
13
|
+
async departmentRoots(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<DepartmentList> {
|
|
14
14
|
const { domain } = context.state
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const queryBuilder = getQueryBuilderFromListParams({
|
|
17
|
+
domain,
|
|
18
|
+
params,
|
|
19
|
+
repository: await getRepository(Department),
|
|
20
|
+
searchables: ['name', 'description', 'controlNo']
|
|
21
|
+
}).andWhere({ domain: { id: domain.id }, parent: { id: IsNull() } })
|
|
22
|
+
|
|
23
|
+
const [items, total] = await queryBuilder.getManyAndCount()
|
|
24
|
+
|
|
25
|
+
return { items, total }
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
@Query(returns => Department!, { nullable: true, description: 'To fetch a Department' })
|
|
@@ -64,11 +71,7 @@ export class DepartmentQuery {
|
|
|
64
71
|
}
|
|
65
72
|
|
|
66
73
|
@FieldResolver(type => [Department])
|
|
67
|
-
async children(
|
|
68
|
-
@Root() department: Department,
|
|
69
|
-
@Args() params: ListParam,
|
|
70
|
-
@Ctx() context: ResolverContext
|
|
71
|
-
): Promise<Department[]> {
|
|
74
|
+
async children(@Root() department: Department, @Args() params: ListParam, @Ctx() context: ResolverContext): Promise<Department[]> {
|
|
72
75
|
const { domain } = context.state
|
|
73
76
|
|
|
74
77
|
const queryBuilder = getQueryBuilderFromListParams({
|
|
@@ -4,7 +4,7 @@ import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-gr
|
|
|
4
4
|
|
|
5
5
|
import { ObjectRef, ScalarObject } from '@things-factory/shell'
|
|
6
6
|
|
|
7
|
-
import { Department
|
|
7
|
+
import { Department } from './department'
|
|
8
8
|
import { ObjectRefForEmployee } from '../employee/employee-type'
|
|
9
9
|
|
|
10
10
|
@InputType()
|
|
@@ -18,9 +18,6 @@ export class NewDepartment {
|
|
|
18
18
|
@Field({ nullable: true })
|
|
19
19
|
description?: string
|
|
20
20
|
|
|
21
|
-
@Field(type => DepartmentStatus, { nullable: true })
|
|
22
|
-
state?: DepartmentStatus
|
|
23
|
-
|
|
24
21
|
@Field({ nullable: true })
|
|
25
22
|
active?: boolean
|
|
26
23
|
|
|
@@ -51,9 +48,6 @@ export class DepartmentPatch {
|
|
|
51
48
|
@Field({ nullable: true })
|
|
52
49
|
description?: string
|
|
53
50
|
|
|
54
|
-
@Field(type => DepartmentStatus, { nullable: true })
|
|
55
|
-
state?: DepartmentStatus
|
|
56
|
-
|
|
57
51
|
@Field({ nullable: true })
|
|
58
52
|
active?: boolean
|
|
59
53
|
|
|
@@ -16,17 +16,6 @@ import { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
|
|
|
16
16
|
import { Domain } from '@things-factory/shell'
|
|
17
17
|
import { User } from '@things-factory/auth-base'
|
|
18
18
|
import { Employee } from '../employee/employee'
|
|
19
|
-
import { ApprovalLine } from '../approval-line/approval-line'
|
|
20
|
-
|
|
21
|
-
export enum DepartmentStatus {
|
|
22
|
-
STATUS_A = 'STATUS_A',
|
|
23
|
-
STATUS_B = 'STATUS_B'
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
registerEnumType(DepartmentStatus, {
|
|
27
|
-
name: 'DepartmentStatus',
|
|
28
|
-
description: 'state enumeration of a department'
|
|
29
|
-
})
|
|
30
19
|
|
|
31
20
|
@Entity()
|
|
32
21
|
@Index('ix_department_0', (department: Department) => [department.domain, department.name], {
|
|
@@ -92,10 +81,6 @@ export class Department {
|
|
|
92
81
|
@Field({ nullable: true })
|
|
93
82
|
active?: boolean
|
|
94
83
|
|
|
95
|
-
@Column({ nullable: true })
|
|
96
|
-
@Field({ nullable: true })
|
|
97
|
-
state?: DepartmentStatus
|
|
98
|
-
|
|
99
84
|
@Column({ nullable: true })
|
|
100
85
|
@Field({ nullable: true })
|
|
101
86
|
extension?: string
|
package/translations/en.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"button.add-child-dept": "peer dept.",
|
|
3
|
+
"button.add-sibling-dept": "sub. dept.",
|
|
2
4
|
"button.copy from": "copy from",
|
|
3
5
|
"button.detach": "detach",
|
|
4
6
|
"field.approver": "approver",
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
"title.my-approval-line template list": "my approval line template list",
|
|
35
37
|
"title.employee list": "employee list",
|
|
36
38
|
"title.department list": "department list",
|
|
39
|
+
"title.department tree": "department hierarchy",
|
|
37
40
|
"title.contact list": "contact list",
|
|
38
41
|
"title.organization": "organization",
|
|
39
42
|
"title.employees-by-department": "Employees By Department"
|
package/translations/ja.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"button.add-child-dept": "同等部門追加",
|
|
3
|
+
"button.add-sibling-dept": "下位部門追加",
|
|
2
4
|
"button.copy from": "コピーしてくる",
|
|
3
5
|
"button.detach": "連結解除",
|
|
4
6
|
"field.approver": "決裁者",
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
"title.my-approval-line template list": "マイ決裁ライン テンプレート リスト",
|
|
35
37
|
"title.employee list": "職員リスト",
|
|
36
38
|
"title.department list": "部署リスト",
|
|
39
|
+
"title.department tree": "部署階層図",
|
|
37
40
|
"title.contact list": "連絡先リスト",
|
|
38
41
|
"title.organization": "組織",
|
|
39
42
|
"title.employees-by-department": "Employees By Department"
|
package/translations/ko.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"button.add-child-dept": "동급부서",
|
|
3
|
+
"button.add-sibling-dept": "하위부서",
|
|
2
4
|
"button.copy from": "복사해오기",
|
|
3
5
|
"button.detach": "연결해제",
|
|
4
6
|
"field.approver": "결재자",
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
"title.my-approval-line template list": "나의 결재라인 템플릿 목록",
|
|
35
37
|
"title.employee list": "직원 목록",
|
|
36
38
|
"title.department list": "부서 목록",
|
|
39
|
+
"title.department tree": "부서 조직도",
|
|
37
40
|
"title.contact list": "연락처 관리",
|
|
38
41
|
"title.organization": "조직",
|
|
39
42
|
"title.employees-by-department": "부서별 직원"
|
package/translations/ms.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"button.add-child-dept": "tambah jabatan sejawat",
|
|
3
|
+
"button.add-sibling-dept": "tambah jabatan bawahan",
|
|
2
4
|
"button.copy from": "salin dari",
|
|
3
5
|
"button.detach": "lepaskan",
|
|
4
6
|
"field.approver": "penyetuju",
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
"title.my-approval-line template list": "senarai templat garis kelulusan saya",
|
|
35
37
|
"title.employee list": "senarai pekerja",
|
|
36
38
|
"title.department list": "senarai jabatan",
|
|
39
|
+
"title.department tree": "hierarki jabatan",
|
|
37
40
|
"title.contact list": "senarai kenalan",
|
|
38
41
|
"title.organization": "organisasi",
|
|
39
42
|
"title.employees-by-department": "Employees By Department"
|
package/translations/zh.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"button.add-child-dept": "添加同级部门",
|
|
3
|
+
"button.add-sibling-dept": "添加下级部门",
|
|
2
4
|
"button.copy from": "复制自",
|
|
3
5
|
"button.detach": "分离",
|
|
4
6
|
"field.approver": "审批人",
|
|
@@ -34,6 +36,7 @@
|
|
|
34
36
|
"title.my-approval-line template list": "我的审批线模板列表",
|
|
35
37
|
"title.employee list": "员工列表",
|
|
36
38
|
"title.department list": "部门列表",
|
|
39
|
+
"title.department tree": "部门层级图",
|
|
37
40
|
"title.contact list": "联系人列表",
|
|
38
41
|
"title.organization": "组织",
|
|
39
42
|
"title.employees-by-department": "Employees By Department"
|