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

Support Controlled Documents import #7541

Merged
merged 2 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Support Controlled Documents import
Signed-off-by: Anna Khismatullina <anna.khismatullina@gmail.com>
  • Loading branch information
akhismat committed Dec 25, 2024
commit 71d0c857760af7f0af93a4caf58281c29bb2bbdb
148 changes: 116 additions & 32 deletions dev/import-tool/docs/huly/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,24 @@ workspace/
│ └── files/
│ └── diagram.png # Can be referenced in markdown content
└── Project Alpha.yaml # Project configuration
├── QMS Documents/ # QMS documentation
│ ├── [SOP-001] Document Control.md # Document template
│ ├── [SOP-001] Document Control/ # Template implementations
│ │ └── [SOP-002] Document Review.md # Controlled document
│ └── [WI-001] Document Template Usage.md # Standalone controlled document
└── QMS Documents.yaml # QMS space configuration
```

### File Format Requirements
* All spaces files must be in YAML format
* All document/issue files must include YAML frontmatter followed by Markdown content
* Children documents/issues are located in the folder with the same name as the parent document/issue

#### Space Configuration (*.yaml)
Project space (`Project Alpha.yaml`):

#### Tracker Issues

##### 1. Project Configuration (*.yaml)
Example: `Project Alpha.yaml`:
```yaml
class: tracker:class:Project # Required
title: Project Alpha # Required
Expand All @@ -51,32 +63,8 @@ description: string # Optional
defaultIssueStatus: Todo # Optional
```

Teamspace (`Documentation.yaml`):
```yaml
class: document:class:Teamspace # Required
title: Documentation # Required
private: false # Optional, default: false
autoJoin: true # Optional, default: true
owners: # Optional, list of email addresses
- john.doe@example.com
members: # Optional, list of email addresses
- joe.shmoe@example.com
description: string # Optional
```

#### Documents and Issues (*.md)
All files must include YAML frontmatter followed by Markdown content:

Document (`Getting Started.md`):
```yaml
---
class: document:class:Document # Required
title: Getting Started Guide # Required
---
# Content in Markdown format
```

Issue (`1.Project Setup.md`):
##### 2. Issue (*.md)
Example: `1.Project Setup.md`:
```yaml
---
class: tracker:class:Issue # Required
Expand All @@ -90,11 +78,11 @@ remainingTime: 4 # Optional, in hours
Task description in Markdown...
```

### Task Identification
* Human-readable task ID is formed by combining project's identifier and task number from filename
* Example: For project with identifier "ALPHA" and task "1.Setup Project.md", the task ID will be "ALPHA-1"
##### Issue Identification
* Human-readable issue ID is formed by combining project's identifier and issue number from filename
* Example: For project with identifier `ALPHA` and issue `1.Setup Project.md`, the issue ID will be `ALPHA-1`

### Allowed Values
##### Allowed Values

Issue status values:
* `Backlog`
Expand All @@ -109,6 +97,99 @@ Issue priority values:
* `High`
* `Urgent`

#### Documents

##### 1. Teamspace Configuration (*.yaml)
Example: `Documentation.yaml`:
```yaml
class: document:class:Teamspace # Required
title: Documentation # Required
private: false # Optional, default: false
autoJoin: true # Optional, default: true
owners: # Optional, list of email addresses
- john.doe@example.com
members: # Optional, list of email addresses
- joe.shmoe@example.com
description: string # Optional
```

##### 2. Document (*.md)
Example: `Getting Started.md`:
```yaml
---
class: document:class:Document # Required
title: Getting Started Guide # Required
---
# Content in Markdown format
```

#### Controlled Documents
##### 1. Space Configuration (*.yaml)
QMS Document Space: `QMS Documents.yaml`:
```yaml
class: documents:class:OrgSpace # Required
title: QMS Documents # Required
private: false # Optional, default: false
owners: # Optional, list of email addresses
- john.doe@example.com
members: # Optional, list of email addresses
- joe.shmoe@example.com
description: string # Optional
qualified: john.doe@example.com # Optional, qualified user
manager: jane.doe@example.com # Optional, QMS manager
qara: bob.smith@example.com # Optional, QA/RA specialist
```

##### 2. Document Template (*.md)
Example: `[SOP-001] Document Control.md`:
```yaml
---
class: documents:mixin:DocumentTemplate # Required
title: SOP Template # Required
docPrefix: SOP # Required, document code prefix
category: documents:category:Procedures # Required
author: John Smith # Required
owner: Jane Wilson # Required
abstract: Template description # Optional
reviewers: # Optional
- alice.cooper@example.com
approvers: # Optional
- david.brown@example.com
coAuthors: # Optional
- bob.dylan@example.com
---
Template content in Markdown...
```

##### 3. Controlled Document (*.md)
Example: `[SOP-002] Document Review.md`:
```yaml
---
class: documents:class:ControlledDocument # Required
title: Document Review Procedure # Required
template: [SOP-001] Document Control.md # Required, path to template
author: John Smith # Required
owner: Jane Wilson # Required
abstract: Document description # Optional
reviewers: # Optional
- alice.cooper@example.com
approvers: # Optional
- david.brown@example.com
coAuthors: # Optional
- bob.dylan@example.com
changeControl: # Optional
description: Initial document creation
reason: Need for standardized process
impact: Improved document control
---
Document content in Markdown...
```
##### Controlled Document Code Format
* Document code must be specified in file name: `[CODE] Any File Name.md`
* If code is not specified for controlled document, it will be generated automatically using template's docPrefix and sequential number (e.g. `SOP-99`)
* If code is not specified for template, it will be generated automatically as `TMPL-seqNumber`, where `seqNumber` is the sequence number of the template in the space


### Run Import Tool
```bash
docker run \
Expand All @@ -125,3 +206,6 @@ docker run \
* All users must exist in the system before import
* Assignees are mapped by full name
* Files in space directories can be used as attachments when referenced in markdown content
* Document codes (in square brackets) must be unique across all document spaces
* Controlled documents must be created in the same space as their templates
* Controlled documents can be imported only with `Draft` status
11 changes: 11 additions & 0 deletions dev/import-tool/docs/huly/example-workspace/QMS Documents.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class: documents:class:OrgSpace
title: QMS Documents
description: Quality Management System Documentation
private: false
owners:
- user1
members:
- user1
qualified: user1
manager: user1
qara: user1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
class: documents:mixin:DocumentTemplate
title: 'Standard Operating Procedure Template'
docPrefix: SOP
category: DOC
author: John Appleseed
owner: John Appleseed
abstract: Template for Standard Operating Procedures
reviewers:
- John Appleseed
approvers:
- John Appleseed
---
# Standard Operating Procedure

