feat: update to angular 14 and latest kendo ui for angular packages (#1)

This commit is contained in:
Alexander Ziskind 2022-06-13 04:13:11 -05:00 коммит произвёл GitHub
Родитель 9ac8c45320
Коммит 426f9358a4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
40 изменённых файлов: 17445 добавлений и 13858 удалений

21
Dockerfile Normal file
Просмотреть файл

@ -0,0 +1,21 @@
FROM node:16 AS frontend
WORKDIR /var/tmp
ADD package.json .
ADD package-lock.json .
RUN npm install
RUN npx ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points
ADD . .
RUN npm run build -- -c production
FROM nginx:stable
COPY --from=frontend /var/tmp/dist/rpstrackerng14 /usr/share/nginx/html
EXPOSE 80

Просмотреть файл

@ -1,10 +1,10 @@
# rpstrackerng
# Rpstrackerng14
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.1.4.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 14.0.1.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
## Code scaffolding
@ -12,7 +12,7 @@ Run `ng generate component component-name` to generate a new component. You can
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## Running unit tests
@ -20,8 +20,8 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

Просмотреть файл

@ -3,79 +3,87 @@
"version": 1,
"newProjectRoot": "projects",
"projects": {
"rpstrackerng": {
"rpstrackerng14": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
}
},
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/rpstrackerng",
"outputPath": "dist/rpstrackerng14",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
{
"input": "node_modules/@progress/kendo-theme-bootstrap/dist/all.css",
"inject": true
"input": "node_modules/@progress/kendo-theme-default/dist/all.css"
},
"src/styles.css"
"src/styles.scss"
],
"scripts": [],
"aot": true
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
]
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "rpstrackerng:build"
},
"configurations": {
"production": {
"browserTarget": "rpstrackerng:build:production"
"browserTarget": "rpstrackerng14:build:production"
},
"development": {
"browserTarget": "rpstrackerng14:build:development"
}
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "rpstrackerng:build"
"browserTarget": "rpstrackerng14:build"
}
},
"test": {
@ -83,64 +91,23 @@
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
{
"input": "node_modules/@progress/kendo-theme-default/dist/all.css",
"inject": true
},
"src/styles.css"
],
"scripts": [],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"rpstrackerng-e2e": {
"root": "e2e/",
"projectType": "application",
"prefix": "",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "rpstrackerng:serve"
},
"configurations": {
"production": {
"devServerTarget": "rpstrackerng:serve:production"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
"styles": [
{
"input": "node_modules/@progress/kendo-theme-default/dist/all.css"
},
"src/styles.scss"
],
"scripts": []
}
}
}
}
},
"defaultProject": "rpstrackerng"
}
}
}

Просмотреть файл

@ -1,28 +0,0 @@
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.e2e.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};

Просмотреть файл

@ -1,14 +0,0 @@
import { AppPage } from './app.po';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('Welcome to rpstrackerng!');
});
});

Просмотреть файл

@ -1,11 +0,0 @@
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo() {
return browser.get('/');
}
getTitleText() {
return element(by.css('app-root h1')).getText();
}
}

Просмотреть файл

@ -1,13 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}

Просмотреть файл

@ -9,16 +9,28 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../coverage'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/rpstrackerng14'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
@ -26,6 +38,7 @@ module.exports = function (config) {
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false
singleRun: false,
restartOnFileChange: true
});
};
};

