Просмотр исходного кода

frontend working with login

master
Florian Eisenmenger 2 лет назад
Родитель
Сommit
a41388229e
16 измененных файлов: 1037 добавлений и 593 удалений
  1. +1
    -1
      matsen-tool/README.md
  2. +3
    -8
      matsen-tool/angular.json
  3. +0
    -49
      matsen-tool/openapi_test.yaml
  4. +1006
    -433
      matsen-tool/package-lock.json
  5. +5
    -12
      matsen-tool/package.json
  6. +0
    -56
      matsen-tool/server.ts
  7. +1
    -1
      matsen-tool/src/app/_models/user.ts
  8. +4
    -4
      matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response.ts
  9. +3
    -3
      matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraSearch.ts
  10. +4
    -4
      matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraView.ts
  11. +4
    -4
      matsen-tool/src/app/core/api/v1/model/apiUsersGetCollection200Response.ts
  12. +1
    -0
      matsen-tool/src/index.html
  13. +0
    -1
      matsen-tool/src/main.server.ts
  14. +2
    -6
      matsen-tool/tsconfig.app.json
  15. +3
    -5
      matsen-tool/tsconfig.json
  16. +0
    -6
      package-lock.json

+ 1
- 1
matsen-tool/README.md Просмотреть файл

@@ -1,6 +1,6 @@
# MatsenTool

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.6.
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.0.7.

## Development server



+ 3
- 8
matsen-tool/angular.json Просмотреть файл

@@ -37,15 +37,10 @@
"src/assets"
],
"styles": [
"@angular/material/prebuilt-themes/pink-bluegrey.css",
"@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss"
],
"scripts": [],
"server": "src/main.server.ts",
"prerender": true,
"ssr": {
"entry": "server.ts"
}
"scripts": []
},
"configurations": {
"production": {
@@ -103,7 +98,7 @@
"src/assets"
],
"styles": [
"@angular/material/prebuilt-themes/pink-bluegrey.css",
"@angular/material/prebuilt-themes/indigo-pink.css",
"src/styles.scss"
],
"scripts": []


+ 0
- 49
matsen-tool/openapi_test.yaml Просмотреть файл

@@ -1,49 +0,0 @@
openapi: 3.0.0
info:
title: JSON Placeholder OpenAPI
description: Example spec of the well known JSON Placeholder website
version: 0.1.9
servers:
- url: https://jsonplaceholder.typicode.com
paths:
/posts:
get:
tags: ['posts']
summary: Returns a list of Posts.
description: Optional extended description in CommonMark or HTML.
operationId: GetPosts
responses:
'200':
description: A JSON array of Posts
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Post'
components:
schemas:
Post:
required:
- id
- userId
- title
- body
type: object
properties:
id:
type: number
description: record id
example: 1
userId:
type: string
description: unique user identifier
example: 2
title:
type: string
description: title of this Post
example: sunt aut facere repellat provident occaecati excepturi optio reprehenderit
body:
type: string
description: description of this post
example: quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto

+ 1006
- 433
matsen-tool/package-lock.json
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 5
- 12
matsen-tool/package.json Просмотреть файл

@@ -7,45 +7,38 @@
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"serve:ssr:matsen-tool": "node dist/matsen-tool/server/server.mjs",
"generate:api": "openapi-generator-cli generate -i ./openapi.yaml -g typescript-angular -o src/app/core/api/v1 -p=removeOperationIdPrefix=true --additional-properties=supportsES6=true,typescriptThreePlus=true"
"generate:api": "openapi-generator-cli generate -i ./openapi.yaml -g typescript-angular -o src/app/core/api/v1 -p=removeOperationIdPrefix=true"
},
"private": true,
"dependencies": {
"@angular/animations": "^17.0.0",
"@angular/cdk": "^17.0.3",
"@angular/cdk": "^17.0.4",
"@angular/common": "^17.0.0",
"@angular/compiler": "^17.0.0",
"@angular/core": "^17.0.0",
"@angular/forms": "^17.0.0",
"@angular/material": "^17.0.3",
"@angular/material": "^17.0.4",
"@angular/platform-browser": "^17.0.0",
"@angular/platform-browser-dynamic": "^17.0.0",
"@angular/platform-server": "^17.0.0",
"@angular/router": "^17.0.0",
"@angular/ssr": "^17.0.6",
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.2",
"express": "^4.18.2",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.0.6",
"@angular/cli": "^17.0.6",
"@angular-devkit/build-angular": "^17.0.7",
"@angular/cli": "^17.0.7",
"@angular/compiler-cli": "^17.0.0",
"@openapitools/openapi-generator-cli": "^2.7.0",
"@types/express": "^4.17.17",
"@types/jasmine": "~5.1.0",
"@types/node": "^18.18.0",
"jasmine-core": "~5.1.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"openapi-typescript": "^7.0.0-next.5",
"typescript": "~5.2.2"
}
}

+ 0
- 56
matsen-tool/server.ts Просмотреть файл

@@ -1,56 +0,0 @@
import { APP_BASE_HREF } from '@angular/common';
import { CommonEngine } from '@angular/ssr';
import express from 'express';
import { fileURLToPath } from 'node:url';
import { dirname, join, resolve } from 'node:path';
import AppServerModule from './src/main.server';