## 1. Purpose
[Describe the purpose of the procedure]

## 2. Scope
[Define the scope and applicability]

## 3. Responsibilities
[List key roles and responsibilities]

## 4. Procedure
[Detail the step-by-step procedure]

## 5. References
[List related documents]

## 6. Revision History
[Document revision history]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
class: documents:class:ControlledDocument
title: Document Review Procedure
template: '../[SOP-001] Document Control.md'
author: John Appleseed
owner: John Appleseed
abstract: Procedure for document review and approval process
reviewers:
- John Appleseed
approvers:
- John Appleseed
changeControl:
description: Initial document creation
reason: Need for standardized review process
impact: Improved document quality control
---
# Document Review Procedure

## 1. Purpose
This procedure defines the process for reviewing quality management system documents.

## 2. Scope
Applies to all controlled documents within the QMS.

## 3. Responsibilities
- Document Owner: Responsible for content
- Reviewers: Technical review
- QA Manager: Final approval

## 4. Procedure
1. Author prepares document
2. Technical review
3. QA review
4. Final approval
5. Document release

## 5. References
- Quality Manual
- Document Control Procedure

## 6. Revision History
Rev 0.1 - Initial draft
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
class: documents:class:ControlledDocument
title: Document Template Usage Guide
template: '[SOP-001] Document Control.md'
author: John Appleseed
owner: John Appleseed
abstract: Work instruction for using document templates
reviewers:
- John Appleseed
approvers:
- John Appleseed
---
# Document Template Usage Guide

## 1. Purpose
Guide users in proper usage of QMS document templates.

## 2. Scope
All personnel creating QMS documentation.

## 3. Procedure
1. Select appropriate template
2. Fill in required sections
3. Submit for review

## 4. References
- [Document Control SOP](./[SOP-001]%20Document%20Control.md)
- [Document Review Procedure](./[SOP-001]%20Document%20Control/[SOP-002]%20Document%20Review.md)
7 changes: 1 addition & 6 deletions models/controlled-documents/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import { documentsId } from '@hcengineering/controlled-documents'
import documents from '@hcengineering/controlled-documents-resources/src/plugin'
import type { Client, Doc, Ref, Role } from '@hcengineering/core'
import type { Client, Doc, Ref } from '@hcengineering/core'
import { type ObjectSearchCategory, type ObjectSearchFactory } from '@hcengineering/model-presentation'
import { mergeIds, type Resource } from '@hcengineering/platform'
import { type TagCategory } from '@hcengineering/tags'
Expand Down Expand Up @@ -71,11 +71,6 @@ export default mergeIds(documentsId, documents, {
TableDocumentTemplate: '' as Ref<Doc>,
TableDocumentDomain: '' as Ref<Doc>
},
role: {
QARA: '' as Ref<Role>,
Manager: '' as Ref<Role>,
QualifiedUser: '' as Ref<Role>
},
notification: {
DocumentsNotificationGroup: '' as Ref<NotificationGroup>,
ContentNotification: '' as Ref<NotificationType>,
Expand Down
1 change: 1 addition & 0 deletions packages/importer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@hcengineering/chunter": "^0.6.20",
"@hcengineering/collaboration": "^0.6.0",
"@hcengineering/contact": "^0.6.24",
"@hcengineering/controlled-documents": "^0.1.0",
"@hcengineering/core": "^0.6.32",
"@hcengineering/document": "^0.6.0",
"@hcengineering/model-attachment": "^0.6.0",
Expand Down
Loading
Loading