Skip to content
Snippets Groups Projects
Commit ac949c5e authored by Igor Ignác's avatar Igor Ignác
Browse files

Resolve "Prepare project for integration and do refactor"

parent bb133760
No related branches found
No related tags found
No related merge requests found
Showing
with 15015 additions and 1 deletion
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
quote_type = single
[*.md]
max_line_length = off
trim_trailing_whitespace = false
{
"root": true,
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": [
"tsconfig.*?.json"
],
"createDefaultProgram": true
},
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@angular-eslint/recommended"
],
"rules": {
"max-len": ["error", { "code": 140, "ignorePattern": "import .*" }],
"@angular-eslint/directive-selector": [
"error",
{ "type": "attribute", "prefix": "app", "style": "camelCase" }
],
"@angular-eslint/component-selector": [
"error",
{ "type": "element", "prefix": "app", "style": "kebab-case" }
],
"quotes": ["error", "single", { "allowTemplateLiterals": true }]
}
},
{
"files": ["*.component.html"],
"extends": ["plugin:@angular-eslint/template/recommended"],
"rules": {
"max-len": ["error", { "code": 140 }]
}
},
{
"files": ["*.component.ts"],
"extends": ["plugin:@angular-eslint/template/process-inline-templates"]
}
]
}
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
/nbproject/
image: cypress/browsers:node12.18.0-chrome83-ff77
stages:
- codeStyle
- build
- auto-tag
- deploy
cache:
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
paths:
- .npm/
before_script:
- cp $NPMRC_PULL ~/.npmrc
- npm ci --cache .npm --prefer-offline --ignore-scripts
codeStyle:
stage: codeStyle
cache:
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
paths:
- .npm/
policy: pull
script:
- npm run lint
only:
- triggers
- branches
except:
changes:
- "CHANGELOG.md"
buildExampleApp:
stage: build
cache:
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
paths:
- .npm/
policy: pull
script:
- npm run build-example-app
only:
- triggers
- branches
artifacts:
paths:
- ./dist
expire_in: 1 hour
except:
changes:
- "CHANGELOG.md"
buildLibrary:
stage: build
cache:
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
paths:
- .npm/
policy: pull
script:
- npm run build-library
only:
- triggers
- branches
artifacts:
paths:
- ./dist
expire_in: 1 hour
except:
changes:
- "CHANGELOG.md"
auto-tag:
image: 'registry.gitlab.ics.muni.cz:443/csirt-mu-devel/csirt-mu-devel-artifact-repository/docker-common-ci:v0.1.6'
variables:
GIT_STRATEGY: clone
stage: auto-tag
script:
- source /app/export-tag-vars.sh VERSION.txt
- echo $TAG_VERSION && echo $TAG_MESSAGE
- /app/import-ssh-key.sh
- /app/prepare-git.sh
- /app/set-version-angular.sh
- /app/create-changelog.sh
- /app/tag-and-push.sh
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
changes:
- VERSION.txt
deploy:
stage: deploy
cache:
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
paths:
- .npm/
policy: pull
script:
- cp $NPMRC_PULL ~/.npmrc
- npm run ci-build-and-pack
- cp $NPMRC_PUSH ~/.npmrc
- npm run ci-publish-package
only:
- tags
{
"printWidth": 120,
"singleQuote": true,
"useTabs": false,
"tabWidth": 2,
"semi": true,
"bracketSpacing": true
}
Copyright 2020 MASARYK UNIVERSITY
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
# kypo-command-visualizations
# Training command graph visualization
## How to use json-server as mock backend with provided dummy data
1. Install json-server `npm install -g json-server`.
3. Run the server with provided parameters `json-server -w ./utils/json-server/db.js --routes ./utils/json-server/routes.json --middlewares ./utils/json-server/server.js`.
4. Run `npm install`.
5. Run the app in local environment and ssl `ng serve --configuration local --ssl` and access it on `https://localhost:4200`.
### Running up the Project:
Install project dependencies:
```
$ npm install
```
Then run
```
$ ng serve --ssl
```
Navigate to `https://localhost:4200/`. The app will automatically reload if you change any of the source files.
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"analytics": false
},
"version": 1,
"newProjectRoot": "projects",
"projects": {
"kypo-command-visualizations": {
"projectType": "library",
"root": "projects/kypo-command-visualizations",
"sourceRoot": "projects/kypo-command-visualizations/src",
"prefix": "kypo-command-visualizations",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/kypo-command-visualizations/tsconfig.lib.json",
"project": "projects/kypo-command-visualizations/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/kypo-command-visualizations/tsconfig.lib.prod.json"
},
"development": {}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/kypo-command-visualizations/test.ts",
"tsConfig": "projects/kypo-command-visualizations/tsconfig.spec.json",
"karmaConfig": "projects/kypo-command-visualizations/karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"projects/kypo-command-visualizations/**/*.ts",
"projects/kypo-command-visualizations/**/*.html"
]
}
}
}
},
"kypo-command-visualizations-example": {
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "projects/kypo-command-visualizations-example",
"sourceRoot": "projects/kypo-command-visualizations-example/src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/kypo-command-visualizations-example",
"index": "projects/kypo-command-visualizations-example/src/index.html",
"main": "projects/kypo-command-visualizations-example/src/main.ts",
"polyfills": "projects/kypo-command-visualizations-example/src/polyfills.ts",
"tsConfig": "projects/kypo-command-visualizations-example/tsconfig.app.json",
"assets": [
"projects/kypo-command-visualizations-example/src/favicon.ico",
"projects/kypo-command-visualizations-example/src/assets"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"node_modules/animate.css/animate.css",
"projects/kypo-command-visualizations-example/src/styles.css"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/chart.js/dist/Chart.js"
],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "projects/kypo-command-visualizations-example/src/environments/environment.ts",
"with": "projects/kypo-command-visualizations-example/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",
"maximumError": "10kb"
}
]
},
"local": {
"budgets": [
{
"type": "anyComponentStyle",
"maximumWarning": "6kb"
}
],
"fileReplacements": [
{
"replace": "projects/kypo-command-visualizations-example/src/environments/environment.ts",
"with": "projects/kypo-command-visualizations-example/src/environments/environment.local.ts"
}
]
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "kypo-command-visualizations-example:build"
},
"configurations": {
"production": {
"browserTarget": "kypo-command-visualizations-example:build:production"
},
"local": {
"browserTarget": "kypo-command-visualizations-example:build:local"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "kypo-command-visualizations-example:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.css"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": [
"projects/kypo-command-visualizations-example/src/app/visualizations/**/*.ts",
"projects/kypo-command-visualizations-example/**/*.component.html"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "kypo-command-visualizations-example:serve"
},
"configurations": {
"production": {
"devServerTarget": "kypo-command-visualizations-example:serve:production"
}
}
}
}
}
},
"defaultProject": "kypo-command-visualizations"
}
// 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 } }));
}
};
\ No newline at end of file
import { AppPage } from './app.po';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
});
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "commonjs",
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
\ No newline at end of file
This diff is collapsed.
{
"name": "@muni-kypo-crp/command-visualizations",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint && npm run prettier-check",
"e2e": "ng e2e",
"prettier-check": "prettier --check \"projects/**/*.ts\"",
"prettier-fix": "prettier --write \"./projects/**/*.ts\"",
"build-example-app": "ng build kypo-command-visualizations-example --configuration production",
"build-library": "ng build --configuration production kypo-command-visualizations",
"create-package": "cd dist/kypo-command-visualizations && npm pack",
"build-and-pack": "npm install && npm run build-library && npm run create-package",
"ci-update-version": "cd ./projects/kypo-command-visualizations/ && npm version $TAG_VERSION",
"ci-build-and-pack": "npm ci --cache .npm --prefer-offline && npm run build-library && npm run create-package",
"ci-publish-package": "cd dist/kypo-command-visualizations && npm publish"
},
"husky": {
"hooks": {
"pre-commit": "npm run prettier-check"
}
},
"private": true,
"dependencies": {
"@angular/animations": "^12.2.5",
"@angular/cdk": "^12.2.5",
"@angular/common": "~12.2.5",
"@angular/compiler": "~12.2.5",
"@angular/core": "~12.2.5",
"@angular/forms": "~12.2.5",
"@angular/material": "^12.2.5",
"@angular/platform-browser": "~12.2.5",
"@angular/platform-browser-dynamic": "~12.2.5",
"@angular/router": "~12.2.5",
"@angular-eslint/builder": "^12.0.0",
"@angular-eslint/eslint-plugin": "^12.0.0",
"@angular-eslint/eslint-plugin-template": "^12.0.0",
"@angular-eslint/schematics": "^12.0.0",
"@angular-eslint/template-parser": "^12.0.0",
"@typescript-eslint/parser": "^4.23.0",
"@typescript-eslint/eslint-plugin": "^4.23.0",
"eslint": "^7.13.0",
"@hpcc-js/wasm": "^1.3.0",
"@types/chart.js": "^2.9.31",
"@types/jquery": "^3.5.5",
"@sentinel/auth": "~12.0.0",
"@sentinel/common": "~12.2.1",
"@sentinel/components": "~12.3.1",
"@sentinel/layout": "~12.0.0",
"angular-oauth2-oidc": "^10.0.3",
"angular-oauth2-oidc-jwks": "^9.0.0",
"angular-mgl-timeline": "^0.4.0",
"animate.css": "^4.1.1",
"chart.js": "^2.5.0",
"d3-graphviz": "^2.6.1",
"husky": "^4.2.5",
"hammerjs": "^2.0.8",
"jquery": "^3.6.0",
"ngx-indexed-db": "^8.0.2",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.5",
"@angular/cli": "~12.2.5",
"@angular/compiler-cli": "~12.2.5",
"@types/d3-graphviz": "^2.6.6",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.2",
"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",
"ng-packagr": "~12.0.3",
"prettier": "2.3.0",
"ts-node": "~8.3.0",
"typescript": "~4.3.5"
}
}
{
"extends": ["../../.eslintrc.json"],
"overrides": [
{
"files": ["*.ts"],
"parserOptions": {
"project": ["projects/kypo-command-visualizations-example/tsconfig.*?.json"],
"createDefaultProgram": true
},
"rules": {
"@angular-eslint/directive-selector": [
"error",
{ "type": "attribute", "prefix": "app", "style": "camelCase" }
],
"@angular-eslint/component-selector": [
"error",
{ "type": "element", "prefix": "app", "style": "kebab-case" }
]
}
},
{
"files": ["*.component.html"],
"rules": {}
}
]
}
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '../..',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
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
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/kypo-command-visualizations-example'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { SentinelAuthGuardWithLogin, SentinelNegativeAuthGuard } from '@sentinel/auth/guards';
import { SentinelAuthProviderListComponent } from '@sentinel/auth/components';
const routes: Routes = [
{
path: 'home',
loadChildren: () => import('./visualizations/home-page/home-page.module').then((m) => m.HomePageModule),
canActivate: [SentinelAuthGuardWithLogin],
},
{
path: 'reference-graph',
loadChildren: () =>
import('./visualizations/reference-graph-page/reference-graph-page.module').then(
(m) => m.ReferenceGraphPageModule
),
canActivate: [SentinelAuthGuardWithLogin],
},
{
path: 'trainee-graph',
loadChildren: () =>
import('./visualizations/trainee-graph-page/trainee-graph-page.module').then((m) => m.TraineeGraphPageModule),
canActivate: [SentinelAuthGuardWithLogin],
},
{
path: 'mistake',
loadChildren: () => import('./visualizations/mistake-page/mistake-page.module').then((m) => m.MistakePageModule),
canActivate: [SentinelAuthGuardWithLogin],
},
{
path: 'timeline',
loadChildren: () => import('./visualizations/timeline-page/timeline-page.module').then((m) => m.TimelinePageModule),
canActivate: [SentinelAuthGuardWithLogin],
},
{
path: 'summary-graph',
loadChildren: () =>
import('./visualizations/summary-graph-page/summary-graph-page.module').then((m) => m.SummaryGraphPageModule),
canActivate: [SentinelAuthGuardWithLogin],
},
{
path: '',
redirectTo: 'home',
pathMatch: 'full',
},
{
path: 'login',
component: SentinelAuthProviderListComponent,
canActivate: [SentinelNegativeAuthGuard],
},
{
path: '**',
redirectTo: 'home',
},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
})
export class AppRoutingModule {}
<sentinel-layout1 notificationsRoute="notifications" [agendaContainers]="agendaContainers">
<router-outlet></router-outlet>
</sentinel-layout1>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment