Ajout de Angular.

Ajout des profiles thymeleaf et angular.
This commit is contained in:
FyloZ 2020-10-09 19:01:53 -04:00
parent 6a5a254c41
commit a16844d747
155 changed files with 13665 additions and 74 deletions

2
.gitignore vendored
View File

@ -9,3 +9,5 @@
/build/
/logs/
/workdir/
/src/main/resources/angular/static/*

View File

@ -49,6 +49,26 @@ java {
targetCompatibility = JavaVersion.VERSION_11
}
tasks.register("buildFrontend") {
exec {
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
commandLine("cmd", "/c", "cd src/main/frontend && npm run-script build && xcopy dist\\color-recipes-explorer-frontend\\* ..\\resources\\angular\\static\\ /Y /E ")
} else {
commandLine("sh", "-c", "cd src/main/frontend && npm run-script build && cp -r dist/color-recipes-explorer-frontend/* ../resources/angular/static/")
}
}
}
tasks.register("buildAngular") {
dependsOn("buildFrontend")
dependsOn(tasks.build)
}
tasks.register("bootJarAngular") {
dependsOn("buildFrontend")
dependsOn(tasks.bootJar)
}
tasks.test {
useJUnitPlatform()
testLogging {

View File

@ -0,0 +1,13 @@
# 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
[*.md]
max_line_length = off
trim_trailing_whitespace = false

46
src/main/frontend/.gitignore vendored Normal file
View File

@ -0,0 +1,46 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json
# 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
.history/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db

View File

@ -0,0 +1,27 @@
# ColorRecipesExplorerFrontend
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.5.
## 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.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## 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.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
## 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).

View File

@ -0,0 +1,131 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"color-recipes-explorer-frontend": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "sass"
}
},
"root": "",
"sourceRoot": "src",
"prefix": "cre",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/color-recipes-explorer-frontend",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/custom-theme.scss",
"src/styles.sass"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "color-recipes-explorer-frontend:build"
},
"configurations": {
"production": {
"browserTarget": "color-recipes-explorer-frontend:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "color-recipes-explorer-frontend: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": [
"src/styles.sass"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "color-recipes-explorer-frontend:serve"
},
"configurations": {
"production": {
"devServerTarget": "color-recipes-explorer-frontend:serve:production"
}
}
}
}
}
},
"defaultProject": "color-recipes-explorer-frontend"
}

View File

@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.

View File

@ -0,0 +1,32 @@
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
const { SpecReporter } = require('jasmine-spec-reporter');
/**
* @type { import("protractor").Config }
*/
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.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};

View File

@ -0,0 +1,23 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('color-recipes-explorer-frontend app is running!');
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry));
});
});

View File

@ -0,0 +1,11 @@
import { browser, by, element } from 'protractor';
export class AppPage {
navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl) as Promise<unknown>;
}
getTitleText(): Promise<string> {
return element(by.css('cre-root .content span')).getText() as Promise<string>;
}
}

View File

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

View File

@ -0,0 +1,32 @@
// 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('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, './coverage/color-recipes-explorer-frontend'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};

12552
src/main/frontend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
{
"name": "color-recipes-explorer-frontend",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --proxy-config proxy.conf.json",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~9.0.5",
"@angular/cdk": "^9.2.4",
"@angular/common": "~9.0.5",
"@angular/compiler": "~9.0.5",
"@angular/core": "~9.0.5",
"@angular/forms": "~9.0.5",
"@angular/material": "^9.2.4",
"@angular/platform-browser": "~9.0.5",
"@angular/platform-browser-dynamic": "~9.0.5",
"@angular/router": "~9.0.5",
"bootstrap": "^4.5.2",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.900.5",
"@angular/cli": "~9.0.5",
"@angular/compiler-cli": "~9.0.5",
"@angular/language-service": "~9.0.5",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~5.18.0",
"typescript": "~3.7.5"
}
}

View File

@ -0,0 +1,6 @@
{
"/api": {
"target": "http://localhost:9090",
"secure": false
}
}

View File

@ -0,0 +1,11 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
const routes: Routes = [{ path: 'color', loadChildren: () => import('./modules/colors/colors.module').then(m => m.ColorsModule) }];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }

View File

@ -0,0 +1,10 @@
<cre-header></cre-header>
<div>
<router-outlet *ngIf="isOnline; else isOffline"></router-outlet>
<ng-template #isOffline>
<div>
<p>Aucune connexion</p>
</div>
</ng-template>
</div>
<!-- FOOTER -->

View File

@ -0,0 +1,17 @@
import {Component, Inject, PLATFORM_ID} from '@angular/core';
import {isPlatformBrowser} from "@angular/common";
@Component({
selector: 'cre-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.sass']
})
export class AppComponent {
isOnline: boolean;
constructor(
@Inject(PLATFORM_ID) private platformId: object
) {
this.isOnline = isPlatformBrowser(this.platformId)
}
}

View File

@ -0,0 +1,22 @@
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { SharedModule } from './modules/shared/shared.module';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
SharedModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

View File

@ -0,0 +1,12 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ColorsComponent } from './colors.component';
const routes: Routes = [{ path: '', component: ColorsComponent }];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ColorsRoutingModule { }

View File

@ -0,0 +1 @@
<p>colors works!</p>

View File

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ColorsComponent } from './colors.component';
describe('ColorsComponent', () => {
let component: ColorsComponent;
let fixture: ComponentFixture<ColorsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ColorsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ColorsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'cre-colors',
templateUrl: './colors.component.html',
styleUrls: ['./colors.component.sass']
})
export class ColorsComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

View File

@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ColorsRoutingModule } from './colors-routing.module';
import { ColorsComponent } from './colors.component';
@NgModule({
declarations: [ColorsComponent],
imports: [
CommonModule,
ColorsRoutingModule
]
})
export class ColorsModule { }

View File

@ -0,0 +1,9 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class RecipeService {
constructor() { }
}

View File

@ -0,0 +1,16 @@
<header class="d-flex flex-row">
<nav class="d-flex flex-column flex-grow-1">
<div class="spacer"></div>
<div mat-tab-nav-bar backgroundColor="primary">
<a
*ngFor="let link of links"
mat-tab-link
(click)="activeLink = link.route"
[active]="activeLink == link.route">
{{ link.title }}
</a>
</div>
</nav>
<img src="assets/logo.png" alt="Logo" class="flex-grow-0"/>
</header>

View File

@ -0,0 +1,12 @@
header
background-color: black
nav
padding-bottom: 1px
.spacer
height: 20px
a
opacity: 1
font-size: 1.1em

View File

@ -0,0 +1,30 @@
import {Component} from '@angular/core';
import {Router} from "@angular/router";
@Component({
selector: 'cre-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.sass']
})
export class HeaderComponent {
links = [
{route: 'color', title: 'Couleurs'},
{route: 'inventory', title: 'Inventaire'},
{route: 'account', title: 'Connexion'}
];
_activeLink = this.links[0].route;
constructor(
private router: Router
) {
}
set activeLink(link: string) {
this._activeLink = link;
this.router.navigate([link]);
}
get activeLink() {
return this._activeLink;
}
}

View File

@ -0,0 +1,18 @@
import { NgModule } from '@angular/core';
import { HeaderComponent } from './components/header/header.component';
import {MatTabsModule} from "@angular/material/tabs";
import {CommonModule} from "@angular/common";
@NgModule({
declarations: [HeaderComponent],
exports: [
HeaderComponent
],
imports: [
MatTabsModule,
CommonModule
]
})
export class SharedModule { }

View File

