Commit 98facd60 authored by Christopher Keim's avatar Christopher Keim
Browse files

[TOB-219] feat: Add selection of parent statements to workflow form



* Change API statement search interfaces for pagination
* Add pagination to statement search in store
* Include parents when fetching statement details
* Add a component for list of statements
* Add data mocks for testing
* Open collapsibles if content is focused
* Reorganize translations
* Integrate statement select in workflow data form

[TOB-211] feat: Add selection of contact information to info form

* Display zero instead of null in comments component
* Add property contactId to IAPIStatementModel
* Add property contactId to statement info form value
* Add directive to assign css class on invalid form controls
* Add components for pagination and contact data
* Reorganize forms into feature modules
* Extend task complete action to claim next camunda task
* Add back end calls for contact data
* Add utility functions for store reducers
* Add store effects for searching and fetching contact data
* Add store effect for opening contact base data module in new tab
* Integrate contact selection in info form

[TOB-246] feat: Add attachment controls to info form

* Add new back end calls for attachments and remove old code
* Add store module for attachments
* Extend store for fetching and uploading attachments
* Reorganize statement store and adjust submit effect
* Add further utility functions for store reducers
* Add action and effect to open attachments
* Include attachments when fetching statement details
* Add UI components for attachment control
* Change main overflow property to scroll

[TOB-277] feat: Display affected business section to info form

* Add back end calls for avaialable business sections
* Add action and effects for fetching business sections from back end
* Add Integrate into info form
* Fetch settings when visiting new statement form

[TOB-260] test: Increase test coverage

