Skip to content
Snippets Groups Projects
Commit 227abc85 authored by OZGCloud's avatar OZGCloud
Browse files

Merge remote-tracking branch 'origin/release'

# Conflicts:
#	alfa-service/pom.xml
#	alfa-xdomea/pom.xml
#	goofy-client/pom.xml
#	goofy-server/pom.xml
#	pom.xml
parents 0d590ccd d271e97c
No related branches found
No related tags found
No related merge requests found
Showing
with 208 additions and 13 deletions
import { registerLocaleData } from '@angular/common';
import localeDe from '@angular/common/locales/de';
import localeDeExtra from '@angular/common/locales/extra/de';
import { CurrentUserProfileE2EComponent } from 'apps/goofy-e2e/src/components/user-profile/current-user-profile.component.e2e';
import { VorgangListE2EComponent } from 'apps/goofy-e2e/src/components/vorgang/vorgang-list.e2e.component';
import { VorgangViewE2EComponent, VorgangViewsE2EComponent } from 'apps/goofy-e2e/src/components/vorgang/vorgang-views.e2e.component';
import { UserE2E } from 'apps/goofy-e2e/src/model/user';
import { VorgangE2E, VorgangStatusE2E } from 'apps/goofy-e2e/src/model/vorgang';
import { HeaderE2EComponent } from 'apps/goofy-e2e/src/page-objects/header.po';
import { MainPage, waitForSpinnerToDisappear } from 'apps/goofy-e2e/src/page-objects/main.po';
import { dropCollections } from 'apps/goofy-e2e/src/support/cypress-helper';
import { containClass, exist } from 'apps/goofy-e2e/src/support/cypress.util';
import { getUserSabine, loginAsSabine, loginByUi } from 'apps/goofy-e2e/src/support/user-util';
import { createVorgang, initVorgang } from 'apps/goofy-e2e/src/support/vorgang-util';
registerLocaleData(localeDe, 'de', localeDeExtra);
describe('Vorgang search view', () => {
const mainPage: MainPage = new MainPage();
const header: HeaderE2EComponent = mainPage.getHeader();
const currentUserProfile: CurrentUserProfileE2EComponent = header.getCurrentUserProfile();
const views: VorgangViewsE2EComponent = mainPage.getViews();
const sucheView: VorgangViewE2EComponent = views.getSuche();
const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList();
const user: UserE2E = getUserSabine();
const vorgang: VorgangE2E = { ...createVorgang(), name: 'VorgangToAppear', status: VorgangStatusE2E.NEU };
before(() => {
initVorgang(vorgang);
loginAsSabine();
waitForSpinnerToDisappear();
})
after(() => {
dropCollections();
})
describe('should select search view', () => {
it('should set selected after click', () => {
sucheView.getRoot().click();
waitForSpinnerToDisappear();
containClass(sucheView.getRoot(), 'selected');
})
it('should show new view after logout and login', () => {
currentUserProfile.logout();
loginByUi(user);
waitForSpinnerToDisappear();
exist(views.getNeu().getRoot());
})
it('should show list after click on NEU view', () => {
views.getNeu().getRoot().click();
waitForSpinnerToDisappear();
exist(vorgangList.getRoot());
})
})
})
\ No newline at end of file
...@@ -120,3 +120,12 @@ export enum UserRoleE2E { ...@@ -120,3 +120,12 @@ export enum UserRoleE2E {
VERWALTUNG_POSTSTELLE = 'VERWALTUNG_POSTSTELLE', VERWALTUNG_POSTSTELLE = 'VERWALTUNG_POSTSTELLE',
VERWALTUNG_USER = 'VERWALTUNG_USER' VERWALTUNG_USER = 'VERWALTUNG_USER'
} }
//TODO Cleanup
export function loginByUi(user: UserE2E): void {
cy.visit('')
.get('#kc-login').should('exist')
.get('#username').type(user.name)
.get('#password').type(user.password)
.get('#kc-login').click();
}
\ No newline at end of file
...@@ -22,7 +22,7 @@ export const CREATE_COMMAND_MESSAGE_BY_ORDER: { [order: string]: string } = { ...@@ -22,7 +22,7 @@ export const CREATE_COMMAND_MESSAGE_BY_ORDER: { [order: string]: string } = {
[CommandOrder.LOESCH_ANFORDERUNG_ZURUECKNEHMEN]: 'Für den Vorgang wurde die Löschanforderung zurückgenommen.', [CommandOrder.LOESCH_ANFORDERUNG_ZURUECKNEHMEN]: 'Für den Vorgang wurde die Löschanforderung zurückgenommen.',
[CommandOrder.ASSIGN_USER]: 'Dem Vorgang wurde eine bearbeitende Person zugewiesen.', [CommandOrder.ASSIGN_USER]: 'Dem Vorgang wurde eine bearbeitende Person zugewiesen.',
[CommandOrder.CREATE_BESCHEID]: 'Es wurde ein Bescheid erstellt.', [CommandOrder.CREATE_BESCHEID]: 'Es wurde ein Bescheid erstellt.',
[CommandOrder.PROCESS_VORGANG]: 'Vorgang vorprüfen erfgolreich' [CommandOrder.PROCESS_VORGANG]: 'Vorgang vorprüfen erfolgreich.'
} }
export const LOESCH_ANFORDERUNG_ZURUECKNEHMEN_CONCURRENT_TO_DELETE_VORGANG_MESSAGE: string = 'Der Vorgang wurde zwischenzeitlich gelöscht.'; export const LOESCH_ANFORDERUNG_ZURUECKNEHMEN_CONCURRENT_TO_DELETE_VORGANG_MESSAGE: string = 'Der Vorgang wurde zwischenzeitlich gelöscht.';
\ No newline at end of file
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<mask id="mask0_2_1599" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="25"> <mask id="mask0_2_1599" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="25">
<rect y="0.000183105" width="24" height="24" fill="#D9D9D9"/> <rect y="0.000183105" width="24" height="24"/>
</mask> </mask>
<g mask="url(#mask0_2_1599)"> <g mask="url(#mask0_2_1599)">
<path d="M8.6 22.5002L6.7 19.3002L3.1 18.5002L3.45 14.8002L1 12.0002L3.45 9.20018L3.1 5.50018L6.7 4.70018L8.6 1.50018L12 2.95018L15.4 1.50018L17.3 4.70018L20.9 5.50018L20.55 9.20018L23 12.0002L20.55 14.8002L20.9 18.5002L17.3 19.3002L15.4 22.5002L12 21.0502L8.6 22.5002ZM9.45 19.9502L12 18.8502L14.6 19.9502L16 17.5502L18.75 16.9002L18.5 14.1002L20.35 12.0002L18.5 9.85018L18.75 7.05018L16 6.45018L14.55 4.05018L12 5.15018L9.4 4.05018L8 6.45018L5.25 7.05018L5.5 9.85018L3.65 12.0002L5.5 14.1002L5.25 16.9502L8 17.5502L9.45 19.9502ZM10.95 15.5502L16.6 9.90018L15.2 8.45018L10.95 12.7002L8.8 10.6002L7.4 12.0002L10.95 15.5502Z" fill="#1C1B1F"/> <path d="M8.6 22.5002L6.7 19.3002L3.1 18.5002L3.45 14.8002L1 12.0002L3.45 9.20018L3.1 5.50018L6.7 4.70018L8.6 1.50018L12 2.95018L15.4 1.50018L17.3 4.70018L20.9 5.50018L20.55 9.20018L23 12.0002L20.55 14.8002L20.9 18.5002L17.3 19.3002L15.4 22.5002L12 21.0502L8.6 22.5002ZM9.45 19.9502L12 18.8502L14.6 19.9502L16 17.5502L18.75 16.9002L18.5 14.1002L20.35 12.0002L18.5 9.85018L18.75 7.05018L16 6.45018L14.55 4.05018L12 5.15018L9.4 4.05018L8 6.45018L5.25 7.05018L5.5 9.85018L3.65 12.0002L5.5 14.1002L5.25 16.9502L8 17.5502L9.45 19.9502ZM10.95 15.5502L16.6 9.90018L15.2 8.45018L10.95 12.7002L8.8 10.6002L7.4 12.0002L10.95 15.5502Z"/>
</g> </g>
</svg> </svg>
\ No newline at end of file
...@@ -935,4 +935,68 @@ describe('Vorgang Reducer', () => { ...@@ -935,4 +935,68 @@ describe('Vorgang Reducer', () => {
}) })
}) })
}) })
describe('initialState', () => {
describe('vorgangStatistic', () => {
describe('byStatus', () => {
it('should have null as neu', () => {
const vorgangStatistic: StateResource<VorgangStatistic> = Reducer.initialState.vorgangStatistic;
expect(vorgangStatistic.resource.byStatus.neu).toBeNull();
})
it('should have null as angenommen', () => {
const vorgangStatistic: StateResource<VorgangStatistic> = Reducer.initialState.vorgangStatistic;
expect(vorgangStatistic.resource.byStatus.angenommen).toBeNull();
})
it('should have null as inBearbeitung', () => {
const vorgangStatistic: StateResource<VorgangStatistic> = Reducer.initialState.vorgangStatistic;
expect(vorgangStatistic.resource.byStatus.inBearbeitung).toBeNull();
})
it('should have null as beschieden', () => {
const vorgangStatistic: StateResource<VorgangStatistic> = Reducer.initialState.vorgangStatistic;
expect(vorgangStatistic.resource.byStatus.beschieden).toBeNull();
})
it('should have null as abgeschlossen', () => {
const vorgangStatistic: StateResource<VorgangStatistic> = Reducer.initialState.vorgangStatistic;
expect(vorgangStatistic.resource.byStatus.abgeschlossen).toBeNull();
})
it('should have null as verworfen', () => {
const vorgangStatistic: StateResource<VorgangStatistic> = Reducer.initialState.vorgangStatistic;
expect(vorgangStatistic.resource.byStatus.verworfen).toBeNull();
})
it('should have null as zuLoeschen', () => {
const vorgangStatistic: StateResource<VorgangStatistic> = Reducer.initialState.vorgangStatistic;
expect(vorgangStatistic.resource.byStatus.zuLoeschen).toBeNull();
})
})
it('should have null as wiedervorlagen', () => {
const vorgangStatistic: StateResource<VorgangStatistic> = Reducer.initialState.vorgangStatistic;
expect(vorgangStatistic.resource.wiedervorlagen).toBeNull();
})
it('should have false as existsWiedervorlageOverdue', () => {
const vorgangStatistic: StateResource<VorgangStatistic> = Reducer.initialState.vorgangStatistic;
expect(vorgangStatistic.resource.existsWiedervorlageOverdue).toBeFalsy();
})
})
})
}); });
\ No newline at end of file
...@@ -66,7 +66,7 @@ export interface VorgangState { ...@@ -66,7 +66,7 @@ export interface VorgangState {
export const initialState: VorgangState = { export const initialState: VorgangState = {
vorgangList: createEmptyStateResource(), vorgangList: createEmptyStateResource(),
vorgangStatistic: createEmptyStateResource(), vorgangStatistic: createStateResource(createEmptyVorgangStatistic()),
vorgaenge: EMPTY_ARRAY, vorgaenge: EMPTY_ARRAY,
searchString: EMPTY_STRING, searchString: EMPTY_STRING,
searchPreviewList: createEmptyStateResource(), searchPreviewList: createEmptyStateResource(),
...@@ -84,6 +84,22 @@ export const initialState: VorgangState = { ...@@ -84,6 +84,22 @@ export const initialState: VorgangState = {
vorgangExport: createEmptyStateResource(), vorgangExport: createEmptyStateResource(),
}; };
function createEmptyVorgangStatistic(): VorgangStatistic {
return {
byStatus: {
abgeschlossen: null,
angenommen: null,
neu: null,
inBearbeitung: null,
beschieden: null,
verworfen: null,
zuLoeschen: null
},
wiedervorlagen: null,
existsWiedervorlageOverdue: false
};
}
const vorgangReducer: ActionReducer<VorgangState, Action> = createReducer( const vorgangReducer: ActionReducer<VorgangState, Action> = createReducer(
initialState, initialState,
......
<goofy-client-ozgcloud-routing-button [routerLinkPath]="routePath" [class.selected]="isSelected" [attr.data-test-id]="'views-menu-item-' + (label | convertForDataTest)"> <goofy-client-ozgcloud-routing-button [routerLinkPath]="routePath" [class.selected]="isSelected" [attr.data-test-id]="'views-menu-item-' + (label | convertForDataTest)">
<ng-content></ng-content> <ng-content></ng-content>
<div class="label">{{ label }}</div> <div class="label">{{ label }}</div>
<div [attr.data-test-id]="'views-menu-item-count-' + (label | convertForDataTest)">{{count}}</div> <div *ngIf="count != null" [attr.data-test-id]="'views-menu-item-count-' + (label | convertForDataTest)">{{count}}</div>
</goofy-client-ozgcloud-routing-button> </goofy-client-ozgcloud-routing-button>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ConvertForDataTestPipe } from '@goofy-client/tech-shared'; import { ConvertForDataTestPipe } from '@goofy-client/tech-shared';
import { existsAsHtmlElement, notExistsAsHtmlElement } from '@goofy-client/test-utils';
import { OzgcloudRoutingButtonComponent } from '@goofy-client/ui'; import { OzgcloudRoutingButtonComponent } from '@goofy-client/ui';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { MockComponent } from 'ng-mocks'; import { MockComponent } from 'ng-mocks';
import { VorgangViewItemComponent } from './vorgang-view-item.component'; import { VorgangViewItemComponent } from './vorgang-view-item.component';
...@@ -25,4 +27,38 @@ describe('VorgangViewItemComponent', () => { ...@@ -25,4 +27,38 @@ describe('VorgangViewItemComponent', () => {
it('should create', () => { it('should create', () => {
expect(component).toBeTruthy(); expect(component).toBeTruthy();
}); });
describe('count', () => {
const count: string = getDataTestIdOf('views-menu-item-count-Dummy');
beforeEach(() => {
component.label = 'Dummy';
})
it('should show on number', () => {
component.count = 5;
fixture.detectChanges();
existsAsHtmlElement(fixture, count);
})
it('should hide on null', () => {
component.count = null;
component.label = 'Dummy';
fixture.detectChanges();
notExistsAsHtmlElement(fixture, count);
})
it('should show on 0', () => {
component.count = 0;
fixture.detectChanges();
existsAsHtmlElement(fixture, count);
})
})
}); });
...@@ -28,18 +28,18 @@ ...@@ -28,18 +28,18 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.itvsh.ozg</groupId>
<artifactId>goofy</artifactId>
<version>1.18.0-SNAPSHOT</version>
<name>Goofy Parent</name>
<packaging>pom</packaging>
<parent> <parent>
<groupId>de.itvsh.kop.common</groupId> <groupId>de.itvsh.kop.common</groupId>
<artifactId>kop-common-parent</artifactId> <artifactId>kop-common-parent</artifactId>
<version>2.3.1</version> <version>2.3.1</version>
</parent> </parent>
<groupId>de.itvsh.ozg</groupId>
<artifactId>goofy</artifactId>
<version>1.18.0-SNAPSHOT</version>
<name>Goofy Parent</name>
<packaging>pom</packaging>
<modules> <modules>
<module>goofy-client</module> <module>goofy-client</module>
<module>goofy-server</module> <module>goofy-server</module>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment