xt-plugin-agenda 0.6.0 → 0.6.2
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/README.md +3 -3
- package/fesm2022/xt-plugin-agenda.mjs +287 -0
- package/fesm2022/xt-plugin-agenda.mjs.map +1 -0
- package/index.d.ts +21 -0
- package/package.json +28 -57
- package/.editorconfig +0 -16
- package/.postcssrc.json +0 -1
- package/.rush/temp/chunked-rush-logs/xt-plugin-agenda.build-deploy-latest.chunks.jsonl +0 -92
- package/.rush/temp/chunked-rush-logs/xt-plugin-agenda.build.chunks.jsonl +0 -24
- package/.rush/temp/chunked-rush-logs/xt-plugin-agenda.test.chunks.jsonl +0 -50
- package/.rush/temp/chunked-rush-logs/xt-plugin-finance.build-deploy-latest.chunks.jsonl +0 -45
- package/.rush/temp/chunked-rush-logs/xt-plugin-finance.build-deploy-next.chunks.jsonl +0 -29
- package/.rush/temp/chunked-rush-logs/xt-plugin-finance.build.chunks.jsonl +0 -24
- package/.rush/temp/chunked-rush-logs/xt-plugin-finance.test.chunks.jsonl +0 -36
- package/.rush/temp/package-deps_test.json +0 -62
- package/.rush/temp/shrinkwrap-deps.json +0 -1083
- package/CHANGELOG.md +0 -15
- package/angular.json +0 -164
- package/projects/agenda/README.md +0 -17
- package/projects/agenda/ng-package.json +0 -7
- package/projects/agenda/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/projects/agenda/package.json +0 -22
- package/projects/agenda/src/lib/date-interval/agenda-date-interval.component.css +0 -0
- package/projects/agenda/src/lib/date-interval/agenda-date-interval.component.html +0 -19
- package/projects/agenda/src/lib/date-interval/agenda-date-interval.component.spec.ts +0 -73
- package/projects/agenda/src/lib/date-interval/agenda-date-interval.component.ts +0 -30
- package/projects/agenda/src/lib/register.ts +0 -63
- package/projects/agenda/src/lib/task-complete/agenda-task-complete.component.css +0 -0
- package/projects/agenda/src/lib/task-complete/agenda-task-complete.component.html +0 -13
- package/projects/agenda/src/lib/task-complete/agenda-task-complete.component.spec.ts +0 -28
- package/projects/agenda/src/lib/task-complete/agenda-task-complete.component.ts +0 -35
- package/projects/agenda/src/lib/type-handlers/date-interval.ts +0 -27
- package/projects/agenda/src/lib/type-handlers/recurring-task.ts +0 -14
- package/projects/agenda/src/lib/type-handlers/task-complete-handler.spec.ts +0 -202
- package/projects/agenda/src/lib/type-handlers/task-complete-handler.ts +0 -146
- package/projects/agenda/src/public-api.ts +0 -6
- package/projects/agenda/src/test-setup.ts +0 -18
- package/projects/agenda/tsconfig.lib.json +0 -15
- package/projects/agenda/tsconfig.lib.prod.json +0 -11
- package/projects/agenda/tsconfig.spec.json +0 -18
- package/projects/agenda/vitest.config.ts +0 -19
- package/projects/agenda-plugin/federation.config.js +0 -43
- package/projects/agenda-plugin/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/projects/agenda-plugin/public/favicon.ico +0 -0
- package/projects/agenda-plugin/public/pluginicon.png +0 -0
- package/projects/agenda-plugin/src/app/app.component.css +0 -0
- package/projects/agenda-plugin/src/app/app.component.html +0 -5
- package/projects/agenda-plugin/src/app/app.component.spec.ts +0 -42
- package/projects/agenda-plugin/src/app/app.component.ts +0 -26
- package/projects/agenda-plugin/src/app/app.config.ts +0 -21
- package/projects/agenda-plugin/src/app/app.routes.ts +0 -6
- package/projects/agenda-plugin/src/app/dummy-currency/dummy-currency.component.css +0 -0
- package/projects/agenda-plugin/src/app/dummy-currency/dummy-currency.component.html +0 -7
- package/projects/agenda-plugin/src/app/dummy-currency/dummy-currency.component.ts +0 -36
- package/projects/agenda-plugin/src/app/test-component/agenda-test.component.css +0 -0
- package/projects/agenda-plugin/src/app/test-component/agenda-test.component.html +0 -23
- package/projects/agenda-plugin/src/app/test-component/agenda-test.component.spec.ts +0 -34
- package/projects/agenda-plugin/src/app/test-component/agenda-test.component.ts +0 -136
- package/projects/agenda-plugin/src/bootstrap.ts +0 -6
- package/projects/agenda-plugin/src/index.html +0 -13
- package/projects/agenda-plugin/src/main.ts +0 -6
- package/projects/agenda-plugin/src/styles.css +0 -12
- package/projects/agenda-plugin/src/test-setup.ts +0 -18
- package/projects/agenda-plugin/tsconfig.app.json +0 -15
- package/projects/agenda-plugin/tsconfig.federation.json +0 -13
- package/projects/agenda-plugin/tsconfig.spec.json +0 -18
- package/projects/agenda-plugin/vitest.config.ts +0 -19
- package/rush-logs/xt-plugin-agenda.build-deploy-latest.error.log +0 -55
- package/rush-logs/xt-plugin-agenda.build-deploy-latest.log +0 -92
- package/rush-logs/xt-plugin-agenda.build.error.log +0 -9
- package/rush-logs/xt-plugin-agenda.build.log +0 -24
- package/rush-logs/xt-plugin-agenda.test.log +0 -50
- package/study.txt +0 -27
- package/tsconfig.json +0 -36
package/CHANGELOG.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [0.6.0](https://github.com/dont-code/ng-xtend/compare/xt-plugin-agenda-v0.5.5...xt-plugin-agenda-v0.6.0) (2026-01-07)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
### Features
|
|
7
|
-
|
|
8
|
-
* all plugins, libs to release please ([35ddd53](https://github.com/dont-code/ng-xtend/commit/35ddd5362c3350572f44ebe79824e297fd03c7eb))
|
|
9
|
-
* remove next tasks ([b7e05fe](https://github.com/dont-code/ng-xtend/commit/b7e05fe0854c21a2b936dab1f020d0c7e176d2fe))
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
### Bug Fixes
|
|
13
|
-
|
|
14
|
-
* plugin-tester don't create wront type ([903e356](https://github.com/dont-code/ng-xtend/commit/903e356197d2e49008131e81efb295839f44dcc7))
|
|
15
|
-
* reworked publish & deploy scripts with release-please ([aed0d88](https://github.com/dont-code/ng-xtend/commit/aed0d884c0a8bfcc85645e87d19480939737bdf6))
|
package/angular.json
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
|
3
|
-
"version": 1,
|
|
4
|
-
"cli": {
|
|
5
|
-
"packageManager": "pnpm",
|
|
6
|
-
"analytics": "8440f8d0-3f6c-4758-b71e-f9ee11217c7f",
|
|
7
|
-
"cache": {
|
|
8
|
-
"enabled": true
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"newProjectRoot": "projects",
|
|
12
|
-
"projects": {
|
|
13
|
-
"agenda": {
|
|
14
|
-
"projectType": "library",
|
|
15
|
-
"root": "projects/agenda",
|
|
16
|
-
"sourceRoot": "projects/agenda/src",
|
|
17
|
-
"prefix": "lib",
|
|
18
|
-
"architect": {
|
|
19
|
-
"build": {
|
|
20
|
-
"builder": "@angular-devkit/build-angular:ng-packagr",
|
|
21
|
-
"options": {
|
|
22
|
-
"project": "projects/agenda/ng-package.json"
|
|
23
|
-
},
|
|
24
|
-
"configurations": {
|
|
25
|
-
"production": {
|
|
26
|
-
"tsConfig": "projects/agenda/tsconfig.lib.prod.json"
|
|
27
|
-
},
|
|
28
|
-
"development": {
|
|
29
|
-
"tsConfig": "projects/agenda/tsconfig.lib.json"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"defaultConfiguration": "development"
|
|
33
|
-
},
|
|
34
|
-
"test": {
|
|
35
|
-
"builder": "@analogjs/vitest-angular:test",
|
|
36
|
-
"options": {
|
|
37
|
-
"tsConfig": "projects/agenda/tsconfig.spec.json",
|
|
38
|
-
"polyfills": [
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"agenda-plugin": {
|
|
45
|
-
"projectType": "application",
|
|
46
|
-
"schematics": {
|
|
47
|
-
"@schematics/angular:component": {
|
|
48
|
-
"style": "css"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"root": "projects/agenda-plugin",
|
|
52
|
-
"sourceRoot": "projects/agenda-plugin/src",
|
|
53
|
-
"prefix": "app",
|
|
54
|
-
"architect": {
|
|
55
|
-
"build": {
|
|
56
|
-
"builder": "@angular-architects/native-federation:build",
|
|
57
|
-
"options": {},
|
|
58
|
-
"configurations": {
|
|
59
|
-
"production": {
|
|
60
|
-
"target": "agenda-plugin:esbuild:production"
|
|
61
|
-
},
|
|
62
|
-
"development": {
|
|
63
|
-
"target": "agenda-plugin:esbuild:development",
|
|
64
|
-
"dev": true
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"defaultConfiguration": "production"
|
|
68
|
-
},
|
|
69
|
-
"serve": {
|
|
70
|
-
"builder": "@angular-architects/native-federation:build",
|
|
71
|
-
"options": {
|
|
72
|
-
"target": "agenda-plugin:serve-original:development",
|
|
73
|
-
"rebuildDelay": 0,
|
|
74
|
-
"dev": true,
|
|
75
|
-
"port": 0
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
"esbuild": {
|
|
79
|
-
"builder": "@angular-devkit/build-angular:application",
|
|
80
|
-
"options": {
|
|
81
|
-
"outputPath": "dist/xt-agenda-plugin",
|
|
82
|
-
"index": "projects/agenda-plugin/src/index.html",
|
|
83
|
-
"browser": "projects/agenda-plugin/src/main.ts",
|
|
84
|
-
"preserveSymlinks": true,
|
|
85
|
-
"polyfills": [
|
|
86
|
-
"es-module-shims"
|
|
87
|
-
],
|
|
88
|
-
"tsConfig": "projects/agenda-plugin/tsconfig.app.json",
|
|
89
|
-
"inlineStyleLanguage": "css",
|
|
90
|
-
"assets": [
|
|
91
|
-
{
|
|
92
|
-
"glob": "**/*",
|
|
93
|
-
"input": "projects/agenda-plugin/public"
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
"styles": [
|
|
97
|
-
"projects/agenda-plugin/src/styles.css"
|
|
98
|
-
],
|
|
99
|
-
"scripts": []
|
|
100
|
-
},
|
|
101
|
-
"configurations": {
|
|
102
|
-
"production": {
|
|
103
|
-
"budgets": [
|
|
104
|
-
{
|
|
105
|
-
"type": "initial",
|
|
106
|
-
"maximumWarning": "1MB",
|
|
107
|
-
"maximumError": "2MB"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"type": "anyComponentStyle",
|
|
111
|
-
"maximumWarning": "4kB",
|
|
112
|
-
"maximumError": "8kB"
|
|
113
|
-
}
|
|
114
|
-
],
|
|
115
|
-
"outputHashing": "all"
|
|
116
|
-
},
|
|
117
|
-
"development": {
|
|
118
|
-
"optimization": false,
|
|
119
|
-
"extractLicenses": false,
|
|
120
|
-
"sourceMap": true
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
"defaultConfiguration": "development"
|
|
124
|
-
},
|
|
125
|
-
"serve-original": {
|
|
126
|
-
"builder": "@angular-devkit/build-angular:dev-server",
|
|
127
|
-
"configurations": {
|
|
128
|
-
"production": {
|
|
129
|
-
"buildTarget": "agenda-plugin:esbuild:production"
|
|
130
|
-
},
|
|
131
|
-
"development": {
|
|
132
|
-
"buildTarget": "agenda-plugin:esbuild:development"
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
"defaultConfiguration": "development",
|
|
136
|
-
"options": {
|
|
137
|
-
"port": 4205
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"extract-i18n": {
|
|
141
|
-
"builder": "@angular-devkit/build-angular:extract-i18n"
|
|
142
|
-
},
|
|
143
|
-
"test": {
|
|
144
|
-
"builder": "@analogjs/vitest-angular:test",
|
|
145
|
-
"options": {
|
|
146
|
-
"polyfills": [],
|
|
147
|
-
"tsConfig": "projects/agenda-plugin/tsconfig.spec.json",
|
|
148
|
-
"inlineStyleLanguage": "css",
|
|
149
|
-
"assets": [
|
|
150
|
-
{
|
|
151
|
-
"glob": "**/*",
|
|
152
|
-
"input": "projects/agenda-plugin/public"
|
|
153
|
-
}
|
|
154
|
-
],
|
|
155
|
-
"styles": [
|
|
156
|
-
"projects/agenda-plugin/src/styles.css"
|
|
157
|
-
],
|
|
158
|
-
"scripts": []
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
|
-
# Plugin xt-default
|
|
4
|
-
|
|
5
|
-
This plugin is part of the [ng-xtend framework](https://github.com/dont-code/ng-xtend/blob/main/README.md)
|
|
6
|
-
|
|
7
|
-
It enable [xt-components](https://github.com/dont-code/ng-xtend/tree/main/libs/xt-components) to
|
|
8
|
-
|
|
9
|
-
- Display and edit any primitive value
|
|
10
|
-

|
|
11
|
-
- or complex object
|
|
12
|
-

|
|
13
|
-
- or list of objects
|
|
14
|
-

|
|
15
|
-
|
|
16
|
-
With it you are sure you can display / edit any type within any xt-components application like [xt-host](https://github.com/dont-code/ng-xtend/tree/main/libs/xt-host).
|
|
17
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"3.2.4","results":[[":src/lib/date-interval/agenda-date-interval.component.spec.ts",{"duration":951.2237509999995,"failed":false}],[":src/lib/recurring-task-complete/agenda-recurring-task-complete.component.spec.ts",{"duration":289.6400020000001,"failed":false}],[":src/lib/type-handlers/recurring-task-handler.spec.ts",{"duration":15.821077999999943,"failed":true}],[":src/lib/type-handlers/task-complete-handler.spec.ts",{"duration":114.5679970000001,"failed":false}],[":src/lib/recurring-task-complete/agenda-task-complete.component.spec.ts",{"duration":180.22498799999994,"failed":false}],[":src/lib/task-complete/agenda-task-complete.component.spec.ts",{"duration":162.92599700000028,"failed":false}]]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "xt-plugin-agenda",
|
|
3
|
-
"version": "0.6.0",
|
|
4
|
-
"peerDependencies": {
|
|
5
|
-
"@angular/animations": "^19.0.5",
|
|
6
|
-
"@angular/common": "^19.0.5",
|
|
7
|
-
"@angular/compiler": "^19.0.5",
|
|
8
|
-
"@angular/core": "^19.0.5",
|
|
9
|
-
"@angular/forms": "^19.0.5",
|
|
10
|
-
"@angular/platform-browser": "^19.0.5",
|
|
11
|
-
"@angular/platform-browser-dynamic": "^19.0.5",
|
|
12
|
-
"@angular/router": "^19.0.5",
|
|
13
|
-
"xt-components": "workspace:^",
|
|
14
|
-
"rxjs": "^7.8.0",
|
|
15
|
-
"primeng": "^19.0.2",
|
|
16
|
-
"primeicons": "^7.0.0"
|
|
17
|
-
},
|
|
18
|
-
"dependencies": {
|
|
19
|
-
"tslib": "^2.3.0"
|
|
20
|
-
},
|
|
21
|
-
"sideEffects": false
|
|
22
|
-
}
|
|
File without changes
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
@if (isInForm() ) {
|
|
2
|
-
<ng-container [formGroup]="formGroup()">
|
|
3
|
-
<div class="flex flex-row flex-nowrap items-center gap-2">
|
|
4
|
-
<div class="flex-none"><span>Occurs every</span></div>
|
|
5
|
-
<div class="flex-none"><p-inputnumber [showButtons]="true" formControlName="every" [min]="0" [inputSize]="3"></p-inputnumber></div>
|
|
6
|
-
<div class="flex-none"><p-select formControlName="item" [options]="allIntervalItems()" placeholder="Select interval"></p-select></div>
|
|
7
|
-
</div>
|
|
8
|
-
</ng-container>
|
|
9
|
-
} @else {
|
|
10
|
-
@let interval = displayValue();
|
|
11
|
-
@if (interval) {
|
|
12
|
-
<span>Occurs every
|
|
13
|
-
@if ((interval.every!=null)&&(interval.every!=1)) {
|
|
14
|
-
{{ interval.every }}
|
|
15
|
-
}
|
|
16
|
-
{{ interval.item}}
|
|
17
|
-
</span>
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { beforeEach, describe, expect, it } from 'vitest';
|
|
4
|
-
import { XtBaseContext } from 'xt-components';
|
|
5
|
-
import { By } from '@angular/platform-browser';
|
|
6
|
-
import { AgendaDateIntervalComponent } from './agenda-date-interval.component';
|
|
7
|
-
import { FormBuilder } from '@angular/forms';
|
|
8
|
-
import { InputNumber } from 'primeng/inputnumber';
|
|
9
|
-
import { provideNoopAnimations } from '@angular/platform-browser/animations';
|
|
10
|
-
import { SelectItem } from 'primeng/select';
|
|
11
|
-
|
|
12
|
-
describe('AgendaDateIntervalComponent', () => {
|
|
13
|
-
let component: AgendaDateIntervalComponent;
|
|
14
|
-
let fixture: ComponentFixture<AgendaDateIntervalComponent>;
|
|
15
|
-
|
|
16
|
-
beforeEach(async () => {
|
|
17
|
-
await TestBed.configureTestingModule({
|
|
18
|
-
imports: [AgendaDateIntervalComponent],
|
|
19
|
-
providers: [provideNoopAnimations()]
|
|
20
|
-
})
|
|
21
|
-
.compileComponents();
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should display interval', () => {
|
|
26
|
-
fixture = TestBed.createComponent(AgendaDateIntervalComponent);
|
|
27
|
-
const context=new XtBaseContext<any>('FULL_VIEW');
|
|
28
|
-
context.setDisplayValue({
|
|
29
|
-
every:3,
|
|
30
|
-
item:"Month"
|
|
31
|
-
});
|
|
32
|
-
fixture.componentRef.setInput("context", context);
|
|
33
|
-
component = fixture.componentInstance;
|
|
34
|
-
fixture.detectChanges();
|
|
35
|
-
expect(component).toBeTruthy();
|
|
36
|
-
const textContent=fixture.debugElement.query(By.css('span') ).nativeElement.textContent;
|
|
37
|
-
expect(textContent).contains('3');
|
|
38
|
-
expect(textContent).contains('Month');
|
|
39
|
-
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it ('should edit interval', async () => {
|
|
43
|
-
fixture = TestBed.createComponent(AgendaDateIntervalComponent);
|
|
44
|
-
const builder = TestBed.inject(FormBuilder);
|
|
45
|
-
const formGroup=builder.group({
|
|
46
|
-
test:builder.group({
|
|
47
|
-
every: [3], item: ["Month"]
|
|
48
|
-
})
|
|
49
|
-
})
|
|
50
|
-
const context=new XtBaseContext<any>('FULL_EDITABLE', 'test', formGroup);
|
|
51
|
-
fixture.componentRef.setInput("context", context);
|
|
52
|
-
component = fixture.componentInstance;
|
|
53
|
-
fixture.detectChanges();
|
|
54
|
-
expect(component).toBeTruthy();
|
|
55
|
-
|
|
56
|
-
const numberInput=fixture.debugElement.query(By.directive(InputNumber) );
|
|
57
|
-
expect (numberInput.componentInstance.value).toBe(3);
|
|
58
|
-
const itemInput=fixture.debugElement.query(By.css('.p-select-dropdown') );
|
|
59
|
-
expect(itemInput).toBeTruthy();
|
|
60
|
-
itemInput.nativeElement.click();
|
|
61
|
-
fixture.detectChanges();
|
|
62
|
-
const selectItems = fixture.debugElement.queryAll(By.directive(SelectItem) );
|
|
63
|
-
expect(selectItems.length).toEqual(4);
|
|
64
|
-
selectItems[1].children[0].nativeElement.click();
|
|
65
|
-
fixture.detectChanges();
|
|
66
|
-
|
|
67
|
-
await fixture.whenStable();
|
|
68
|
-
expect(formGroup.get('test')?.value).toEqual({
|
|
69
|
-
every:3,
|
|
70
|
-
item:'Week'
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
|
2
|
-
import { XtRenderSubComponent, XtSimpleComponent } from 'xt-components';
|
|
3
|
-
import { InputNumber } from 'primeng/inputnumber';
|
|
4
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import { DateInterval } from '../type-handlers/date-interval';
|
|
6
|
-
import { Select } from 'primeng/select';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'xt-agenda-date-interval',
|
|
10
|
-
imports: [
|
|
11
|
-
InputNumber,
|
|
12
|
-
ReactiveFormsModule,
|
|
13
|
-
Select
|
|
14
|
-
],
|
|
15
|
-
templateUrl: './agenda-date-interval.component.html',
|
|
16
|
-
styleUrl: './agenda-date-interval.component.css',
|
|
17
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
18
|
-
})
|
|
19
|
-
export class AgendaDateIntervalComponent extends XtSimpleComponent<DateInterval> implements OnInit {
|
|
20
|
-
|
|
21
|
-
override ngOnInit(): void {
|
|
22
|
-
super.ngOnInit();
|
|
23
|
-
this.manageFormControl('every', true);
|
|
24
|
-
this.manageFormControl('item', true);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
allIntervalItems() {
|
|
28
|
-
return ['Day', 'Week', 'Month', 'Year'];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { XtResolverService } from 'xt-components';
|
|
2
|
-
import { AgendaDateIntervalComponent } from './date-interval/agenda-date-interval.component';
|
|
3
|
-
import { TaskCompleteHandler } from './type-handlers/task-complete-handler';
|
|
4
|
-
import { AgendaTaskCompleteComponent } from './task-complete/agenda-task-complete.component';
|
|
5
|
-
|
|
6
|
-
export function registerAgendaPlugin (resolverService:XtResolverService):string {
|
|
7
|
-
const pluginName = "Plugin Agenda";
|
|
8
|
-
console.info ('Registering '+pluginName);
|
|
9
|
-
resolverService.registerPlugin ({
|
|
10
|
-
name: pluginName,
|
|
11
|
-
uriLogo: 'pluginicon.png',
|
|
12
|
-
components: [
|
|
13
|
-
{
|
|
14
|
-
componentName: 'AgendaDateIntervalComponent',
|
|
15
|
-
componentClass: AgendaDateIntervalComponent,
|
|
16
|
-
typesHandled: ['date-interval']
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
componentName: 'AgendaTaskCompleteComponent',
|
|
20
|
-
componentClass: AgendaTaskCompleteComponent,
|
|
21
|
-
typesHandled: ['task-complete']
|
|
22
|
-
}
|
|
23
|
-
],
|
|
24
|
-
types: {
|
|
25
|
-
'task-complete': 'boolean',
|
|
26
|
-
'date-interval': {
|
|
27
|
-
every: 'number',
|
|
28
|
-
item: 'string'
|
|
29
|
-
},
|
|
30
|
-
'recurring-task': {
|
|
31
|
-
name: 'string',
|
|
32
|
-
picture: 'image',
|
|
33
|
-
occurs: 'date-interval'
|
|
34
|
-
},
|
|
35
|
-
'task': {
|
|
36
|
-
date: 'date',
|
|
37
|
-
repetition: 'recurring-task',
|
|
38
|
-
completed: 'task-complete'
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
actionHandlers: [{
|
|
42
|
-
types: ['task-complete'],
|
|
43
|
-
actions: {
|
|
44
|
-
'next-task': {
|
|
45
|
-
description:'Create next task occurrence',
|
|
46
|
-
visible: false,
|
|
47
|
-
handlerClass: TaskCompleteHandler
|
|
48
|
-
},
|
|
49
|
-
'remove-next-task': {
|
|
50
|
-
description:'Remove any next task occurrence',
|
|
51
|
-
visible: false,
|
|
52
|
-
handlerClass: TaskCompleteHandler
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
}]
|
|
57
|
-
});
|
|
58
|
-
return pluginName;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function registerPlugin (resolverService:XtResolverService):string {
|
|
62
|
-
return registerAgendaPlugin(resolverService);
|
|
63
|
-
}
|
|
File without changes
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
@if (isInForm() ) {
|
|
2
|
-
<ng-container [formGroup]="formGroup()">
|
|
3
|
-
<div class="flex flex-row flex-nowrap items-center gap-2">
|
|
4
|
-
<div class="flex-none"><span>Done</span></div>
|
|
5
|
-
<div class="flex-none"><p-checkbox [formControlName]="formControlName()" [binary]="true" (onChange)="taskCompleted ($event)"></p-checkbox></div>
|
|
6
|
-
</div>
|
|
7
|
-
</ng-container>
|
|
8
|
-
} @else {
|
|
9
|
-
@let done = displayValue();
|
|
10
|
-
@if (done!=null) {
|
|
11
|
-
<span>Done </span><p-checkbox [ngModel]="done" [binary]="true" [disabled]="true"></p-checkbox>
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { AgendaTaskCompleteComponent } from './agenda-task-complete.component';
|
|
4
|
-
import { beforeEach, describe, expect, it } from 'vitest';
|
|
5
|
-
import { XtBaseContext } from 'xt-components';
|
|
6
|
-
|
|
7
|
-
describe('RecurringTaskComplete', () => {
|
|
8
|
-
let component: AgendaTaskCompleteComponent;
|
|
9
|
-
let fixture: ComponentFixture<AgendaTaskCompleteComponent>;
|
|
10
|
-
|
|
11
|
-
beforeEach(async () => {
|
|
12
|
-
await TestBed.configureTestingModule({
|
|
13
|
-
imports: [AgendaTaskCompleteComponent]
|
|
14
|
-
})
|
|
15
|
-
.compileComponents();
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should create Task complete button', () => {
|
|
20
|
-
fixture = TestBed.createComponent(AgendaTaskCompleteComponent);
|
|
21
|
-
const context=new XtBaseContext<any>('FULL_VIEW');
|
|
22
|
-
context.setDisplayValue(true);
|
|
23
|
-
fixture.componentRef.setInput("context", context);
|
|
24
|
-
component = fixture.componentInstance;
|
|
25
|
-
fixture.detectChanges();
|
|
26
|
-
expect(component).toBeTruthy();
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
2
|
-
import { XtMessageHandler, XtResolverService, XtSimpleComponent } from 'xt-components';
|
|
3
|
-
import { Checkbox, CheckboxChangeEvent } from 'primeng/checkbox';
|
|
4
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import { XtStoreManagerService } from 'xt-store';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'xt-agenda-task-complete',
|
|
9
|
-
imports: [
|
|
10
|
-
Checkbox,
|
|
11
|
-
ReactiveFormsModule, FormsModule
|
|
12
|
-
],
|
|
13
|
-
templateUrl: './agenda-task-complete.component.html',
|
|
14
|
-
styleUrl: './agenda-task-complete.component.css',
|
|
15
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
16
|
-
})
|
|
17
|
-
export class AgendaTaskCompleteComponent extends XtSimpleComponent<boolean> {
|
|
18
|
-
msgHandler = inject(XtMessageHandler);
|
|
19
|
-
resolver = inject(XtResolverService);
|
|
20
|
-
storeMgr = inject(XtStoreManagerService);
|
|
21
|
-
|
|
22
|
-
taskCompleted($event: CheckboxChangeEvent) {
|
|
23
|
-
if ($event.checked==true) {
|
|
24
|
-
this.resolver.runAction(this.context(), 'next-task', this.storeMgr).catch((error:any) => {
|
|
25
|
-
this.msgHandler.errorOccurred(error, "Cannot create next task");
|
|
26
|
-
});
|
|
27
|
-
} else {
|
|
28
|
-
this.resolver.runAction(this.context(), 'remove-next-task', this.storeMgr).catch((error:any) => {
|
|
29
|
-
this.msgHandler.errorOccurred(error, "Cannot remove next task");
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { addDays, addMonths, addWeeks, addYears } from 'date-fns';
|
|
2
|
-
|
|
3
|
-
export type DateInterval = {
|
|
4
|
-
every: number;
|
|
5
|
-
item: DateIntervalItem;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export type DateIntervalItem= 'Day'|'Week'|'Month'|'Year';
|
|
9
|
-
|
|
10
|
-
export function addInterval (start:Date, interval:DateInterval|null|undefined): Date {
|
|
11
|
-
if (start == null) return start;
|
|
12
|
-
if ((interval==null) || (interval.item==null) || (interval.every==null)){
|
|
13
|
-
return new Date(start);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
switch (interval.item) {
|
|
17
|
-
case 'Day':
|
|
18
|
-
return addDays(start, interval.every);
|
|
19
|
-
case 'Week':
|
|
20
|
-
return addWeeks(start, interval.every);
|
|
21
|
-
case 'Month':
|
|
22
|
-
return addMonths(start, interval.every);
|
|
23
|
-
case 'Year':
|
|
24
|
-
return addYears(start, interval.every);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ManagedData } from 'xt-type';
|
|
2
|
-
import { DateInterval } from './date-interval';
|
|
3
|
-
|
|
4
|
-
export type RecurringTask = ManagedData &{
|
|
5
|
-
name: string;
|
|
6
|
-
picture?: string;
|
|
7
|
-
occurs?: DateInterval;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export type Task = ManagedData & {
|
|
11
|
-
date: Date;
|
|
12
|
-
completed: boolean;
|
|
13
|
-
repetition: RecurringTask;
|
|
14
|
-
}
|