* Add tests for setting reducers
* Add tests for root reducers
* Add tests for process reducers
* Change style to avoid jumping text blocks
Signed-off-by: Christopher Keim's avatarChristopher Keim <keim@develop-group.de>
parent d60f986d
{
"name": "openkonsequenz-statement-public-affairs",
"version": "0.4.0",
"version": "0.5.0",
"description": "Statement Public Affairs",
"license": "Eclipse Public License - v 2.0",
"routes": {
"spaFrontend": "/statementpaFE",
"spaBackend": "/statementpaBE",
"portal": "/portalFE"
"portal": "/portalFE",
"contactDataBase": "/contactdatabase"
},
"scripts": {
"-- Build ----------------": "",
......
......@@ -10,5 +10,9 @@
"/portalFE": {
"target": "http://localhost:8280",
"secure": false
},
"/contactdatabase": {
"target": "http://localhost:8280",
"secure": false
}
}
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
/**
* Interface which represents the model of an uploaded attachment in the back end data base.
*/
export interface IAPIAttachmentModel {
/**
* Unique ID of a specifcic attachment.
*/
id: number;
/**
* Name which is used for display in the app.
*/
name: string;
/**
* Type of the attachment, e.g. a PDF or text file.
*/
type: string;
/**
* Size of a specific attachment in bytes.
*/
size: number;
/**
* Timestamp file.
*/
timestamp: string;
/**
* List of IDs for tagging.
*/
tagIds: number[];
}
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import {HttpClient} from "@angular/common/http";
import {Inject, Injectable} from "@angular/core";
import {urlJoin} from "../../../util/http";
import {SPA_BACKEND_ROUTE} from "../../external-routes";
import {IAPIAttachmentModel} from "./IAPIAttachmentModel";
@Injectable({providedIn: "root"})
export class AttachmentsApiService {
public constructor(
protected readonly httpClient: HttpClient,
@Inject(SPA_BACKEND_ROUTE) protected readonly baseUrl: string
) {
}
/**
* Fetches a list of all attachments belonging to a statement.
*/
public getAttachments(statementId: number) {
const endPoint = `/statements/${statementId}/attachments`;
return this.httpClient.get<IAPIAttachmentModel[]>(urlJoin(this.baseUrl, endPoint));
}
/**
* Uploads a new file to the back end linked to a specific statement.
*/
public postAttachment(statementId: number, taskId: string, file: File) {
const endPoint = `/process/statements/${statementId}/task/${taskId}/attachments`;
const formData = new FormData();
formData.append("attachment", file, file.name);
return this.httpClient.post<IAPIAttachmentModel>(urlJoin(this.baseUrl, endPoint), formData);
}
/**
* Uploads a new file to the back end linked to a specific statement.
*/
public deleteAttachment(statementId: number, taskId: string, attachmentId: number) {
const endPoint = `/process/statements/${statementId}/task/${taskId}/attachments/${attachmentId}`;
return this.httpClient.delete(urlJoin(this.baseUrl, endPoint));
}
}
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
export * from "./attachments-api.service";
export * from "./IAPIAttachmentModel";
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
export interface IAPIContactPerson {
companyId: string;
companyName: string;
email: string;
id: string;
firstName: string;
lastName: string;
}
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
export interface IAPIContactPersonDetails {
community: string;
communitySuffix: string;
company: string;
email: string;
firstName: string;
houseNumber: string;
lastName: string;
postCode: string;
salutation: string;
street: string;
title: string;
}
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import {HttpClient} from "@angular/common/http";
import {Inject, Injectable} from "@angular/core";
import {objectToHttpParams, urlJoin} from "../../../util/http";
import {SPA_BACKEND_ROUTE} from "../../external-routes";
import {IAPIPaginationResponse, IAPISearchOptions} from "../shared";
import {IAPIContactPerson} from "./IAPIContactPerson";
import {IAPIContactPersonDetails} from "./IAPIContactPersonDetails";
@Injectable({providedIn: "root"})
export class ContactsApiService {
public constructor(
protected readonly httpClient: HttpClient,
@Inject(SPA_BACKEND_ROUTE) protected readonly baseUrl: string
) {
}
/**
* Fetches a paginated list of contacts from the back end data base.
*/
public getContacts(searchOptions: IAPISearchOptions) {
const endPoint = `contacts`;
const params = objectToHttpParams({...searchOptions});
return this.httpClient.get<IAPIPaginationResponse<IAPIContactPerson>>(urlJoin(this.baseUrl, endPoint), {params});
}
/**
* Fetches details of a specific contact from the back end data base.
*/
public getContactDetails(contactId: string) {
const endPoint = `contacts/${contactId}`;
return this.httpClient.get<IAPIContactPersonDetails>(urlJoin(this.baseUrl, endPoint));
}
/**
* Fetches contact details of a specific statement from the back end data base.
*/
public getStatementsContact(statementId: number) {
const endPoint = `/statements/${statementId}/contact`;
return this.httpClient.get<IAPIContactPersonDetails>(urlJoin(this.baseUrl, endPoint));
}
}
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
export * from "./contacts-api.service";
......@@ -44,7 +44,6 @@ export class CoreApiService {
public getUserInfo() {
const endPoint = `userinfo`;
return this.httpClient.get<IAPIUserInfo>(urlJoin(this.baseUrl, endPoint));
}
/**
......
......@@ -11,7 +11,10 @@
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
export * from "./attachments";
export * from "./contacts";
export * from "./core";
export * from "./process";
export * from "./settings";
export * from "./statements";
export * from "./shared";
......@@ -11,19 +11,6 @@
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
export interface IAPIStatementHistory {
processName: string;
processVersion: number;
......
......@@ -11,6 +11,7 @@
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
export * from "./EAPIProcessTaskDefinitionKey";
export * from "./IAPIStatementHistory";
export * from "./IAPIProcessTask";
export * from "./IAPIProcessObject";
......
......@@ -15,6 +15,7 @@ import {HttpClient} from "@angular/common/http";
import {Inject, Injectable} from "@angular/core";
import {urlJoin} from "../../../util";
import {SPA_BACKEND_ROUTE} from "../../external-routes";
import {IAPISectorsModel} from "../statements/IAPISectorsModel";
import {IAPIDepartmentsConfiguration} from "./IAPIDepartmentsConfiguration";
import {IAPIStatementType} from "./IAPIStatementType";
......@@ -46,4 +47,12 @@ export class SettingsApiService {
return this.httpClient.get<IAPIDepartmentsConfiguration>(urlJoin(this.baseUrl, endPoint));
}
/**
* Fetches the list of all sectors.
*/
public getSectors() {
const endPoint = `/sectors`;
return this.httpClient.get<IAPISectorsModel>(urlJoin(this.baseUrl, endPoint));
}
}
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
/**
* Interface which represents the response of a paginated search in the back end data base.
*/
export interface IAPIPaginationResponse<T> {
content: T[];
pageable: string;
last: boolean;
totalPages: number;
totalElements: number;
size: number;
number: number;
numberOfElements: number;
first: boolean;
sort: {
sorted: boolean;
unsorted: boolean;
empty: boolean;
};
empty: boolean;
}
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
/**
* Interface which represents the options for a paginated search in the back end data base.
*/
export interface IAPISearchOptions {
/**
* Search strings to find statements.
*/
q: string;
/**
* Size of the loaded page.
*/
size?: number;
/**
* Number of page.
*/
page?: number;
/**
* Key for sorting the results.
*/
sort?: string;
}
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
export * from "./IAPIPaginationResponse";
export * from "./IAPISearchOptions";
/********************************************************************************
* Copyright (c) 2020 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
export interface IAPISectorsModel {
[sectorIdentifier: string]: string[];
}
......@@ -14,24 +14,28 @@
/**
* Interface which represents the model of all basic information of a specific statement in the back end data base.
*/
export interface IAPIStatementModel {
export interface IAPIStatementModel extends IAPIPartialStatementModel {
id: number;
finished: boolean;
}
export interface IAPIPartialStatementModel {
title: string;
dueDate: string;
receiptDate: string;
taskId: number;
finished: boolean;
typeId: number;
city: string;
district: string;
contactId: string;
}
......@@ -14,7 +14,7 @@
import {IAPIDepartmentGroups} from "../settings";
/**
* Interface which represents the model of all workflow information of a specific statement in the back end data base.
* Interface which represents the workflow information for a specific statement in the back end data base.
*/
export interface IAPIWorkflowData {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment