cat-documents-ng 1.0.0
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/.github/PULL_REQUEST_TEMPLATE.md +32 -0
- package/.husky/pre-commit +4 -0
- package/README.md +59 -0
- package/angular.json +119 -0
- package/eslint.config.cjs +148 -0
- package/package.json +61 -0
- package/projects/cat-document-lib/README.md +63 -0
- package/projects/cat-document-lib/ng-package.json +12 -0
- package/projects/cat-document-lib/package.json +12 -0
- package/projects/cat-document-lib/setup-jest.ts +1 -0
- package/projects/cat-document-lib/src/assets/images/FolderImg.png +0 -0
- package/projects/cat-document-lib/src/assets/images/Frame.png +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.html +1 -0
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-container/document-container.component.ts +14 -0
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.html +1 -0
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/document-list/document-list.component.ts +14 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.html +46 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.ts +51 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.html +2 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.scss +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.spec.ts +0 -0
- package/projects/cat-document-lib/src/lib/document/components/folder-container/folder-container.component.ts +29 -0
- package/projects/cat-document-lib/src/lib/document/document.module.ts +24 -0
- package/projects/cat-document-lib/src/lib/document/models/document.model.ts +3 -0
- package/projects/cat-document-lib/src/lib/document/models/folder.model.ts +35 -0
- package/projects/cat-document-lib/src/lib/document/state/document.query.ts +23 -0
- package/projects/cat-document-lib/src/lib/document/state/document.service.ts +23 -0
- package/projects/cat-document-lib/src/lib/document/state/document.state.ts +39 -0
- package/projects/cat-document-lib/src/lib/document/state/document.store.ts +23 -0
- package/projects/cat-document-lib/src/public-api.ts +7 -0
- package/projects/cat-document-lib/src/shared/constant/SHARED.ts +93 -0
- package/projects/cat-document-lib/src/shared/services/global-error.handler.ts +29 -0
- package/projects/cat-document-lib/tsconfig.lib.json +15 -0
- package/projects/cat-document-lib/tsconfig.lib.prod.json +11 -0
- package/projects/cat-document-lib/tsconfig.spec.json +15 -0
- package/public/favicon.ico +0 -0
- package/src/app/app.component.html +1 -0
- package/src/app/app.component.scss +0 -0
- package/src/app/app.component.spec.ts +29 -0
- package/src/app/app.component.ts +15 -0
- package/src/app/app.module.ts +59 -0
- package/src/app/app.routing.module.ts +19 -0
- package/src/index.html +13 -0
- package/src/main.ts +5 -0
- package/src/styles.scss +5 -0
- package/tsconfig.app.json +15 -0
- package/tsconfig.json +32 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
## Hello Developer,
|
|
2
|
+
Thank you for raising the Pull Request!
|
|
3
|
+
We greatly appreciate your efforts and contributions to the team. To ensure the quality and standards our team is committed to, we kindly request you to complete the checklist below before submitting the PR.
|
|
4
|
+
|
|
5
|
+
## Pull Request Checklist
|
|
6
|
+
|
|
7
|
+
### Code Quality
|
|
8
|
+
- [Y/N] Code adheres to coding standards and style guides.
|
|
9
|
+
- [Y/N] Code is properly commented and documented.
|
|
10
|
+
- [Y/N] No Hard-coded values are added.
|
|
11
|
+
- [Y/N] PR doesn't include more than 10 files.
|
|
12
|
+
|
|
13
|
+
### Clean Coding
|
|
14
|
+
- [Y/N] Classes and methods adheres to Single Responsibility Principle
|
|
15
|
+
- [Y/N] Classes are not exceeding 200 lines of code
|
|
16
|
+
- [Y/N] Methods are not exceeding 20 lines of code
|
|
17
|
+
|
|
18
|
+
### Testing
|
|
19
|
+
- [Y/N] Unit tests are written and executed.
|
|
20
|
+
- [Y/N] All tests pass successfully.
|
|
21
|
+
- [Y/N] Manual testing is completed and verified.
|
|
22
|
+
|
|
23
|
+
### Functionality
|
|
24
|
+
- [Y/N] Feature behaves as expected.
|
|
25
|
+
- [Y/N] Edge cases are handled.
|
|
26
|
+
|
|
27
|
+
### Documentation
|
|
28
|
+
- [Y/N] Relevant documentation is updated (e.g., README, user guides, API docs).
|
|
29
|
+
|
|
30
|
+
### Dependencies
|
|
31
|
+
- [Y/N] No unused dependencies or imports.
|
|
32
|
+
- [Y/N] Dependencies are updated and compatible.
|
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# CatDocumentsNg
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.5.
|
|
4
|
+
|
|
5
|
+
## Development server
|
|
6
|
+
|
|
7
|
+
To start a local development server, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng serve
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
|
14
|
+
|
|
15
|
+
## Code scaffolding
|
|
16
|
+
|
|
17
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
ng generate component component-name
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
ng generate --help
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Building
|
|
30
|
+
|
|
31
|
+
To build the project run:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
ng build
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
|
38
|
+
|
|
39
|
+
## Running unit tests
|
|
40
|
+
|
|
41
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
ng test
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Running end-to-end tests
|
|
48
|
+
|
|
49
|
+
For end-to-end (e2e) testing, run:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
ng e2e
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
56
|
+
|
|
57
|
+
## Additional Resources
|
|
58
|
+
|
|
59
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
package/angular.json
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"newProjectRoot": "projects",
|
|
5
|
+
"projects": {
|
|
6
|
+
"cat-documents-ng": {
|
|
7
|
+
"projectType": "application",
|
|
8
|
+
"schematics": {
|
|
9
|
+
"@schematics/angular:component": {
|
|
10
|
+
"style": "scss"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"root": "",
|
|
14
|
+
"sourceRoot": "src",
|
|
15
|
+
"prefix": "app",
|
|
16
|
+
"architect": {
|
|
17
|
+
"build": {
|
|
18
|
+
"builder": "@angular-devkit/build-angular:application",
|
|
19
|
+
"options": {
|
|
20
|
+
"outputPath": "dist/cat-documents-ng",
|
|
21
|
+
"index": "src/index.html",
|
|
22
|
+
"browser": "src/main.ts",
|
|
23
|
+
"polyfills": ["zone.js"],
|
|
24
|
+
"tsConfig": "tsconfig.app.json",
|
|
25
|
+
"inlineStyleLanguage": "scss",
|
|
26
|
+
"assets": [
|
|
27
|
+
"src/favicon.ico",
|
|
28
|
+
"src/assets",
|
|
29
|
+
{
|
|
30
|
+
"glob": "**/*",
|
|
31
|
+
"input": "projects/cat-document-lib/src/assets",
|
|
32
|
+
"output": "assets/cat-document-lib"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"styles": [
|
|
36
|
+
"./node_modules/primeng/resources/themes/saga-blue/theme.css",
|
|
37
|
+
"./node_modules/primeng/resources/primeng.min.css",
|
|
38
|
+
"./node_modules/primeicons/primeicons.css",
|
|
39
|
+
"./node_modules/primeflex/primeflex.css",
|
|
40
|
+
"src/styles.scss"
|
|
41
|
+
],
|
|
42
|
+
"scripts": []
|
|
43
|
+
},
|
|
44
|
+
"configurations": {
|
|
45
|
+
"production": {
|
|
46
|
+
"budgets": [
|
|
47
|
+
{
|
|
48
|
+
"type": "initial",
|
|
49
|
+
"maximumWarning": "500kB",
|
|
50
|
+
"maximumError": "1MB"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "anyComponentStyle",
|
|
54
|
+
"maximumWarning": "4kB",
|
|
55
|
+
"maximumError": "8kB"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"outputHashing": "all"
|
|
59
|
+
},
|
|
60
|
+
"development": {
|
|
61
|
+
"optimization": false,
|
|
62
|
+
"extractLicenses": false,
|
|
63
|
+
"sourceMap": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"defaultConfiguration": "production"
|
|
67
|
+
},
|
|
68
|
+
"serve": {
|
|
69
|
+
"builder": "@angular-devkit/build-angular:dev-server",
|
|
70
|
+
"configurations": {
|
|
71
|
+
"production": {
|
|
72
|
+
"buildTarget": "cat-documents-ng:build:production"
|
|
73
|
+
},
|
|
74
|
+
"development": {
|
|
75
|
+
"buildTarget": "cat-documents-ng:build:development"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"defaultConfiguration": "development"
|
|
79
|
+
},
|
|
80
|
+
"extract-i18n": {
|
|
81
|
+
"builder": "@angular-devkit/build-angular:extract-i18n"
|
|
82
|
+
},
|
|
83
|
+
"lint": {
|
|
84
|
+
"builder": "@angular-eslint/builder:lint",
|
|
85
|
+
"options": {
|
|
86
|
+
"eslintConfig": "eslint.config.js",
|
|
87
|
+
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"cat-document-lib": {
|
|
93
|
+
"projectType": "library",
|
|
94
|
+
"root": "projects/cat-document-lib",
|
|
95
|
+
"sourceRoot": "projects/cat-document-lib/src",
|
|
96
|
+
"prefix": "lib",
|
|
97
|
+
"architect": {
|
|
98
|
+
"build": {
|
|
99
|
+
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
100
|
+
"options": {
|
|
101
|
+
"project": "projects/cat-document-lib/ng-package.json"
|
|
102
|
+
},
|
|
103
|
+
"configurations": {
|
|
104
|
+
"production": {
|
|
105
|
+
"tsConfig": "projects/cat-document-lib/tsconfig.lib.prod.json"
|
|
106
|
+
},
|
|
107
|
+
"development": {
|
|
108
|
+
"tsConfig": "projects/cat-document-lib/tsconfig.lib.json"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"defaultConfiguration": "production"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"cli": {
|
|
117
|
+
"analytics": "77456047-823c-4f1a-b41d-1ddee393b72d"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
const eslint = require("@eslint/js");
|
|
3
|
+
const tseslint = require("@typescript-eslint/eslint-plugin");
|
|
4
|
+
const tseslintParser = require("@typescript-eslint/parser");
|
|
5
|
+
const angular = require("@angular-eslint/eslint-plugin");
|
|
6
|
+
const jsdoc = require("eslint-plugin-jsdoc");
|
|
7
|
+
const angularParser = require("@angular-eslint/template-parser");
|
|
8
|
+
|
|
9
|
+
module.exports = [
|
|
10
|
+
{
|
|
11
|
+
files: ["**/*.ts"],
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parser: tseslintParser, // Use TypeScript parser for .ts files
|
|
14
|
+
parserOptions: {
|
|
15
|
+
ecmaVersion: 2020,
|
|
16
|
+
sourceType: "module",
|
|
17
|
+
project: "./tsconfig.json", // Ensure this points to your tsconfig.json
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
plugins: {
|
|
21
|
+
"@typescript-eslint": tseslint,
|
|
22
|
+
"@angular-eslint": angular,
|
|
23
|
+
jsdoc,
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
"@angular-eslint/directive-selector": [
|
|
27
|
+
"error",
|
|
28
|
+
{
|
|
29
|
+
type: "attribute",
|
|
30
|
+
style: "camelCase",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
"@angular-eslint/component-selector": [
|
|
34
|
+
"error",
|
|
35
|
+
{
|
|
36
|
+
type: "element",
|
|
37
|
+
style: "kebab-case",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
"jsdoc/check-access": 1, // Recommended
|
|
41
|
+
"jsdoc/check-alignment": 1, // Recommended
|
|
42
|
+
"jsdoc/check-param-names": 1, // Recommended
|
|
43
|
+
"jsdoc/check-property-names": 1, // Recommended
|
|
44
|
+
"jsdoc/check-tag-names": 1, // Recommended
|
|
45
|
+
"jsdoc/check-types": 1, // Recommended
|
|
46
|
+
"jsdoc/check-values": 1, // Recommended
|
|
47
|
+
"jsdoc/empty-tags": 1, // Recommended
|
|
48
|
+
"jsdoc/implements-on-classes": 1, // Recommended
|
|
49
|
+
"jsdoc/multiline-blocks": 1, // Recommended
|
|
50
|
+
"jsdoc/no-multi-asterisks": 1, // Recommended
|
|
51
|
+
"jsdoc/no-undefined-types": 1, // Recommended
|
|
52
|
+
"jsdoc/require-jsdoc": [
|
|
53
|
+
"error",
|
|
54
|
+
{
|
|
55
|
+
"contexts": [
|
|
56
|
+
"ClassDeclaration",
|
|
57
|
+
"ClassExpression",
|
|
58
|
+
"ArrowFunctionExpression",
|
|
59
|
+
"FunctionDeclaration",
|
|
60
|
+
"FunctionExpression",
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
'jsdoc/require-description': 'error',
|
|
65
|
+
"jsdoc/require-param": 1, // Recommended
|
|
66
|
+
"jsdoc/require-param-description": 1, // Recommended
|
|
67
|
+
"jsdoc/require-param-name": 1, // Recommended
|
|
68
|
+
"jsdoc/require-param-type": 1, // Recommended
|
|
69
|
+
"jsdoc/require-property": 1, // Recommended
|
|
70
|
+
"jsdoc/require-property-description": 1, // Recommended
|
|
71
|
+
"jsdoc/require-property-name": 1, // Recommended
|
|
72
|
+
"jsdoc/require-property-type": 1, // Recommended
|
|
73
|
+
"jsdoc/require-returns": 1, // Recommended
|
|
74
|
+
"jsdoc/require-returns-check": 1, // Recommended
|
|
75
|
+
"jsdoc/require-returns-description": 1, // Recommended
|
|
76
|
+
"jsdoc/require-returns-type": 1, // Recommended
|
|
77
|
+
"jsdoc/require-yields": 1, // Recommended
|
|
78
|
+
"jsdoc/require-yields-check": 1, // Recommended
|
|
79
|
+
"jsdoc/tag-lines": 1, // Recommended
|
|
80
|
+
"jsdoc/valid-types": 1, // Recommended
|
|
81
|
+
"max-lines": [
|
|
82
|
+
"error",
|
|
83
|
+
{
|
|
84
|
+
max: 200,
|
|
85
|
+
skipBlankLines: true,
|
|
86
|
+
skipComments: true,
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
"max-lines-per-function": [
|
|
90
|
+
"error",
|
|
91
|
+
{
|
|
92
|
+
max: 20,
|
|
93
|
+
skipBlankLines: true,
|
|
94
|
+
skipComments: true,
|
|
95
|
+
IIFEs: true,
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
files: ["**/*.html"],
|
|
102
|
+
languageOptions: {
|
|
103
|
+
parser: angularParser, // Use Angular template parser
|
|
104
|
+
},
|
|
105
|
+
plugins: {
|
|
106
|
+
"@angular-eslint": angular,
|
|
107
|
+
},
|
|
108
|
+
rules: {
|
|
109
|
+
// Add custom template rules here if needed
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
files: ["**/*.spec.ts"],
|
|
114
|
+
languageOptions: {
|
|
115
|
+
parser: tseslintParser, // Use TypeScript parser for .spec.ts files
|
|
116
|
+
parserOptions: {
|
|
117
|
+
ecmaVersion: 2020,
|
|
118
|
+
sourceType: "module",
|
|
119
|
+
project: "./tsconfig.json", // Ensure this points to your tsconfig.json
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
plugins: {
|
|
123
|
+
"@typescript-eslint": tseslint,
|
|
124
|
+
"@angular-eslint": angular,
|
|
125
|
+
},
|
|
126
|
+
rules: {
|
|
127
|
+
// Custom rules for spec files, e.g., allow certain things that are specific to testing
|
|
128
|
+
"max-lines": [
|
|
129
|
+
"error", // You might want to warn rather than error in test files
|
|
130
|
+
{
|
|
131
|
+
max: 500, // Allow more lines in spec files
|
|
132
|
+
skipBlankLines: true,
|
|
133
|
+
skipComments: true,
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
"max-lines-per-function": [
|
|
137
|
+
"error", // You might want to relax this for test files as well
|
|
138
|
+
{
|
|
139
|
+
max: 50, // Allow more lines in functions in spec files
|
|
140
|
+
skipBlankLines: true,
|
|
141
|
+
skipComments: true,
|
|
142
|
+
IIFEs: true,
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
// Add other rules specific to testing or Jest (if applicable)
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cat-documents-ng",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"ng": "ng",
|
|
6
|
+
"start": "ng serve",
|
|
7
|
+
"build": "ng build",
|
|
8
|
+
"watch": "ng build --watch --configuration development",
|
|
9
|
+
"test": "jest --config projects/cat-document-lib/jest.config.mjs",
|
|
10
|
+
"lint": "ng lint",
|
|
11
|
+
"prepare": "husky install"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@angular/animations": "^19.0.4",
|
|
16
|
+
"@angular/cdk": "^18.2.14",
|
|
17
|
+
"@angular/common": "^19.0.0",
|
|
18
|
+
"@angular/compiler": "^19.0.0",
|
|
19
|
+
"@angular/core": "^19.0.0",
|
|
20
|
+
"@angular/forms": "^19.0.0",
|
|
21
|
+
"@angular/platform-browser": "^19.0.0",
|
|
22
|
+
"@angular/platform-browser-dynamic": "^19.0.0",
|
|
23
|
+
"@angular/router": "^19.0.0",
|
|
24
|
+
"@datorama/akita": "^8.0.1",
|
|
25
|
+
"jsdocs": "^1.0.0",
|
|
26
|
+
"primeflex": "^3.3.1",
|
|
27
|
+
"primeicons": "^7.0.0",
|
|
28
|
+
"primeng": "^17.18.10",
|
|
29
|
+
"rxjs": "~7.8.0",
|
|
30
|
+
"tslib": "^2.3.0",
|
|
31
|
+
"zone.js": "~0.15.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@angular-devkit/build-angular": "^19.0.5",
|
|
35
|
+
"@angular-eslint/eslint-plugin": "^19.0.2",
|
|
36
|
+
"@angular-eslint/eslint-plugin-template": "^19.0.2",
|
|
37
|
+
"@angular-eslint/template-parser": "^19.0.2",
|
|
38
|
+
"@angular/cli": "^19.0.5",
|
|
39
|
+
"@angular/compiler-cli": "^19.0.0",
|
|
40
|
+
"@eslint/js": "^9.17.0",
|
|
41
|
+
"@types/jest": "^29.5.14",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^8.18.0",
|
|
43
|
+
"@typescript-eslint/parser": "^8.18.0",
|
|
44
|
+
"angular-eslint": "19.0.2",
|
|
45
|
+
"eslint": "^9.17.0",
|
|
46
|
+
"eslint-plugin-jsdoc": "^50.6.1",
|
|
47
|
+
"husky": "^9.1.7",
|
|
48
|
+
"jest": "^29.7.0",
|
|
49
|
+
"jest-preset-angular": "^14.4.2",
|
|
50
|
+
"lint-staged": "^15.2.11",
|
|
51
|
+
"ng-packagr": "^19.0.0",
|
|
52
|
+
"typescript": "~5.6.2",
|
|
53
|
+
"typescript-eslint": "8.18.0"
|
|
54
|
+
},
|
|
55
|
+
"lint-staged": {
|
|
56
|
+
"**/*.ts": "eslint",
|
|
57
|
+
"**/*.js": "eslint --fix",
|
|
58
|
+
"**/*.html": "eslint --fix",
|
|
59
|
+
"*.js": "eslint --cache --fix"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# CatDocumentLib
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build cat-document-lib
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
```bash
|
|
35
|
+
cd dist/cat-document-lib
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
39
|
+
```bash
|
|
40
|
+
npm publish
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Running unit tests
|
|
44
|
+
|
|
45
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ng test
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Running end-to-end tests
|
|
52
|
+
|
|
53
|
+
For end-to-end (e2e) testing, run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ng e2e
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
60
|
+
|
|
61
|
+
## Additional Resources
|
|
62
|
+
|
|
63
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'jest-preset-angular/setup-jest';
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<p>document-container works!</p>
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
// @Component({
|
|
7
|
+
// selector: 'lib-document-container',
|
|
8
|
+
// standalone: false,
|
|
9
|
+
// templateUrl: './document-container.component.html',
|
|
10
|
+
// styleUrl: './document-container.component.scss'
|
|
11
|
+
// })
|
|
12
|
+
// export class DocumentContainerComponent {
|
|
13
|
+
|
|
14
|
+
// }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<p>document-list works!</p>
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
// @Component({
|
|
7
|
+
// selector: 'lib-document-list',
|
|
8
|
+
// standalone : false,
|
|
9
|
+
// templateUrl: './document-list.component.html',
|
|
10
|
+
// styleUrl: './document-list.component.scss'
|
|
11
|
+
// })
|
|
12
|
+
// export class DocumentListComponent {
|
|
13
|
+
|
|
14
|
+
// }
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<div class="card folder-info my-4">
|
|
2
|
+
<div class="text-900 text-xl font-semibold mb-3">Folders</div>
|
|
3
|
+
<div class="grid">
|
|
4
|
+
<div *ngFor="let folder of folderBlocks" class="col-12 md:col-6 xl:col-3">
|
|
5
|
+
<div
|
|
6
|
+
class="p-3 border-1 h-full surface-border flex flex-column justify-content-between surface-100 hover:surface-100 cursor-pointer border-round"
|
|
7
|
+
(click)="handleClickForFilter(folder._id)"
|
|
8
|
+
>
|
|
9
|
+
<div class="icon">
|
|
10
|
+
<img src="../../../../assets/images/FolderImg.png" alt="" />
|
|
11
|
+
</div>
|
|
12
|
+
<div class="flex flex-column">
|
|
13
|
+
<span class="text-600 mt-2"> {{ folder.fileCount }} Files </span>
|
|
14
|
+
<span class="text-900 text-lg mt-2 mb-2 font-semibold font-medium">
|
|
15
|
+
{{ folder.text }}
|
|
16
|
+
</span>
|
|
17
|
+
</div>
|
|
18
|
+
<hr />
|
|
19
|
+
<div class="flex justify-content-between">
|
|
20
|
+
<div class="flex flex-column">
|
|
21
|
+
<span>Missing</span>
|
|
22
|
+
<span
|
|
23
|
+
[ngClass]="{
|
|
24
|
+
'text-pink-500': missingFileCount > 0,
|
|
25
|
+
'text-green-500': missingFileCount === 0
|
|
26
|
+
}"
|
|
27
|
+
>
|
|
28
|
+
{{ missingFileCount }}
|
|
29
|
+
</span>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="flex flex-column">
|
|
32
|
+
<span>Pending</span>
|
|
33
|
+
<span
|
|
34
|
+
[ngClass]="{
|
|
35
|
+
'text-yellow-500': pendingFileCount > 0,
|
|
36
|
+
'text-green-500': pendingFileCount === 0
|
|
37
|
+
}"
|
|
38
|
+
>
|
|
39
|
+
{{ pendingFileCount }}
|
|
40
|
+
</span>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
File without changes
|
|
File without changes
|
package/projects/cat-document-lib/src/lib/document/components/folder-block/folder-block.component.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { DocumentStore } from '../../state/document.store';
|
|
3
|
+
import { FolderBlockModel } from '../../models/folder.model';
|
|
4
|
+
import { SHARED } from '../../../../Shared/constant/SHARED';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The `FolderBlockComponent` is responsible for displaying a block of folders and
|
|
8
|
+
* providing filtering functionality based on folder IDs.
|
|
9
|
+
*
|
|
10
|
+
* It uses data from the `DocumentStore` and constants from the `SHARED` configuration
|
|
11
|
+
* to display missing and pending file counts.
|
|
12
|
+
*/
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'lib-folder-block',
|
|
15
|
+
standalone: false,
|
|
16
|
+
templateUrl: './folder-block.component.html',
|
|
17
|
+
styleUrl: './folder-block.component.scss'
|
|
18
|
+
})
|
|
19
|
+
export class FolderBlockComponent {
|
|
20
|
+
/**
|
|
21
|
+
* Array of folder blocks data to display.
|
|
22
|
+
* Each folder is represented as a `FolderBlockModel`.
|
|
23
|
+
*/
|
|
24
|
+
@Input() folderBlocks: FolderBlockModel[] = [];
|
|
25
|
+
|
|
26
|
+
/** Number of missing files, sourced from the `SHARED` constants. */
|
|
27
|
+
missingFileCount = SHARED.MISSINGCOUNT;
|
|
28
|
+
|
|
29
|
+
/** Number of pending files, sourced from the `SHARED` constants. */
|
|
30
|
+
pendingFileCount = SHARED.PENDINGCOUNT;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Injects the `DocumentStore` service to manage and access document-related state.
|
|
34
|
+
* @param {DocumentStore} documentStore - The state management store for documents.
|
|
35
|
+
*/
|
|
36
|
+
constructor(public documentStore: DocumentStore) {}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Handles the click event for filtering based on the provided folder ID.
|
|
40
|
+
* This method validates the folder ID and returns it for further processing.
|
|
41
|
+
* If the folder ID is not provided, an empty string is returned.
|
|
42
|
+
* @param {string} folderBlockId - The unique identifier of the folder to filter by.
|
|
43
|
+
* @returns {string} The validated folder ID, or an empty string if the input is invalid.
|
|
44
|
+
*/
|
|
45
|
+
handleClickForFilter(folderBlockId: string): string {
|
|
46
|
+
if (!folderBlockId) {
|
|
47
|
+
return SHARED.EMPTY;
|
|
48
|
+
}
|
|
49
|
+
return folderBlockId;
|
|
50
|
+
}
|
|
51
|
+
}
|