30372
package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,78 +1,64 @@
{
"name": "rpstrackerng",
"name": "rpstrackerng14",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~11.2.0",
"@angular/common": "~11.2.0",
"@angular/compiler": "~11.2.0",
"@angular/core": "~11.2.0",
"@angular/forms": "~11.2.0",
"@angular/platform-browser": "~11.2.0",
"@angular/platform-browser-dynamic": "~11.2.0",
"@angular/router": "~11.2.0",
"@ng-bootstrap/ng-bootstrap": "^7.0.0",
"@progress/kendo-angular-buttons": "^6.0.0",
"@progress/kendo-angular-charts": "^5.1.0",
"@progress/kendo-angular-dateinputs": "^5.0.0",
"@progress/kendo-angular-dialog": "^5.0.0",
"@progress/kendo-angular-dropdowns": "^5.0.0",
"@progress/kendo-angular-excel-export": "^4.0.0",
"@progress/kendo-angular-grid": "^5.0.2",
"@progress/kendo-angular-inputs": "^7.0.0",
"@progress/kendo-angular-intl": "^3.0.0",
"@progress/kendo-angular-l10n": "^3.0.0",
"@progress/kendo-angular-layout": "^6.1.2",
"@progress/kendo-angular-popup": "^4.0.0",
"@progress/kendo-angular-scheduler": "^2.1.1",
"@angular/animations": "^14.0.0",
"@angular/common": "^14.0.0",
"@angular/compiler": "^14.0.0",
"@angular/core": "^14.0.0",
"@angular/forms": "^14.0.0",
"@angular/localize": "^14.0.0",
"@angular/platform-browser": "^14.0.0",
"@angular/platform-browser-dynamic": "^14.0.0",
"@angular/router": "^14.0.0",
"@progress/kendo-angular-buttons": "^8.0.0",
"@progress/kendo-angular-charts": "7.1.0",
"@progress/kendo-angular-common": "^3.0.0",
"@progress/kendo-angular-dateinputs": "^7.0.0",
"@progress/kendo-angular-dialog": "7.1.2",
"@progress/kendo-angular-dropdowns": "^7.0.0",
"@progress/kendo-angular-excel-export": "^5.0.0",
"@progress/kendo-angular-grid": "^7.1.0",
"@progress/kendo-angular-inputs": "^9.0.0",
"@progress/kendo-angular-intl": "^4.0.0",
"@progress/kendo-angular-l10n": "^4.0.0",
"@progress/kendo-angular-layout": "7.0.2",
"@progress/kendo-angular-popup": "^5.0.0",
"@progress/kendo-angular-scheduler": "4.1.0",
"@progress/kendo-data-query": "^1.0.0",
"@progress/kendo-date-math": "^1.5.1",
"@progress/kendo-date-math": "1.5.6",
"@progress/kendo-drawing": "^1.0.0",
"@progress/kendo-recurrence": "^1.0.1",
"@progress/kendo-theme-bootstrap": "^4.31.0",
"@progress/kendo-theme-default": "latest",
"bootstrap": "^4.2.1",
"core-js": "^2.5.4",
"hammerjs": "^2.0.0",
"rxjs": "~6.6.3",
"rxjs-compat": "^6.0.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.3",
"@progress/kendo-angular-common": "^2.0.0",
"@progress/kendo-angular-label": "^3.0.0",
"@progress/kendo-angular-pdf-export": "^3.0.0",
"@progress/kendo-licensing": "^1.0.2",
"@progress/kendo-angular-treeview": "^5.0.0",
"@angular/localize": "~11.2.0",
"@progress/kendo-angular-progressbar": "^2.0.0"
"@progress/kendo-recurrence": "1.0.3",
"@progress/kendo-theme-bootstrap": "^4.31.0",
"@progress/kendo-theme-default": "^5.0.0",
"bootstrap": "^4.2.1",
"rxjs": "^6.6.3",
"tslib": "^2.3.0",
"zone.js": "~0.11.4",
"@progress/kendo-angular-label": "^4.0.0",
"@progress/kendo-angular-pdf-export": "^4.0.0",
"@progress/kendo-angular-treeview": "^7.0.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1102.0",
"@angular/cli": "~11.2.0",
"@angular/compiler-cli": "~11.2.0",
"@angular/language-service": "~11.2.0",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"@angular-devkit/build-angular": "^14.0.1",
"@angular/cli": "~14.0.1",
"@angular/compiler-cli": "^14.0.0",
"@types/jasmine": "~4.0.0",
"jasmine-core": "~4.1.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~7.0.0",
"tslint": "~6.1.0",
"typescript": "~4.1.5"
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.7.2"
}
}

Просмотреть файл

