Merge pull request 'detached2' (#1) from detached2 into main

Reviewed-on: https://git.walzen665.de/Walzen665/fluidcms/pulls/1
This commit is contained in:
Max W. 2024-06-16 19:40:56 +00:00
commit 7d0e7a25be
36 changed files with 13609 additions and 16 deletions

View File

@ -1,4 +1,4 @@
# contentking
# fluidcms
This project uses Quarkus, the Supersonic Subatomic Java Framework.
@ -43,7 +43,7 @@ Or, if you don't have GraalVM installed, you can run the native executable build
./gradlew build -Dquarkus.native.enabled=true -Dquarkus.native.container-build=true
```
You can then execute your native executable with: `./build/contentking-0.1.0-ALPHA-runner`
You can then execute your native executable with: `./build/fluidcms-0.1.0-ALPHA-runner`
If you want to learn more about building native executables, please consult https://quarkus.io/guides/gradle-tooling.

View File

@ -9,6 +9,7 @@ repositories {
}
dependencies {
implementation 'io.quarkiverse.quinoa:quarkus-quinoa:2.3.8'
implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
implementation 'io.quarkus:quarkus-rest'
implementation 'io.quarkus:quarkus-arc'

View File

@ -1,6 +1,7 @@
#Gradle properties
#Sat Jun 15 23:07:59 CEST 2024
quarkusPlatformArtifactId=quarkus-bom
quarkusPlatformGroupId=io.quarkus.platform
quarkusPlatformVersion=3.11.2
quarkusPluginId=io.quarkus
quarkusPluginVersion=3.11.2
quarkusPlatformGroupId=io.quarkus.platform
quarkusPlatformArtifactId=quarkus-bom
quarkusPlatformVersion=3.11.2

View File

@ -8,4 +8,4 @@ pluginManagement {
id "${quarkusPluginId}" version "${quarkusPluginVersion}"
}
}
rootProject.name='contentking'
rootProject.name='fluidcms'

View File

@ -7,11 +7,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/contentking-jvm .
# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/fluidcms-jvm .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/contentking-jvm
# docker run -i --rm -p 8080:8080 quarkus/fluidcms-jvm
#
# If you want to include the debug port into your docker image
# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
@ -20,7 +20,7 @@
#
# Then run the container using :
#
# docker run -i --rm -p 8080:8080 quarkus/contentking-jvm
# docker run -i --rm -p 8080:8080 quarkus/fluidcms-jvm
#
# This image uses the `run-java.sh` script to run the application.
# This scripts computes the command line to execute your Java application, and

View File

@ -7,11 +7,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/contentking-legacy-jar .
# docker build -f src/main/docker/Dockerfile.legacy-jar -t quarkus/fluidcms-legacy-jar .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/contentking-legacy-jar
# docker run -i --rm -p 8080:8080 quarkus/fluidcms-legacy-jar
#
# If you want to include the debug port into your docker image
# you will have to expose the debug port (default 5005 being the default) like this : EXPOSE 8080 5005.
@ -20,7 +20,7 @@
#
# Then run the container using :
#
# docker run -i --rm -p 8080:8080 quarkus/contentking-legacy-jar
# docker run -i --rm -p 8080:8080 quarkus/fluidcms-legacy-jar
#
# This image uses the `run-java.sh` script to run the application.
# This scripts computes the command line to execute your Java application, and

View File

@ -7,11 +7,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.native -t quarkus/contentking .
# docker build -f src/main/docker/Dockerfile.native -t quarkus/fluidcms .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/contentking
# docker run -i --rm -p 8080:8080 quarkus/fluidcms
#
###
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9

View File

@ -10,11 +10,11 @@
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/contentking .
# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/fluidcms .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/contentking
# docker run -i --rm -p 8080:8080 quarkus/fluidcms
#
###
FROM quay.io/quarkus/quarkus-micro-image:2.0

View File

@ -0,0 +1,2 @@
quarkus.quinoa.dev-server.port=4200
quarkus.quinoa.build-dir=dist

View File

@ -0,0 +1,16 @@
# 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

42
src/main/webui/.gitignore vendored Normal file
View File

@ -0,0 +1,42 @@
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
# Compiled output
/dist
/tmp
/out-tsc
/bazel-out
# Node
/node_modules
npm-debug.log
yarn-error.log
# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings
# System files
.DS_Store
Thumbs.db

27
src/main/webui/README.md Normal file
View File

@ -0,0 +1,27 @@
# Webui
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.0.4.
## Development server
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
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.
## 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 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 Overview and Command Reference](https://angular.dev/tools/cli) page.

View File

@ -0,0 +1,99 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"webui": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/webui",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kB",
"maximumError": "1MB"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kB",
"maximumError": "4kB"
}
],
"outputHashing": "all"
},
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "webui:build:production"
},
"development": {
"buildTarget": "webui:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"assets": [
{
"glob": "**/*",
"input": "public"
}
],
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
}
},
"cli": {
"analytics": false
}
}

13083
src/main/webui/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
{
"name": "webui",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^18.0.3",
"@angular/common": "^18.0.0",
"@angular/compiler": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/forms": "^18.0.0",
"@angular/platform-browser": "^18.0.0",
"@angular/platform-browser-dynamic": "^18.0.0",
"@angular/router": "^18.0.0",
"primeicons": "^7.0.0",
"primeng": "^17.18.1",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.0.4",
"@angular/cli": "^18.0.4",
"@angular/compiler-cli": "^18.0.0",
"@types/jasmine": "~5.1.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",
"typescript": "~5.4.2"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

View File

@ -0,0 +1,6 @@
<h1>Sample object control panel</h1>
<h3>Create object types</h3>
<app-objecttype></app-objecttype>
<h3>Create object</h3>
<app-object></app-object>

View File

@ -0,0 +1,5 @@
import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
});

View File

@ -0,0 +1,17 @@
import {Component} from '@angular/core';
import { RouterOutlet } from '@angular/router';
import {ObjecttypeComponent} from "./create/objecttype/objecttype.component";
import {ObjectComponent} from "./create/object/object.component";
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet, ObjecttypeComponent, ObjectComponent],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
})
export class AppComponent {
}

View File

@ -0,0 +1,13 @@
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { provideRouter } from '@angular/router';
import { routes } from './app.routes';
import {provideAnimations} from "@angular/platform-browser/animations";
export const appConfig: ApplicationConfig = {
providers: [
provideZoneChangeDetection({ eventCoalescing: true }),
provideRouter(routes),
provideAnimations()
],
};

View File

@ -0,0 +1,3 @@
import { Routes } from '@angular/router';
export const routes: Routes = [];

View File

@ -0,0 +1,16 @@
<div>
<form>
<input type="text" pInputText />
<p-dropdown [options]="objectTypes" [(ngModel)]="selectedObjectType" placeholder="Select a object type" name="objectTypeSelect" [editable]="true"></p-dropdown>
</form>
<h4>Object attributes</h4>
<div *ngFor="let objectAttribute of objectAttributes">
<input type="text" pInputText [(ngModel)]="objectAttribute.name" name="attributename" placeholder="Object attribute name"/>
<p-dropdown [options]="valueTypes" [(ngModel)]="objectAttribute.type" placeholder="Select a object type" name="objectAttributeTyoeSelect" ></p-dropdown>
<input type="text" pInputText [(ngModel)]="objectAttribute.value" placeholder="Attribute type"/>
</div>
<button pButton (click)="createAttribute()">Add</button>
</div>
<br>
<button pButton type="submit" (click)="createNewObject()">Create Object</button>

View File

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

View File

@ -0,0 +1,52 @@
import { Component } from '@angular/core';
import {ButtonDirective} from "primeng/button";
import {DropdownModule} from "primeng/dropdown";
import {FormsModule} from "@angular/forms";
import {InputTextModule} from "primeng/inputtext";
import {PaginatorModule} from "primeng/paginator";
import {SelectItem} from "primeng/api";
import {NgForOf} from "@angular/common";
interface ObjectAttribute {
name: string;
type: string; // This should be an enum
value: string;
}
@Component({
selector: 'app-object',
standalone: true,
imports: [
ButtonDirective,
DropdownModule,
FormsModule,
InputTextModule,
PaginatorModule,
NgForOf
],
templateUrl: './object.component.html',
styleUrl: './object.component.css'
})
export class ObjectComponent {
objectTypes!:SelectItem[];
selectedObjectType!:SelectItem;
objectAttributes!:ObjectAttribute[];
valueTypes!:SelectItem[];
constructor() {
this.objectTypes = [];
this.objectTypes.push({label: 'Example', value: 'Example'}); // Note that the objectTypes array must be initialized with at least one element for the dropdown to work
this.valueTypes = [{label: 'String', value: 'String'}, {label: 'Number', value: 'Number'}, {label: 'Boolean', value: 'Boolean'}];
}
createNewObject() {
console.log('selectedObjectType', this.selectedObjectType);
}
createAttribute() {
if(this.objectAttributes === undefined) {
this.objectAttributes = [];
}
this.objectAttributes.push({name: '', type: '', value: ''});
}
}

View File

@ -0,0 +1,4 @@
<form>
<input type="text" pInputText [(ngModel)]="newObjectType" name="newObjectType"/>
<button pButton (click)="createNewObjectType()">Create</button>
</form>

View File

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

View File

@ -0,0 +1,34 @@
import { Component } from '@angular/core';
import {ButtonDirective} from "primeng/button";
import {FormsModule} from "@angular/forms";
import {InputTextModule} from "primeng/inputtext";
import {PaginatorModule} from "primeng/paginator";
import {SelectItem} from "primeng/api";
@Component({
selector: 'app-objecttype',
standalone: true,
imports: [
ButtonDirective,
FormsModule,
InputTextModule,
PaginatorModule
],
templateUrl: './objecttype.component.html',
styleUrl: './objecttype.component.css'
})
export class ObjecttypeComponent {
objectTypes!:SelectItem[];
newObjectType:string = '';
createNewObjectType() {
if(this.objectTypes === undefined) {
this.objectTypes = [];
}
this.objectTypes.push({label: this.newObjectType, value: this.newObjectType});
console.log('objectTypes', this.objectTypes)
this.newObjectType = '';
}
}

View File

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Webui</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>

View File

@ -0,0 +1,6 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
bootstrapApplication(AppComponent, appConfig)
.catch((err) => console.error(err));

View File

@ -0,0 +1,4 @@
/* You can add global styles to this file, and also import other style files */
@import "primeicons/primeicons.css";
@import "primeng/resources/themes/aura-dark-blue/theme.css"; /* This line defines the global primeAngular theme*/
@import "primeng/resources/primeng.css";

View File

@ -0,0 +1,15 @@
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts"
],
"include": [
"src/**/*.d.ts"
]
}

View File

@ -0,0 +1,33 @@
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"esModuleInterop": true,
"sourceMap": true,
"declaration": false,
"experimentalDecorators": true,
"moduleResolution": "bundler",
"importHelpers": true,
"target": "ES2022",
"module": "ES2022",
"useDefineForClassFields": false,
"lib": [
"ES2022",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}

View File

@ -0,0 +1,15 @@
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine"
]
},
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}