View File

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 252 B

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -0,0 +1,101 @@
// Custom Theming for Angular Material
// For more information: https://material.angular.io/guide/theming
@import '~@angular/material/theming';
// Plus imports for other components in your app.
$custom-typography: mat-typography-config(
$font-family: "Open Sans"
);
// Include the common styles for Angular Material. We include this here so that you only
// have to load a single css file for Angular Material in your app.
// Be sure that you only ever include this mixin once!
@include mat-core($custom-typography);
// Define the palettes for your theme using the Material Design palettes available in palette.scss
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/
$color-recipes-explorer-frontend-primary: mat-palette((
50 : #e0e0e0,
100 : #b3b3b3,
200 : #808080,
300 : #4d4d4d,
400 : #262626,
500 : #000000,
600 : #000000,
700 : #000000,
800 : #000000,
900 : #000000,
A100 : #a6a6a6,
A200 : #8c8c8c,
A400 : #737373,
A700 : #666666,
contrast: (
50 : #000000,
100 : #000000,
200 : #000000,
300 : #ffffff,
400 : #ffffff,
500 : #ffffff,
600 : #ffffff,
700 : #ffffff,
800 : #ffffff,
900 : #ffffff,
A100 : #000000,
A200 : #000000,
A400 : #ffffff,
A700 : #ffffff,
)));
$color-recipes-explorer-frontend-accent: mat-palette((
50 : #edf9e0,
100 : #d1f0b3,
200 : #b3e680,
300 : #94db4d,
400 : #7dd426,
500 : #66cc00,
600 : #5ec700,
700 : #53c000,
800 : #49b900,
900 : #38ad00,
A100 : #e1ffd7,
A200 : #baffa4,
A400 : #94ff71,
A700 : #81ff58,
contrast: (
50 : #000000,
100 : #000000,
200 : #000000,
300 : #000000,
400 : #000000,
500 : #000000,
600 : #000000,
700 : #000000,
800 : #000000,
900 : #ffffff,
A100 : #000000,
A200 : #000000,
A400 : #000000,
A700 : #000000,
)
));
// The warn palette is optional (defaults to red).
$color-recipes-explorer-frontend-warn: mat-palette($mat-red);
// Create the theme object (a Sass map containing all of the palettes).
$color-recipes-explorer-frontend-theme: mat-light-theme($color-recipes-explorer-frontend-primary, $color-recipes-explorer-frontend-accent, $color-recipes-explorer-frontend-warn);
// Include theme styles for core and each component used in your app.
// Alternatively, you can import and @include the theme mixins for each component
// that you are using.
@include angular-material-theme($color-recipes-explorer-frontend-theme);
html, body {
height: 100%;
}
body {
margin: 0;
font-family: "Open Sans", Roboto, "Helvetica Neue", sans-serif;
}

View File

@ -0,0 +1,3 @@
export const environment = {
production: true
};

View File

@ -0,0 +1,16 @@
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = {
production: false
};
/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.

View File

@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ColorRecipesExplorerFrontend</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="assets/favicon.png">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<cre-root></cre-root>
</body>
</html>

View File

@ -0,0 +1,12 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));

View File

@ -0,0 +1,63 @@
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* 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.
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE10 and 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
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/

View File

@ -0,0 +1 @@
/* You can add global styles to this file, and also import other style files */

View File

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

View File

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

View File

@ -0,0 +1,23 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}

View File

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

View File

@ -0,0 +1,91 @@
{
"extends": "tslint:recommended",
"rules": {
"array-type": false,
"arrow-parens": false,
"deprecation": {
"severity": "warning"
},
"component-class-suffix": true,
"contextual-lifecycle": true,
"directive-class-suffix": true,
"directive-selector": [
true,
"attribute",
"cre",
"camelCase"
],
"component-selector": [
true,
"element",
"cre",
"kebab-case"
],
"import-blacklist": [
true,
"rxjs/Rx"
],
"interface-name": false,
"max-classes-per-file": false,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-consecutive-blank-lines": false,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-empty": false,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-switch-case-fall-through": true,
"no-var-requires": false,
"object-literal-key-quotes": [
true,
"as-needed"
],
"object-literal-sort-keys": false,
"ordered-imports": false,
"quotemark": [
true,
"single"
],
"trailing-comma": false,
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
"no-input-rename": true,
"no-inputs-metadata-property": true,
"no-output-native": true,
"no-output-on-prefix": true,
"no-output-rename": true,
"no-outputs-metadata-property": true,
"template-banana-in-box": true,
"template-no-negated-async": true,
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true
},
"rulesDirectory": [
"codelyzer"
]
}

View File

@ -0,0 +1,14 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.angular
import org.springframework.context.annotation.Profile
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.GetMapping
@Controller
@Profile("angular")
class AngularController {
@GetMapping("/explore")
fun frontend(): String {
return "forward:/"
}
}

View File

