Code Monkey home page Code Monkey logo

jump-the-queue's Issues

VisitormanagementTest fails (when following the tutorial documentation)

Expected behavior

As a new developer, I want to learn how to test the application so that I can make sure I implemented all functionalities correctly.

Actual behavior

The issues are regarding the devon4j-testing chapter and are originating from the VisitormanagementTest class:

The tests in VisitormanagementTest (saveVisitorTest and findVisitorsTest) both fail due a NullPointerException:

java.lang.NullPointerException
	at com.devonfw.application.jtqj.visitormanagement.logic.impl.VisitormanagementTest.findVisitorsTest(VisitormanagementTest.java:55)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. Follow the written tutorial up until this point.

Related/Dependent Issues

none

Comments/Hints:

The VisitorEto class doesn't implement the methods saveVisitor(visitorEto) and findVisitors(criteria).

Affected version:

Using the devonfw IDE scripts 3.0.0 beta 25 from here.

  • OS: Windows 7
  • Browser: not applicable

`import { RegisterComponent }` should explicitly be mentioned

Category: enhancement

Severity: Low

Description of issue / expected enhacement /Comments
In https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application#creating-components it is said:

We need to inject an instance of Router object and declare it into the name router in order to use it into the code, as we did on onRegisterClick(), using the navigate function and redirecting to the next view, in our case, using the route we are going to define in app.routing.module.ts: [...]

const appRoutes: Routes = [
  { path: 'FormLogin', component: FormLoginComponent},               // Redirect if url path is /FormLogin.
  { path: 'Register', component: RegisterComponent},               // Redirect if url path is /Register.
  { path: '**', redirectTo: '/FormLogin', pathMatch: 'full' }  // Redirect if url path do not match with any other route.
];

I suggest to add import { RegisterComponent } from './register/register.component'; to the code snippet.

It may not be neccessary to explicitly instruct on adding this line because Visual Studio Code analyzes the { path: 'Register', component: RegisterComponent}, code fragment and indicates the missing import.

Your environment - windows/Linux, Devonfw version , component
irrelevant

How does core.module.ts work?

Category: enhancement

Severity: High

Description of issue / expected enhacement /Comments
The tutorial recommends to create a file core.module.ts in order to bundle large amounts of dependencies into one file (component?). See https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application#root-component

In order to be able to use covalent and angular mats, we are going to create a core module that we will import in every module where we want to use covalent and angular.

Later on, it is said that ...

if you decide to use a component that is not included here, you need to add the corresponding module of the component here.

Problem: how do I add a module, especially, what are the rules for adding it to imports, exports and/or providers?
Example: Why is CovalentMediaModule in importsAND exports while CovalentChipsModule is only in exports? Why is HttpClientModule in exports and providers but not in imports?
If I want to add CovalentStepsModule do I have to add it to imports, to exports and/or providers?

Your environment - windows/Linux, Devonfw version , component

devon4j installation instructions should make a note on patching

Category: enhancement

Severity: Low

Description of issue / expected enhacement /Comments
The instructions how to install devonfw distribution on https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4j-application tell the user how to unzip the distribution and - in the next step - how to initialize it using update-all-workspaces.bat. After that, the instructions tell the user to start developing.
The instructions should tell the user to look for patches (e.g. win_accumulative_patch_20190115.zip) that should be applied to the distribution before starting to develop.

Your environment - windows/Linux, Devonfw version , component
irrelevant

Typo in code snippet of styles of "Adding Google Material and Covalent Teradata"

Category: Bug

Severity: Medium

Expected behaviour (In case of bug)
Code snippet compiles as given in the tutorial

Actual/current behaviour (In case of bug)
doesn't compile:
ERROR in multi ./src/styles.css ./src/theme.scss ./node_modules/@covalent/core/common/platform.css
Module not found: Error: Can't resolve 'C:\Devon-dist_3.0.0\workspaces\cashplanner2\angular\src\styles.css' in 'C:\Devon-dist_3.0.0\workspaces\cashplanner2\angular'

Steps to reproduce (In case of bug)
follow steps of tutorial, (https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application#adding-google-material-and-covalent-teradata) especially:

Now we have to add these styles in angular/CLI config. Go to angular.json in the root folder, then search both of the "styles" arrays (inside build and test) and add theme and Covalent platform.css to make it look like this:

....
            "styles": [
              "src/styles.css",
              "src/theme.scss",
              "node_modules/@covalent/core/common/platform.css"
            ],
....

Description of issue / expected enhacement /Comments
"src/styles.css" is missing an s, it must be "src/styles.scss"

Your environment - windows/Linux, Devonfw version , component

Guards cannot guarantee the confidentiality of parts of the application

Category: Bug

Severity: Medium

Expected behaviour (In case of bug)
The tutorial should give advice how to implement confidentiality in a secure way.

Actual/current behaviour (In case of bug)
The tutorial advises to use Guards in order to securely hide confidential parts of the application from an umpriviledged user.

Steps to reproduce (In case of bug)
(read the tutorial)

Description of issue / expected enhacement /Comments
https://github.com/devonfw/devonfw-tutorial-sources/wiki/angular-services on Guards:

We encourage to use Guards, because even if you hide the button to navigate, the user can modify the URL in the browser and have access to the component, with guards implemented, this navigation will be forbidden and you app not compromised.

IMHO even Guards cannot guarantee that a "forbidden part" is not compromized. If it is absolutely neccessary to hide a part of the application from an (unprivileged) user, it is necessary to implement an authorization scheme on the server side along with dynamic loading of that part of the application [dynamic loading may already be the standard in Angular already - I'm not familiar with Anguar yet.] . This will result in not being able to retrieve the http/JavaScript code that comprises the "forbidden" parts of the application.
Guarding can always be broken by an attacker by removing the Guard in the running code in the browser - which is under the total control of the user.
Of course, using Guards is the right way to hide parts of the app that should not be accessible. But the reason is usability ("I do not see any parts of the GUI that I am not allowed to use anyway"), not confidentiality ("I do not see any parts of the GUI that I must not get to know").

Your environment - windows/Linux, Devonfw version , component
irrelevant

authService must be public to allow AoT

Category: Bug

Severity: Medium

Expected behaviour (In case of bug)
ng build --prod is able to build the project for production

Actual/current behaviour (In case of bug)
ng build --prod produces an error message:

ERROR in src\app\layout\header\header.component.html(3,69): : Property 'authService' is private and only accessible within class 'HeaderComponent'.

Steps to reproduce (In case of bug)
ng build --prod when finished the tutorial

Description of issue / expected enhacement /Comments
As described in https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application#separating-the-header-to-the-layout

Finally, the AuthService is needed because its being used by the html template to control if the user is logged in with isLogged().

....
  constructor(private authService: AuthService, private loginService: LoginService) { }
....

However, when building for production using --prod AoT is applied that recognizes the html as a separate class. (see https://medium.com/spektrakel-blog/angular-writing-aot-friendly-applications-7b64c8afbe3f for a discussion)

Solution:

....
  constructor(public authService: AuthService, private loginService: LoginService) { }
....

Now, the line <button mat-icon-button mdTooltip="Log out" (click)=onClickLogout() *ngIf="authService.isLogged()">in header.component.html is allowed to access authService.isLogged().

Your environment - windows/Linux, Devonfw version , component
irrelevant

Steps to include core module unclear

Category: enhancement

Severity: High

Description of issue / expected enhacement /Comments
On https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application there are several steps described to include a self-defined "core-module.ts" into other artefacts.
The description what to do is unclear.

Remember that we need to import this module into the app.module the main app.component and every component of Angular Material and Covalent Teradata we use (i.e. for layouts it is CovalentLayoutModule).

I understand that we have to

  1. import the core module to the app.module.ts file
  2. import the core module to the app.component.ts file
  3. import the core module to every component of Angular Material and Covalent Teradata
  • There is an example of how the app.modules.ts file should look like after the import. (fine!)
  • There is no example of how the app.component.ts file should look like after the import. Adding the line import { CoreModule } from './shared/core.module'; to the file results in a warning by Visual Studio Core: "'CoreModule' is declared but its value is never read."
  • I have absolutely no idea, how I can " import this module into [...] every component of Angular Material and Covalent Teradata"

[Edit] hmmmm: I found an earlier version of this page. There, the sentence reads:

Remember that we need to import in app.module the main app.component and every component
of Angular Material and Covalent Teradata we use [...].

So it is the app.component and the Angular Material and Covalent Teradata components that have to be imported into app.module.

Another Problem is the depicted file app.module.ts. It contains some lines that I cannot find in my file although I followed the instructions very closely. These lines are:
import { HttpClientModule } from '@angular/common/http';
import 'hammerjs';

This may be a result of a failed yarn add hammerjs but even re-doing yarn add hammerjs does not produce any error messages and does not add these lines to app.module (and it is unclear to me whether I should use yarn to add these lines or have to add them manually.)
Where does the line import { HttpClientModule } from '@angular/common/http'; come from? Do I have to add it manually?
When I look at core.module, I see import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; It is also (among many others) a member of the exports array but it is also the single member of the providers array. Question: (why) is it necessary to have the HttpClientModule in app.module when it is also in core.module?

I also notice that my file contains import { AppRoutingModule } from './app-routing.module'; and the AppRoutingModule in the imports array. This is probably a result of the option "Would you like to add Angular Routing" during the creation of the project. This is not part of the depicted app.module.ts

I am further puzzled by the note box below the depicted app.module.ts. It reads:

Remember this step because you will have to repeat it for every other component from Teradata you use in your app.

As far as I have understood, the core.module is intended to not need to include every other component from Teradata, or am I wrong? Are there "other" components that have not been included in core.module? If yes, please add a couple of examples for these components to be (manually) added.

Your environment - windows/Linux, Devonfw version , component
irrelevant

Tests fail during Maven install (when following the tutorial documentation)

Expected behavior

As a developer, I want test deployment with Maven so that I can make sure, my app runs on a server.

Actual behavior

When running the command mvn install as described here, the following error occurs:

[ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 51.021 s <<< FAILURE! - in com.devonfw.application.jtqj.general.service.impl.rest.Securi
tyRestServiceImplTest
[ERROR] testGetCurrentUser  Time elapsed: 0.002 s  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/spr
ingframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationExceptio
n: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEntity
Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEnt
ity

[ERROR] testLogin  Time elapsed: 0 s  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/spr
ingframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationExceptio
n: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEntity
Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEnt
ity

[ERROR] testGetCsrfToken  Time elapsed: 0 s  <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/spr
ingframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationExceptio
n: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEntity
Caused by: org.hibernate.AnnotationException: No identifier specified for entity: com.devonfw.application.jtqj.accesscodemanagement.dataaccess.api.AccessCodeEnt
ity

[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   SecurityRestServiceImplTest.testGetCsrfToken » IllegalState Failed to load App...
[ERROR]   SecurityRestServiceImplTest.testGetCurrentUser » IllegalState Failed to load A...
[ERROR]   SecurityRestServiceImplTest.testLogin » IllegalState Failed to load Applicatio...
[INFO]
[ERROR] Tests run: 6, Failures: 0, Errors: 3, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for jtqj 0.0.1:
[INFO]
[INFO] jtqj ............................................... SUCCESS [  3.417 s]
[INFO] jtqj-api ........................................... SUCCESS [ 19.981 s]
[INFO] jtqj-core .......................................... FAILURE [01:24 min]
[INFO] jtqj-server ........................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. Follow the written tutorial up until this point.

Related/Dependent Issues

This is related to issue #47.

Comments/Hints:

The error message indicates, that the AccessCodeEntity requires an identifier, however, after adding the following code to src/main/java/accesscodemanagement/dataaccess/api/AccessCodeEntity.java:

@Id @GeneratedValue
long id;

... and executing mvn clean install, the same error persisted.

Affected version:

Using the devonfw IDE scripts 3.0.0 beta 25 from here.

  • OS: Windows 7
  • Browser: not applicable

CORS configuration

Expected behavior

As a learning user, I want to send requests from client side so that I can connect with the api and get response data.

Actual behavior

When sending requests from the angular app, they are rejected due to CORS.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. Send any request from the client side following the tutorial.

Related/Dependent Issues

Comments/Hints:

If you follow the documentation to try to replicate the front and end apps, when you reach cors configuration for allow any connections from the client side (https://github.com/devonfw/jump-the-queue/wiki/devon4j-layers), if you follow this wiki ,the project get a couple of errors related to importing cors enabled value from porperties, and also lacks the implementation of getCorsFilter() method. You can check the code in the repository for class BaseWebSecurityConfig anyway, but even copying it throws an exception. Changing inside getCorsFilter() config.setAllowCredentials(true) to false fix the problem, or specifying a list of allowedOriginPatterns should do the trick too.

Affected version:

Tested on windows 10 using Chrome

result of ng version requires additional comment

Category: enhancement

Severity: Medium

Description of issue / expected enhacement /Comments
On https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application the result of installing Angular CLI is depicted using a screenshot https://raw.githubusercontent.com/wiki/devonfw/devonfw-tutorial-sources/images/devon4ng/3.BuildYourOwn/angularcli.png. The screenshot lists a lot more that what I get when I install Angular CLI. My output is:

Angular CLI: 7.3.5
Node: 10.15.3
OS: win32 x64
Angular:
...

Package Version

@angular-devkit/architect 0.13.5
@angular-devkit/core 7.3.5
@angular-devkit/schematics 7.3.5
@schematics/angular 7.3.5
@schematics/update 0.13.5
rxjs 6.3.3
typescript 3.2.4

When I (in a later step of the tutorial) have created the project and change directory to that new project, then I get an output that comed near (but ist not identicall by far) to the depicted angularcli.png:

Angular CLI: 7.3.5
Node: 10.15.3
OS: win32 x64
Angular: 7.2.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.13.5
@angular-devkit/build-angular 0.13.5
@angular-devkit/build-optimizer 0.13.5
@angular-devkit/build-webpack 0.13.5
@angular-devkit/core 7.3.5
@angular-devkit/schematics 7.3.5
@angular/cli 7.3.5
@ngtools/webpack 7.3.5
@schematics/angular 7.3.5
@schematics/update 0.13.5
rxjs 6.3.3
typescript 3.2.4
webpack 4.29.0

==> There should be a comment to the depicted output of "ng version" that the result may vary significantly. Also it should be explained how to identify problems (or non-problems) in the output.

A text "Then, you should be able to run ng version and this will appear in the console:" may result in long attempts to find out why the actual output differs from the depicted one.

Your environment - windows/Linux, Devonfw version , component
windows

Screnshot of result of "ng new angular" is outdated

Category: enhancement

Severity: Medium

Description of issue / expected enhacement /Comments
https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application:
The screenshot https://raw.githubusercontent.com/wiki/devonfw/devonfw-tutorial-sources/images/devon4ng/3.BuildYourOwn/ngnew.JPG that is ment to depict the result of the ng new angular command is outdated. It reads "Project JumpTheQueue sucessfully created" in the last line

Your environment - windows/Linux, Devonfw version , component
irrelevant

Note on error for AccessCodeEntity is outdated

Category: Enhancement

Severity: Low

Description of issue / expected enhacement /Comments
On https://github.com/devonfw/devonfw-tutorial-sources/wiki/devon4j-components#visitor-component it is said:

Note: The AccessCodeEntity is throwing an error as it is not created yet. We will solve it in next step.

However, there is no error if you follow the tutorial.
AccessCodeEntity is not added to the code of VisitorEntity.

This line of the note should be deleted.

Your environment - windows/Linux, Devonfw version , component
irrelevant

"relation between visitor and daily queue" must be "relation between visitor and access code"

Category: Bug

Severity: Low

Expected behaviour (In case of bug)
Should be

In addition, we will have to represent two relationships:
The one to one relation between visitor and access code.

Actual/current behaviour (In case of bug)

In addition, we will have to represent two relationships:
The one to one relation between visitor and daily queue.

Steps to reproduce (In case of bug)
look at https://github.com/devonfw/devonfw-tutorial-sources/wiki/devon4j-components#create-your-components

Description of issue / expected enhacement /Comments
The picture https://raw.githubusercontent.com/wiki/devonfw/devonfw-tutorial-sources/images/devon4j/4.Components/visitor-accesscode.png shows that the one to one relation is between visitor and access code. The text line is mistyped

Your environment - windows/Linux, Devonfw version , component
irrelevant

Postman download URL

Category: Bug

Severity: Critical

Description of issue:
In the wiki you can find the following line:

To show the backend services results we are going to use Postman plugin for Chrome, although you can use any other similar application.

It will redirect you to the chrome web store. The problem is that the postman extension is deprecated for years. So please, change the url to the postman main page https://www.getpostman.com/ and force the people to download the correct version of postman.

Anyway, the best way to install postman in windows is using chocolatey.

Misleading CobiGen instructions for Visitor component

Category: Bug

Severity: High

In the second to last paragraph on https://github.com/devonfw/devonfw-tutorial-sources/wiki/devon4j-components called "Visitor component structure (Entity without relations)" it is written that "Finally we are going to repeat the same process using Cobigen with our other Visitor component."

This suggests that you should do the same steps as for the AccessCode component, as this was done before. However, generating the "CRUD REST services (CTOs)" and "CRUD UC logic (CTOs)" for the Visitor component is the wrong choice, instead one should use the same CobiGen increments as for the Queue component, which are "CRUD REST services" and "CRUD UC logic", as stated one paragraph before.

Creating a new application with devcon doesn't work as described and leaves open questions

Category: Bug

Severity: Medium

Expected behaviour (In case of bug)
The steps as described in the instructions to create a new application result in a newly created project and the user of the tutorial has learned how to create a new project.

Actual/current behaviour (In case of bug)
The steps as described in the instructions to create a new application are not sufficient and leave open questions

Steps to reproduce (In case of bug)
follow the instructions on https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4j-application:

Then we only need to define our server app path (for the location of the app select our just created jumpthequeue directory), name, groupid, package and version. Finally click on Start button.

Description of issue / expected enhacement /Comments

  • there is no field "name" but two fields "servername" and "packagename"
  • it is unclear, what "name" or "servername" actually is (it probably is the maven artifactID or is it some devonfw-specific name???)
  • it should be mentioned that these parameters are filled in the maven pom (and the meaning of these parameters can be found in any documentation on maven).
  • explicitly give the values "jtqj", "com.defonfw.application.jtqj", "v4" and "h2" for the fields to be filled in this tutorial.
  • it must be mentioned that also the dbtype has to be given - and should be "h2" for this development.

by the way: there is a bug in devcon that results in a lock-up if you forget to provide all mandatory values. You have to get back and start creating the project from scratch - re-filling all fields again.

Your environment - windows/Linux, Devonfw version , component
windows

Prevent cyclic dependency

The tutorial for building JumpTheQueue suggests build two entities that are both linking to each other:
https://github.com/oasp/oasp-tutorial-sources/wiki/OASP4jComponents#the-em-core-em-of-the-components

Such a cyclic relation is rather to be considered as an anti-pattern and is causing issues with JPA.
IMHO we should not propose such a design in our tutorial. Better decide which side is the "natural" side where to put the relation and if required to get it from the other side, create a query for that in DAO/repository.

Routing set up instructions outdated / inconsistent

Category: enhancement

Severity: Medium

Description of issue / expected enhacement /Comments
On https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application it is said:

Create a file called app-routing.module.ts and add the following code:

The file has already been created by the system when creating the new project with ng new angular and option "Would you like to add Angular routing? Yes".
Note: the file may not have been created if the project was created with devcon (I didn't try). In that case "Create a file [...]" may be valid.

The section ...

Time to add this AppRoutingModule routing module to the app module in app.module.ts:

... including the code snippets from app.module.ts appear to be obsolete because the changes have already been made by the "Would you like to add Angular routing? Yes" option.

Your environment - windows/Linux, Devonfw version , component
windows

"Build your own devon4j application" contains links to non-existent wiki pages

Category: Bug

Severity: Medium

Expected behaviour (In case of bug)
Links point to existing resources

Actual/current behaviour (In case of bug)
several links point to a "create new page" form

Steps to reproduce (In case of bug)
On https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4j-application click on any link in ...

Learn more about devonfw initialization here

You can also create new projects:
manually from command line see how
from Eclipse see how

Description of issue / expected enhacement /Comments
see Actual/current behaviour and Steps to reproduce

Your environment - windows/Linux, Devonfw version , component
irrelevant

LoginModule and FormLoginModule break the app

Category: Bug

Severity: High

Expected behaviour (In case of bug)
after executing the step ...

Once this is done, we need to remove the FormLoginComponent and then add the FormLoginModule both things in the AppModule

... the app shows at least a nav bar

Actual/current behaviour (In case of bug)
after executing the step, the app shows a white screen.

Steps to reproduce (In case of bug)
follow the tutorial to the point where FormLoginComponent is removed from AppModule and FormLoginModule is added and save the changes.

Description of issue / expected enhacement /Comments
perhaps there is no bug - this depends on how "add" and "remove" is to be interpreted in detail.
My working app.module.ts looks like this:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { CoreModule } from './shared/core.module';


import 'hammerjs';

import { LoginComponent } from './form-login/components/login/login.component';
// import { FormLoginModule } from './form-login/form-login-module';
import { FormLoginComponent } from './form-login/form-login.component';

@NgModule({
  declarations: [
    AppComponent,
    FormLoginComponent,
    LoginComponent
  ],
  imports: [
    BrowserModule,
    // FormLoginModule,
    CoreModule,
    AppRoutingModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

when I remove the lines
import { FormLoginComponent } from './form-login/form-login.component'; and FormLoginComponent, and add FormLoginModule by un-commenting the comments as shown above, the app breaks.

Your environment - windows/Linux, Devonfw version , component

"Build your own devon4j application" links to TeamForge Download site with outdated devonfw distribution

Category: Bug

Severity: High

Expected behaviour (In case of bug)
All links that are intended for downloading the latest version of devonfw should point to a download location that serves the latest version

Actual/current behaviour (In case of bug)
On https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application#creating-components there is a link to TeamForge (https://coconet.capgemini.com/sf/frs/do/listReleases/projects.apps2_devon/frs.devon_distribution) that appears to be outdated - the newest version available there is 2.4.0

You can download devonfw distributions from TeamForge.

Steps to reproduce (In case of bug)
Klick on "TeamForge" on https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application#creating-components

Description of issue / expected enhacement /Comments
The Link must point to the download loacation with the newest devonfw releases

Your environment - windows/Linux, Devonfw version , component
irrelevant

Adding Styles to angular.json is ambiguous

Category: enhancement

Severity: Medium, High, Critical

Description of issue / expected enhacement /Comments
On https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application it is said

Now we have to add these styles in angular/CLI config. Go to .angular.json in the root folder, then search the "styles" array and add theme and Covalent platform.css to make it look like this:

There are two "styles" arrays in angular.json. Is it necessary to add the lines to the first, the second or both?
(by the way, the file is called angular.json, not .angular.json )

Your environment - windows/Linux, Devonfw version , component
windows

Confusing comment with respect to saving entities

Category: enhancement

Severity: Low

Description of issue / expected enhacement /Comments
In https://github.com/devonfw/devonfw-tutorial-sources/wiki/devon4j-adding-custom-functionality#2-implementing-the-methods-in--ucmanagequeueimpl it is said (two times) in the code snippet:

   //Based on hibernate, the command save(Entity) is not required.

   //the queueEntity gets saved
  getQueueRepository().save(queueEntity);

why is getQueueRepository().save(queueEntity) called if it is not required?

Perhaps the author of the comment wanted to say something like "saving is not strictly required, but we call save anyway. This is done to make the code more readable."
This should be verified by the person who wrote the original comment "Based on hibernate..."

Your environment - windows/Linux, Devonfw version , component
irrelevant

Updating multiple times one Entity on DB

Expected behavior

As a tester, I want to modify some data from the server multiple times and check if it is correctly modified so that I have created an endpoint that retrieves the data I am modifying.

Actual behavior

After the first modification I can not modify that Entity again unless the new data contains the same modificationCounter as the data in the DB

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. Executing a POST request to create a new visitor on JumpTheQueue server.
    image

  2. Check the ID of the new Entity (I saved it as a postman variable)
    image

  3. Executing a PUT request in order to modify the data.
    image

The name is the field that we are changing.
image

After that if we try to modify it again we recive the following internal server error (500) from postman:
image
And in the server side the console says:

Caused by: org.springframework.orm.ObjectOptimisticLockingFailureException: Object of class [com.devonfw.application.jtqj.visitormanagement.dataaccess.api.VisitorEntity] with identifier [1000320]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect) : [com.devonfw.application.jtqj.visitormanagement.dataaccess.api.VisitorEntity#1000320]

The code the server is executing during the update is the following:

@Override
  public VisitorEto updateVisitor(VisitorEto visitor) {

    Objects.requireNonNull(visitor, "Visitor");

    VisitorEntity visitorEntity = getBeanMapper().map(visitor, VisitorEntity.class);
    VisitorEntity resultEntity = getVisitorRepository().save(visitorEntity);
    LOG.debug("Visitor with id '{}' has been updated.", resultEntity.getId());

    return getBeanMapper().map(resultEntity, VisitorEto.class);
  }

Comments/Hints:

If we try to update the Entity data using the current modificationCounter field of the Entity we can update it. To do that the server code has been changed to:

@Override
  public VisitorEto updateVisitor(VisitorEto visitor) {

    Objects.requireNonNull(visitor, "Visitor");

    VisitorEntity visitorEntity = getBeanMapper().map(visitor, VisitorEntity.class);
    Optional<VisitorEntity> actualEntity = getVisitorRepository().findById(visitorEntity.getId());

    if (actualEntity.isPresent()) {
      visitorEntity.setModificationCounter(actualEntity.get().getModificationCounter());
    }

    VisitorEntity resultEntity = getVisitorRepository().save(visitorEntity);
    LOG.debug("Visitor with id '{}' has been updated.", resultEntity.getId());

    return getBeanMapper().map(this.resultEntity, VisitorEto.class);
  }

Affected version:

  • Devon 3.2.4
  • OS: Windows 10
  • Postman

Missing sort parameter in pageables of the services

Category: Bug
Severity: High

With new versions of devon4j it seems that its necessary to have a sort inside the pageable, even if its empty. This part of the explanation seems missing both in frontend and backend.
For example:

 getCurrentlyAttendedAccessCode(): Observable<AccessCode> {
    const filters: FilterAccessCode = new FilterAccessCode();
    const pageable: Pageable = new Pageable();

    filters.endTime = null;
    pageable.pageNumber = 0;
    pageable.pageSize = 1;
    pageable.sort = new Array();
    filters.pageable = pageable;

This means the interface has to change too:

export class Pageable {
    pageSize: number;
    pageNumber: number;
    sort: Sort[];
}

devonfw documentation still uses the term OASP in some cases

Category: enhancement

Severity: Medium

Expected behaviour (In case of bug)
The term OASP should be used only where the historic context is obvious like in "devonfw is based on OASP, the former Open Application Standard Platform. OASP has now merged into devonfw and is not a separate product any more."

Actual/current behaviour (In case of bug)
On https://github.com/devonfw/devonfw-tutorial-sources/wiki/devonfw-intro I read

devon4ng: the OASP implementation based on Angular framework.

Steps to reproduce (In case of bug)
look at https://github.com/devonfw/devonfw-tutorial-sources/wiki/devonfw-intro

Description of issue / expected enhacement /Comments
search for all ocurrences of "OASP" in the wiki and remove/replace with devonfw if it is not in a historical context

Your environment - windows/Linux, Devonfw version , component
irrelevant

Import modules from @angular/material in core.module.ts doesn't work

Expected behavior

As a developer, I want to import all the required modules from @angular/material so that the application will have these modules available

Actual behaviour

When I try to create the core.module.ts, the IDE throws an error saying that it can't find any module.ts

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. In the creation of the core.module.ts import the modules from the @angular/material

Related/Dependent Issues

Comments/Hints:

Affected version:

  • OS: Windows/Linux/Mac?
  • Browser: Chrome/Firefox/Safari?

"Add this code" unclear for Register component

Category: enhancement

Severity: Medium

Description of issue / expected enhacement /Comments
https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application#creating-components reads:

Turning back to login.component.html we have to add this code:

<form layout="column" class="pad" (ngSubmit)="submitLogin()" #loginForm="ngForm">
...
<button mat-raised-button type="submit" [disabled]="!loginForm.form.valid">Login</button>
...
<button mat-raised-button (click)="onRegisterClick()" color="primary">Register</button>

where do I add the code? at the beginning or at the end of the (already existing) code? From the "..." I conclude that the the lines shall be mixed into the existing code, but where (especially the <form... line)?

[Edit] When I read through the existing code, I see that the code replaces some lines of the existing code. This is not clear from the instruction. What is most confusing is that the new <form... line now doesn't have the #accessForm="ngForm" anymore. Now it is #loginForm. Why is this? what is the reason to change it?
Why is the layout changed from layout-padding to layout="column" and what is the exact result of this change?
...
OK, analyzing the changes in detail reveals:

  • layout="column" added to the form. Why?
  • class="pad"added to the form. Why?
  • (ngSubmit)="submitLogin()" added to the form. Presumably this refers to:

First, when we submit the form, the method submitLogin() is going to be called.

  • #accessForm="ngForm" changed to #loginForm="ngForm" in the form. Why?
  • layout-padding removed from the form. Why?
  • type="submit" added to the login button. Again this is obviously related to the submitLogin().
  • [disabled]="!accessForm.form.valid" changed to [disabled]="!loginForm.form.valid" in the login button. This appears to be related to the renaming (why?) of accessForm to loginForm.
  • (click)="onRegisterClick() added to the register button. This is obviously related to:

The other event, when the user clicks the button, (click) will send an event to the function onRegisterClick() that should be in the login.component.ts [...]

Your environment - windows/Linux, Devonfw version , component
irrelevant

Adding ViewQueue path to Routes is error prone

Category: enhancement

Severity: High

Description of issue / expected enhacement /Comments
The instruction how to add the ViewQueue path to Routes in https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application#generating-viewqueue is error prone:

After that, we are going to include the component in the app-routing.module.ts adding also the guard, only allowing users that are VISITOR to see the component.

....
const appRoutes: Routes = [
  ....
  { path: 'ViewQueue', component: ViewQueueComponent,
  canActivate: [AuthGuardService]},  // Redirect if url path is /ViewQueue, check if canActivate() with the AuthGuardService.
  ....
];
....

Problem: If you add the line at the end of the array then the added path has no effect - the '**' default path is evaluated before the newly added path at the end and always wins.
This leads to a situation where you cannot reach the ViewQueueComponent. For an unexperienced developer it is hard to identify the reason for this. He/she (like me) may think the reason is a malfunction in the AuthGuardService that - for some reason - doesn't return true...

So, it would be helpful to explicitly show where the additional path shall be inserted:

const appRoutes: Routes = [
  { path: 'FormLogin', component: FormLoginComponent},               // Redirect if url path is /access.
  { path: 'Register', component: RegisterComponent},               // Redirect if url path is /Register.
  { path: 'ViewQueue', component: ViewQueueComponent, 
   canActivate: [AuthGuardService]},   // Redirect if url path is /ViewQueue, check if canActivate() with the AuthGuardService.
  { path: '**', redirectTo: '/FormLogin', pathMatch: 'full' },  // Redirect if url path do not match with any other route.
 ];

Your environment - windows/Linux, Devonfw version , component
irrelevant

Broken Link to "more about layouts in devon4ng"

Category: enhancement

Severity: Low

Description of issue / expected enhacement /Comments
On https://github.com/devonfw/devonfw-tutorial-sources/wiki/build-devon4ng-application there is a link box with the text

Learn more about layouts in devon4ng HERE

The Link is broken.
It is https://github.com/devonfw/devonfw-tutorial-sources/wiki/angular-components#teradata-layouts
It must be https://github.com/devonfw/devonfw-tutorial-sources/wiki/angular-components#teradata-covalent-layouts

Your environment - windows/Linux, Devonfw version , component
irrelevant

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.