// The Express app is exported so that it can be used by serverless Functions.
export function app(): express.Express {
const server = express();
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
const browserDistFolder = resolve(serverDistFolder, '../browser');
const indexHtml = join(serverDistFolder, 'index.server.html');

const commonEngine = new CommonEngine();

server.set('view engine', 'html');
server.set('views', browserDistFolder);

// Example Express Rest API endpoints
// server.get('/api/**', (req, res) => { });
// Serve static files from /browser
server.get('*.*', express.static(browserDistFolder, {
maxAge: '1y'
}));

// All regular routes use the Angular engine
server.get('*', (req, res, next) => {
const { protocol, originalUrl, baseUrl, headers } = req;

commonEngine
.render({
bootstrap: AppServerModule,
documentFilePath: indexHtml,
url: `${protocol}://${headers.host}${originalUrl}`,
publicPath: browserDistFolder,
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
})
.then((html) => res.send(html))
.catch((err) => next(err));
});

return server;
}

function run(): void {
const port = process.env['PORT'] || 4000;

// Start up the Node server
const server = app();
server.listen(port, () => {
console.log(`Node Express server listening on http://localhost:${port}`);
});
}

run();

+ 1
- 1
matsen-tool/src/app/_models/user.ts Просмотреть файл

@@ -5,4 +5,4 @@
firstName?: string;
lastName?: string;
token?: string;
}
}

+ 4
- 4
matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200Response.ts Просмотреть файл

@@ -15,9 +15,9 @@ import { ApiPostsGetCollection200ResponseHydraView } from './apiPostsGetCollecti


export interface ApiPostsGetCollection200Response {
'hydra:member': Array<PostJsonld>;
'hydra:totalItems'?: number;
'hydra:view'?: ApiPostsGetCollection200ResponseHydraView;
'hydra:search'?: ApiPostsGetCollection200ResponseHydraSearch;
hydramember: Array<PostJsonld>;
hydratotalItems?: number;
hydraview?: ApiPostsGetCollection200ResponseHydraView;
hydrasearch?: ApiPostsGetCollection200ResponseHydraSearch;
}


+ 3
- 3
matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraSearch.ts Просмотреть файл

@@ -14,8 +14,8 @@ import { ApiPostsGetCollection200ResponseHydraSearchHydraMappingInner } from './

export interface ApiPostsGetCollection200ResponseHydraSearch {
type?: string;
'hydra:template'?: string;
'hydra:variableRepresentation'?: string;
'hydra:mapping'?: Array<ApiPostsGetCollection200ResponseHydraSearchHydraMappingInner>;
hydratemplate?: string;
hydravariableRepresentation?: string;
hydramapping?: Array<ApiPostsGetCollection200ResponseHydraSearchHydraMappingInner>;
}


+ 4
- 4
matsen-tool/src/app/core/api/v1/model/apiPostsGetCollection200ResponseHydraView.ts Просмотреть файл

@@ -14,9 +14,9 @@
export interface ApiPostsGetCollection200ResponseHydraView {
id?: string;
type?: string;
'hydra:first'?: string;
'hydra:last'?: string;
'hydra:previous'?: string;
'hydra:next'?: string;
hydrafirst?: string;
hydralast?: string;
hydraprevious?: string;
hydranext?: string;
}


+ 4
- 4
matsen-tool/src/app/core/api/v1/model/apiUsersGetCollection200Response.ts Просмотреть файл

@@ -15,9 +15,9 @@ import { ApiPostsGetCollection200ResponseHydraView } from './apiPostsGetCollecti


export interface ApiUsersGetCollection200Response {
'hydra:member': Array<UserJsonld>;
'hydra:totalItems'?: number;
'hydra:view'?: ApiPostsGetCollection200ResponseHydraView;
'hydra:search'?: ApiPostsGetCollection200ResponseHydraSearch;
hydramember: Array<UserJsonld>;
hydratotalItems?: number;
hydraview?: ApiPostsGetCollection200ResponseHydraView;
hydrasearch?: ApiPostsGetCollection200ResponseHydraSearch;
}


+ 1
- 0
matsen-tool/src/index.html Просмотреть файл

@@ -8,6 +8,7 @@
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
</head>
<body class="mat-typography">
<app-root></app-root>


+ 0
- 1
matsen-tool/src/main.server.ts Просмотреть файл

@@ -1 +0,0 @@
export { AppServerModule as default } from './app/app.module.server';

+ 2
- 6
matsen-tool/tsconfig.app.json Просмотреть файл

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


+ 3
- 5
matsen-tool/tsconfig.json Просмотреть файл

@@ -2,19 +2,17 @@
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": false,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"esModuleInterop": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
@@ -26,8 +24,8 @@
"dom"
],
"paths": {
"@app/*": ["src/app/*"],
"@environments/*": ["src/environments/*"]
"@app/*": ["./src/app/*"],
"@environments/*": ["./src/environments/*"]
}
},
"angularCompilerOptions": {


+ 0
- 6
package-lock.json Просмотреть файл

@@ -1,6 +0,0 @@
{
"name": "matsen-tool-fe",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}

Загрузка…
Отмена
Сохранить