@ -1,8 +1,9 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ModelResponseBuilder;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseCode;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@ -13,6 +14,7 @@ import javax.servlet.http.HttpServletRequest;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.ERROR;
@Controller
@Profile("thymeleaf")
public class CREErrorController implements ErrorController {
@RequestMapping("/error")

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseCode
import dev.fyloz.trial.colorrecipesexplorer.core.utils.ControllerUtils

View File

@ -1,10 +1,11 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ModelResponseBuilder;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseDataType;
import dev.fyloz.trial.colorrecipesexplorer.core.services.PasswordService;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.RecipeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -16,6 +17,7 @@ import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.INDEX;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.PASSWORD_VALIDATION;
@Controller
@Profile("thymeleaf")
public class IndexController {
private RecipeService recipeService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.TooLowQuantityException;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.JSONResponseBuilder;
@ -10,6 +10,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.services.InventoryService;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialService;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
@ -27,6 +28,7 @@ import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.INVENTORY;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.USE_INVENTORY;
@Controller
@Profile("thymeleaf")
public class InventoryController {
private InventoryService inventoryService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ModelResponseBuilder;
@ -7,6 +7,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.services.files.MarkdownFilesSer
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MixService;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.RecipeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@ -20,6 +21,7 @@ import static dev.fyloz.trial.colorrecipesexplorer.web.StringBank.MATERIALS;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*;
@Controller
@Profile("thymeleaf")
public class OthersController {
private MixService mixService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.JSONResponseBuilder;
@ -9,6 +9,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.model.Recipe;
import dev.fyloz.trial.colorrecipesexplorer.core.model.dto.RecipeExplorerFormDto;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.RecipeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -19,6 +20,7 @@ import java.util.Map;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*;
@Controller
@Profile("thymeleaf")
public class RecipeExplorerController {
private RecipeService recipeService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.creators;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityAlreadyExistsException;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ModelResponseBuilder;
@ -7,6 +7,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseDataType;
import dev.fyloz.trial.colorrecipesexplorer.core.model.Company;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@ -19,6 +20,7 @@ import javax.validation.Valid;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.CREATOR_COMPANY;
@Controller
@Profile("thymeleaf")
public class CompanyCreatorController {
private CompanyService companyService;

View File

@ -1,4 +1,4 @@
//package dev.fyloz.trial.colorrecipesexplorer.web.controller.creators;
//package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators;
//
//import dev.fyloz.trial.colorrecipesexplorer.core.exception.SimdutException;
//import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityAlreadyExistsException;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.creators
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators
import dev.fyloz.trial.colorrecipesexplorer.core.exception.SimdutException
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityAlreadyExistsException
@ -7,8 +7,9 @@ import dev.fyloz.trial.colorrecipesexplorer.core.model.Material
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialService
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialTypeService
import dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.CREATOR_MATERIAL
import dev.fyloz.trial.colorrecipesexplorer.web.controller.message
import dev.fyloz.trial.colorrecipesexplorer.web.controller.modelAndView
import dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.message
import dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.modelAndView
import org.springframework.context.annotation.Profile
import org.springframework.http.MediaType
import org.springframework.stereotype.Controller
import org.springframework.web.bind.annotation.GetMapping
@ -19,6 +20,7 @@ import org.springframework.web.servlet.ModelAndView
import javax.validation.Valid
@Controller
@Profile("thymeleaf")
class MaterialCreatorController(val materialService: MaterialService, val materialTypeService: MaterialTypeService) {
@GetMapping(CREATOR_MATERIAL)
fun getPage(model: ModelAndView, @RequestParam(required = false) material: Material? = null): ModelAndView {

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.creators;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityAlreadyExistsException;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.ModelException;
@ -9,18 +9,19 @@ import dev.fyloz.trial.colorrecipesexplorer.core.model.MaterialType;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialTypeService;
import dev.fyloz.trial.colorrecipesexplorer.core.utils.ControllerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.validation.Valid;
import java.util.Optional;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.CREATOR_MATERIAL_TYPE;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.INDEX;
@Controller
@Profile("thymeleaf")
public class MaterialTypeCreatorController {
private MaterialTypeService materialTypeService;

View File

@ -1,8 +1,7 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.creators;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityAlreadyExistsException;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.ModelException;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ModelResponseBuilder;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseCode;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseDataType;
@ -12,6 +11,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.model.Recipe;
import dev.fyloz.trial.colorrecipesexplorer.core.model.dto.MixFormDto;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@ -25,6 +25,7 @@ import javax.validation.Valid;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*;
@Controller
@Profile("thymeleaf")
public class MixCreatorController {
private MixService mixService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.creators;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ModelResponseBuilder;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseCode;
@ -7,6 +7,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.model.Recipe;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.CompanyService;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.RecipeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -18,6 +19,7 @@ import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.CREATOR_RECI
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.EDITOR_RECIPE_SPECIFIC;
@Controller
@Profile("thymeleaf")
public class RecipeCreatorController {
private RecipeService recipeService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.editors;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.editors;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.SimdutException;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityAlreadyExistsException;
@ -10,6 +10,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.model.Material;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialService;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@ -21,6 +22,7 @@ import org.springframework.web.servlet.ModelAndView;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*;
@Controller
@Profile("thymeleaf")
public class MaterialEditorController {
private MaterialService materialService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.editors;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.editors;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.CannotEditDefaultMaterialTypeException;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityAlreadyExistsException;
@ -11,6 +11,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.model.MaterialType;
import dev.fyloz.trial.colorrecipesexplorer.core.model.dto.MaterialTypeEditorDto;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@ -21,6 +22,7 @@ import org.springframework.web.servlet.ModelAndView;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*;
@Controller
@Profile("thymeleaf")
public class MaterialTypeEditorController {
private MaterialTypeService materialTypeService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.editors;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.editors;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityAlreadyExistsException;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
@ -12,6 +12,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialService;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialTypeService;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MixService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
@ -22,6 +23,7 @@ import javax.validation.Valid;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*;
@Controller
@Profile("thymeleaf")
public class MixEditorController {
private MixService mixService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.editors;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.editors;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ModelResponseBuilder;
@ -9,6 +9,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.model.dto.RecipeEditorFormDto;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.CompanyService;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.RecipeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
@ -20,6 +21,7 @@ import org.springframework.web.servlet.ModelAndView;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*;
@Controller
@Profile("thymeleaf")
public class RecipeEditorController {
private RecipeService recipeService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.files;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.files;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.JSONResponseBuilder;
@ -9,6 +9,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.model.Recipe;
import dev.fyloz.trial.colorrecipesexplorer.core.services.files.ImagesService;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.RecipeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@ -24,6 +25,7 @@ import java.util.Map;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*;
@Controller
@Profile("thymeleaf")
public class ImageFilesController {
private RecipeService recipeService;

View File

@ -1,8 +1,9 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.files;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.files;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
import dev.fyloz.trial.colorrecipesexplorer.core.services.files.SimdutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@ -18,6 +19,7 @@ import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.CLOSE_TAB;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.SIMDUT_FILES;
@Controller
@Profile("thymeleaf")
public class SimdutFilesController {
private SimdutService simdutService;

View File

@ -1,10 +1,11 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.files;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.files;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ModelResponseBuilder;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseDataType;
import dev.fyloz.trial.colorrecipesexplorer.core.services.files.TouchUpKitService;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.RecipeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@ -16,6 +17,7 @@ import org.springframework.web.servlet.ModelAndView;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*;
@Controller
@Profile("thymeleaf")
public class TouchUpKitController {
private TouchUpKitService touchUpKitService;

View File

@ -1,8 +1,9 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.files;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.files;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
import dev.fyloz.trial.colorrecipesexplorer.core.services.files.XlsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@ -18,6 +19,7 @@ import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.ALL_RECIPES_
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.RECIPE_XLS;
@Controller
@Profile("thymeleaf")
public class XlsExporterController {
private XlsService xlsService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.removers;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.removers;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityLinkedException;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
@ -8,6 +8,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseDataType;
import dev.fyloz.trial.colorrecipesexplorer.core.model.Company;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -18,6 +19,7 @@ import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_COMP
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_COMPANY_SPECIFIC;
@Controller
@Profile("thymeleaf")
public class CompanyRemoverController {
private CompanyService companyService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.removers;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.removers;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityLinkedException;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
@ -8,6 +8,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseDataType;
import dev.fyloz.trial.colorrecipesexplorer.core.model.Material;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -20,6 +21,7 @@ import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_MATE
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_MATERIAL_SPECIFIC;
@Controller
@Profile("thymeleaf")
public class MaterialRemoverController {
private MaterialService materialService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.removers;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.removers;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.CannotDeleteDefaultMaterialTypeException;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityLinkedException;
@ -9,18 +9,18 @@ import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseDataType;
import dev.fyloz.trial.colorrecipesexplorer.core.model.MaterialType;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MaterialTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.Optional;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_MATERIAL_TYPE;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_MATERIAL_TYPE_SPECIFIC;
@Controller
@Profile("thymeleaf")
public class MaterialTypeRemoverController {
private MaterialTypeService materialTypeService;

View File

@ -1,10 +1,11 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.removers;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.removers;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ModelResponseBuilder;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseCode;
import dev.fyloz.trial.colorrecipesexplorer.core.model.Mix;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.MixService;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -13,6 +14,7 @@ import org.springframework.web.servlet.ModelAndView;
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*;
@Controller
@Profile("thymeleaf")
public class MixRemoverController {
private MixService mixService;

View File

@ -1,4 +1,4 @@
package dev.fyloz.trial.colorrecipesexplorer.web.controller.removers;
package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.removers;
import dev.fyloz.trial.colorrecipesexplorer.core.exception.model.EntityNotFoundException;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ModelResponseBuilder;
@ -6,6 +6,7 @@ import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseCode;
import dev.fyloz.trial.colorrecipesexplorer.core.io.response.ResponseDataType;
import dev.fyloz.trial.colorrecipesexplorer.core.model.Recipe;
import dev.fyloz.trial.colorrecipesexplorer.core.services.model.RecipeService;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -16,6 +17,7 @@ import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_RECI
import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_RECIPE_SPECIFIC;
@Controller
@Profile("thymeleaf")
public class RecipeRemoverController {
private RecipeService recipeService;

View File

@ -0,0 +1,2 @@
spring.resources.static-locations=classpath:/angular/static/
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration

View File

@ -0,0 +1,3 @@
spring.resources.static-locations=classpath:/thymeleaf/static/
spring.thymeleaf.prefix=classpath:/thymeleaf/templates/
spring.thymeleaf.suffix=.html

View File

@ -36,9 +36,6 @@ spring.h2.console.settings.web-allow-others=false
# NE PAS MODIFIER
spring.datasource.driver-class-name=org.h2.Driver
spring.thymeleaf.template-loader-path=classpath:/src/main/java/resources/templates
spring.thymeleaf.suffix=.html
spring.messages.fallback-to-system-locale=true
spring.servlet.multipart.max-file-size=10MB
@ -50,3 +47,5 @@ spring.jpa.open-in-view=true
server.http2.enabled=true
server.error.whitelabel.enabled=false
spring.profiles.active=@spring.profiles.active@

View File

@ -1,34 +0,0 @@
spring:
datasource:
url: "jdbc:h2:file:./workdir/recipes"
username: "sa"
password: "LWK4Y7TvEbNyhu1yCoG3"
thymeleaf:
template-loader-path: "classpath:/src/main/java/resources/templates"
suffix: ".html"
messages:
fallback-to-system-locale: true
servlet:
multipart:
max-file-size: 10MB
max-request-size: 15MB
jpa:
hibernate:
ddl-auto: update
show-sql: true
h2:
console:
enabled: true
path: /dbconsole
settings:
trace: true
web-allow-others: true
server:
port: 9090
http2:
enabled: true
error:
whitelabel:
enabled: false
url:
useport: true

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

View File

Before

Width:  |  Height:  |  Size: 627 B

After

Width:  |  Height:  |  Size: 627 B

View File

Before

Width:  |  Height:  |  Size: 395 B

After

Width:  |  Height:  |  Size: 395 B

View File

Before

Width:  |  Height:  |  Size: 485 B

After

Width:  |  Height:  |  Size: 485 B

View File

Before

Width:  |  Height:  |  Size: 586 B

After

Width:  |  Height:  |  Size: 586 B

View File

Before

Width:  |  Height:  |  Size: 478 B

After

Width:  |  Height:  |  Size: 478 B

View File

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 344 B

View File

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 324 B

Some files were not shown because too many files have changed in this diff Show More