@ -19,7 +19,6 @@ const tempCurrentUser = {
styleUrls: ['./app.component.css']
})
export class AppComponent {
constructor(private store: Store) {
this.store.set<PtUser>('currentUser', tempCurrentUser);
}

Просмотреть файл

@ -5,18 +5,18 @@ export class StorageNsService {
setItem<T>(key: string, value: T): void {
const valueStr = JSON.stringify(value);
localStorage.setString(key, valueStr);
localStorage.setItem(key, valueStr);
}
getItem<T>(key: string): T | undefined {
const valueStr = localStorage.getString(key);
const valueStr = localStorage.getItem(key);
if (valueStr) {
return JSON.parse(valueStr);
}
}
removeItem(key: string): void {
localStorage.remove(key);
localStorage.removeItem(key);
}
key(keyIndex: number): string {

Просмотреть файл

@ -30,5 +30,4 @@ export class PtListComponent {
public listItemTap(item: PtItem) {
this.listItemSelected.emit(item);
}
}

Просмотреть файл

@ -73,26 +73,26 @@
<img [src]="selectedAssignee?.avatar" class="li-avatar rounded" />
<span>{{ itemForm.assigneeName }}</span>
<button class="btn btn-sm btn-outline-secondary" (click)="assigneePickerOpen(content)">Pick assignee</button>
<button class="btn btn-sm btn-outline-secondary" (click)="assigneePickerOpen('custom-modal-1')">Pick assignee</button>
</div>
</div>
</form>
<ng-template #content let-modal>
<custom-modal id="custom-modal-1">
<div class="modal-header">
<h4 class="modal-title" id="modal-basic-title">Select Assignee</h4>
<button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
<button type="button" class="close" aria-label="Close" (click)="closeModal('custom-modal-1')">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<ul class="list-group list-group-flush">
<li *ngFor="let user of users$ | async" class="list-group-item d-flex justify-content-between align-items-center"
(click)="modal.close(user)">
<span>{{ user.fullName }}</span>
(click)="selectUser(user, 'custom-modal-1')">
<span>{{ user?.fullName }}</span>
<span class="badge ">
<img [src]="user.avatar" class="li-avatar rounded mx-auto d-block" />
<img [src]="user?.avatar" class="li-avatar rounded mx-auto d-block" />
</span>
</li>
</ul>
@ -100,4 +100,4 @@
<div class="modal-footer">
</div>
</ng-template>
</custom-modal>

Просмотреть файл

@ -7,7 +7,7 @@ import { PriorityEnum } from 'src/app/core/models/domain/enums';
import { ItemType, PT_ITEM_STATUSES, PT_ITEM_PRIORITIES } from 'src/app/core/constants';
import { Observable } from 'rxjs';
import { Store } from 'src/app/core/state/app-store';
import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap';
import { ModalService } from 'src/app/shared/services/modal.service';
@Component({
selector: 'app-item-details',
@ -36,7 +36,7 @@ export class PtItemDetailsComponent implements OnInit {
constructor(
private store: Store,
private modalService: NgbModal
private modalService: ModalService,
) { }
public ngOnInit() {
@ -65,17 +65,26 @@ export class PtItemDetailsComponent implements OnInit {
this.notifyUpdateItem();
}
public assigneePickerOpen(content: any) {
public assigneePickerOpen(id: string) {
this.usersRequested.emit();
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
if (typeof result === 'object' && this.itemForm) {
this.selectedAssignee = result;
this.itemForm.assigneeName = (result as PtUser).fullName;
this.notifyUpdateItem();
}
}, (reason) => {
this.openModal(id);
}
});
public selectUser(selectedUser: PtUser, id: string) {
if (typeof selectedUser === 'object' && this.itemForm) {
this.selectedAssignee = selectedUser;
this.itemForm.assigneeName = (selectedUser as PtUser).fullName;
this.notifyUpdateItem();
}
this.closeModal(id);
}
openModal(id: string) {
this.modalService.open(id);
}
closeModal(id: string) {
this.modalService.close(id);
}
private notifyUpdateItem() {

Просмотреть файл

@ -4,7 +4,7 @@
<app-preset-filter></app-preset-filter>
<div class="btn-group mr-2">
<button kendoButton type="button" (click)="onAddTap(content)" class="btn btn-sm btn-outline-secondary" icon="plus">Add</button>
<button kendoButton type="button" (click)="onAddTap('custom-modal-1')" class="btn btn-sm btn-outline-secondary" icon="plus">Add</button>
</div>
</div>
@ -45,10 +45,10 @@
</kendo-grid>
<ng-template #content let-modal>
<custom-modal id="custom-modal-1">
<div class="modal-header">
<h4 class="modal-title" id="modal-basic-title">Add New Item</h4>
<button type="button" class="close" aria-label="Close" (click)="modal.dismiss('Cross click')">
<button type="button" class="close" aria-label="Close" (click)="closeModal('custom-modal-1')">
<span aria-hidden="true">&times;</span>
</button>
</div>
@ -80,8 +80,8 @@
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal" (click)="modal.dismiss('Cross click')">Close</button>
<button type="button" class="btn btn-primary" [disabled]="!newItem.title" (click)="modal.close(newItem)">Save
<button type="button" class="btn btn-outline-secondary" data-dismiss="modal" (click)="closeModal('custom-modal-1')">Close</button>
<button type="button" class="btn btn-primary" [disabled]="!newItem.title" (click)="onSaveTap(newItem,'custom-modal-1')">Save
changes</button>
</div>
</ng-template>
</custom-modal>

Просмотреть файл

@ -7,11 +7,11 @@ import { NavigationService } from 'src/app/core/services';
import { BacklogService } from '../../services/backlog.service';
import { PtItem } from 'src/app/core/models/domain';
import { PresetType } from 'src/app/core/models/domain/types';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { PtNewItem } from 'src/app/shared/models/dto';
import { EMPTY_STRING } from 'src/app/core/helpers';
import { ItemType } from 'src/app/core/constants';
import { Store } from 'src/app/core/state/app-store';
import { ModalService } from 'src/app/shared/services/modal.service';
import { PageChangeEvent, GridDataResult, SelectableSettings, SelectionEvent } from '@progress/kendo-angular-grid';
import { PriorityEnum } from 'src/app/core/models/domain/enums';
import { SortDescriptor, orderBy, State, process } from '@progress/kendo-data-query';
@ -57,7 +57,7 @@ export class BacklogPageComponent implements OnInit {
private activatedRoute: ActivatedRoute,
private navigationService: NavigationService,
private backlogService: BacklogService,
private modalService: NgbModal,
private modalService: ModalService,
private store: Store
) { }
@ -150,19 +150,28 @@ export class BacklogPageComponent implements OnInit {
this.navigationService.navigate(['/detail', item.id]);
}
public onAddTap(content: any) {
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
if (typeof result === 'object') {
if (this.store.value.currentUser) {
this.backlogService.addNewPtItem(result, this.store.value.currentUser)
.then(nextItem => {
this.items$.next([nextItem, ...this.items$.value]);
});
}
this.resetModalFields();
}
}, (reason) => {
public onAddTap(id: string) {
this.openModal(id);
}
});
onSaveTap(newItem: PtNewItem, id: string) {
if (typeof newItem === 'object') {
if (this.store.value.currentUser) {
this.backlogService.addNewPtItem(newItem, this.store.value.currentUser)
.then(nextItem => {
this.items$.next([nextItem, ...this.items$.value]);
});
}
this.closeModal(id);
}
}
openModal(id: string) {
this.modalService.open(id);
}
closeModal(id: string) {
this.modalService.close(id);
this.resetModalFields();
}
}

Просмотреть файл

@ -148,7 +148,6 @@ export class BacklogService {
});
}
public updatePtTask(currentItem: PtItem, task: PtTask, toggle: boolean, newTitle?: string): Promise<PtTask> {
const taskToUpdate: PtTask = {

Просмотреть файл

@ -27,14 +27,14 @@
</kendo-combobox>
<kendo-buttongroup selection="single" look="flat">
<button kendoButton toggleable="true" primary="true" icon="calendar" type="button" class="btn btn-sm btn-outline-secondary"
<kendo-buttongroup selection="single">
<button kendoButton toggleable="true" icon="calendar" type="button" class="btn btn-sm btn-outline-secondary"
(click)="onMonthRangeTap(3)">3
Months</button>
<button kendoButton toggleable="true" look="outline" icon="calendar" type="button" class="btn btn-sm btn-outline-secondary"
<button kendoButton toggleable="true" icon="calendar" type="button" class="btn btn-sm btn-outline-secondary"
(click)="onMonthRangeTap(6)">6
Months</button>
<button kendoButton toggleable="true" look="flat" icon="calendar" type="button" class="btn btn-sm btn-outline-secondary"
<button kendoButton toggleable="true" icon="calendar" type="button" class="btn btn-sm btn-outline-secondary"
(click)="onMonthRangeTap(12)">1
Year</button>
</kendo-buttongroup>

Просмотреть файл

@ -1,9 +1,12 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { BehaviorSubject, Subscription, Observable } from 'rxjs';
import { DashboardService } from '../../services/dashboard.service';
import { DashboardFilter, FilteredIssues } from '../../repositories/dashboard.repository';
import { FilteredIssues } from '../../repositories/dashboard.repository';
import { Store } from 'src/app/core/state/app-store';
import { StatusCounts } from '../../models';
import { BehaviorSubject, Subscription, Observable } from 'rxjs';
import { DashboardFilter } from 'src/app/shared/models/dto/stats/dashboard-filter';
import { PtUserService } from 'src/app/core/services';
import { PtUser } from 'src/app/core/models/domain';

Просмотреть файл

@ -1,19 +1,15 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment as env } from '../../../../environments/environment';
import { Observable } from 'rxjs';
import { StatusCounts, PriorityCounts, TypeCounts } from '../models';
import { DashboardFilter } from 'src/app/shared/models/dto/stats/dashboard-filter';
import { PtItem } from 'src/app/core/models/domain';
export interface DashboardFilter {
userId?: number;
dateStart?: Date;
dateEnd?: Date;
}
export interface ItemsForMonth {
closed: PtItem[];
open: PtItem[];

Просмотреть файл

@ -2,8 +2,9 @@ import { Injectable, NgZone } from '@angular/core';
import { Observable } from 'rxjs';
import { DashboardRepository, DashboardFilter, FilteredIssues } from '../repositories/dashboard.repository';
import { DashboardRepository, FilteredIssues } from '../repositories/dashboard.repository';
import { TypeCounts, PriorityCounts, StatusCounts } from '../models';
import { DashboardFilter } from 'src/app/shared/models/dto/stats/dashboard-filter';
@Injectable()
export class DashboardService {

Просмотреть файл

@ -0,0 +1,16 @@
<div class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<ng-content></ng-content>
</div>
</div>
</div>
<!--div class="custom-modal">
<div class="custom-modal-body">
<ng-content></ng-content>
</div>
</div-->
<div class="custom-modal-background"></div>

Просмотреть файл

@ -0,0 +1,35 @@
custom-modal {
display: none;
.custom-modal {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 1000;
overflow: auto;
.custom-modal-body {
padding: 20px;
background: #fff;
margin: 40px;
}
}
.custom-modal-background {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: #000;
opacity: 0.75;
z-index: 900;
}
}
body {
&.custom-modal-open {
overflow: hidden;
}
&.custom-modal-open .modal {
display: block;
}
}

Просмотреть файл

@ -0,0 +1,53 @@
import { Component, ViewEncapsulation, ElementRef, Input, OnInit, OnDestroy } from '@angular/core';
import { ModalService } from '../../services/modal.service';
@Component({
selector: 'custom-modal',
templateUrl: 'modal-dialog.component.html',
styleUrls: ['modal-dialog.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class ModalComponent implements OnInit, OnDestroy {
@Input() id: string;
private element: any;
constructor(private modalService: ModalService, private el: ElementRef) {
this.element = el.nativeElement;
}
ngOnInit(): void {
if (!this.id) {
console.error('modal must have an id');
return;
}
document.body.appendChild(this.element);
this.element.addEventListener('click', el => {
if (el.target.className === 'custom-modal') {
this.close();
}
});
this.modalService.add(this);
}
ngOnDestroy(): void {
this.modalService.remove(this.id);
this.element.remove();
}
open(): void {
this.element.style.display = 'block';
document.body.classList.add('custom-modal-open');
}
close(): void {
this.element.style.display = 'none';
document.body.classList.remove('custom-modal-open');
}
}

Просмотреть файл

@ -0,0 +1,5 @@
export interface DashboardFilter {
userId?: number;
dateStart?: Date;
dateEnd?: Date;
}

Просмотреть файл

@ -0,0 +1,24 @@
import { Injectable } from '@angular/core';
@Injectable({ providedIn: 'root' })
export class ModalService {
private modals: any[] = [];
add(modal: any) {
this.modals.push(modal);
}
remove(id: string) {
this.modals = this.modals.filter(x => x.id !== id);
}
open(id: string) {
const modal = this.modals.find(x => x.id === id);
modal.open();
}
close(id: string) {
const modal = this.modals.find(x => x.id === id);
modal.close();
}
}

Просмотреть файл

@ -2,7 +2,6 @@ import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { LayoutModule } from '@progress/kendo-angular-layout';
import { ButtonsModule } from '@progress/kendo-angular-buttons';
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
@ -15,6 +14,7 @@ import { PresetFilterComponent } from './components/preset-filter/preset-filter.
import { MainMenuComponent } from './components/main-menu/main-menu.component';
import { SideMenuComponent } from './components/side-menu/side-menu.component';
import { ModalComponent } from './components/modal-dialog/modal-dialog.component';
import 'hammerjs';
@ -22,7 +22,6 @@ import 'hammerjs';
imports: [
FormsModule,
RouterModule,
NgbModule,
LayoutModule,
ButtonsModule,
DropDownsModule,
@ -36,7 +35,7 @@ import 'hammerjs';
MainMenuComponent,
SideMenuComponent,
PresetFilterComponent,
NgbModule,
ModalComponent,
LayoutModule,
ButtonsModule,
DropDownsModule,
@ -48,7 +47,8 @@ import 'hammerjs';
declarations: [
MainMenuComponent,
SideMenuComponent,
PresetFilterComponent
PresetFilterComponent,
ModalComponent,
],
providers: [],
})

Двоичные данные
src/favicon.ico

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 5.3 KiB

После

Ширина:  |  Высота:  |  Размер: 948 B

Просмотреть файл

@ -1,17 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>rpstrackerng</title>
<title>Rpstrackerng14</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>

Просмотреть файл

@ -12,8 +12,8 @@ import '@angular/localize/init';
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
* automatically update themselves. This includes recent versions of Safari, Chrome (including
* Opera), Edge on the desktop, and iOS and Chrome on mobile.
*
* Learn more in https://angular.io/guide/browser-support
*/
@ -22,18 +22,6 @@ import '@angular/localize/init';
* BROWSER POLYFILLS
*/
/**
* IE11 requires the following for NgClass support on SVG elements
*/
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
@ -61,7 +49,7 @@ import '@angular/localize/init';
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.
/***************************************************************************************************

Просмотреть файл

Просмотреть файл

@ -1,20 +1,26 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone-testing';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
<T>(id: string): T;
keys(): string[];
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
platformBrowserDynamicTesting(),
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
context.keys().forEach(context);

Просмотреть файл

@ -1,14 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"types": []
},
"files": [
"main.ts",
"polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}

Просмотреть файл

@ -1,18 +0,0 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"test.ts",
"polyfills.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}

Просмотреть файл

@ -1,17 +0,0 @@
{
"extends": "../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"app",
"camelCase"
],
"component-selector": [
true,
"element",
"app",
"kebab-case"
]
}
}

15
tsconfig.app.json Normal file
Просмотреть файл

@ -0,0 +1,15 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}

Просмотреть файл

@ -1,24 +1,32 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"downlevelIteration": true,
"forceConsistentCasingInFileNames": true,
"strict": false,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"module": "es2020",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"strict": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"target": "es2020",
"module": "es2020",
"lib": [
"es2018",
"es2020",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": false
}
}

18
tsconfig.spec.json Normal file
Просмотреть файл

@ -0,0 +1,18 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}

Просмотреть файл

@ -1,130 +0,0 @@
{
"rulesDirectory": [
"codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"deprecation": {
"severity": "warn"
},
"eofline": true,
"forin": true,
"import-blacklist": [
true,
"rxjs/Rx"
],
"import-spacing": true,
"indent": [
true,
"spaces"
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-misused-new": true,
"no-host-metadata-property": true,
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-inputs-metadata-property": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-outputs-metadata-property": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"no-output-on-prefix": true,
"no-input-rename": true,
"use-lifecycle-interface": true,
"no-output-rename": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
}
}