Adding, changing and removing an associated postal address to/from a person now works.
parent
a928902b36
commit
e72976252a
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"name": "ccm-cms",
|
||||
"version": "7.0.0",
|
||||
"description": "JavaScript stuff for ccm-cms",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "npm-run-all build:*:*",
|
||||
"build:cms-admin:ts": "tsc",
|
||||
"build:cms-admin:css": "sass src/main/scss/content-sections/cms-admin.scss target/generated-resources/assets/@content-sections/cms-admin.css"
|
||||
},
|
||||
"author": "Jens Pelzetter",
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"@parcel/transformer-typescript-tsc": "^2.0.0-beta.1",
|
||||
"@types/jquery": "^3.5.5",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"parcel": "^2.0.0-beta.2",
|
||||
"sass": "^1.32.12",
|
||||
"typescript": "^4.2.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tiptap/core": "^2.0.0-beta.46",
|
||||
"@tiptap/starter-kit": "^2.0.0-beta.43",
|
||||
"bootstrap": "^4.6.0",
|
||||
"bootstrap-icons": "^1.4.1",
|
||||
"jquery": "^3.6.0",
|
||||
"popper.js": "^1.16.1"
|
||||
},
|
||||
"targets": {
|
||||
"main": false
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"name": "ccm-cms",
|
||||
"version": "7.0.0",
|
||||
"description": "JavaScript stuff for ccm-cms",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "npm-run-all build:*:*",
|
||||
"build:ccm-admin:js": "webpack",
|
||||
"build:ccm-admin:css": "sass src/main/scss/content-sections/cms-admin.scss target/generated-resources/assets/@content-sections/cms-admin.css"
|
||||
},
|
||||
"author": "Jens Pelzetter",
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"devDependencies": {
|
||||
"@parcel/transformer-typescript-tsc": "^2.0.0-beta.1",
|
||||
"@types/bootstrap": "^5.0.15",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"parcel": "^2.0.0-beta.2",
|
||||
"sass": "^1.32.12",
|
||||
"ts-loader": "^9.2.3",
|
||||
"typescript": "^4.2.4",
|
||||
"webpack": "^5.38.1",
|
||||
"webpack-cli": "^4.7.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tiptap/core": "^2.0.0-beta.46",
|
||||
"@tiptap/starter-kit": "^2.0.0-beta.43",
|
||||
"bootstrap": "^4.6.0",
|
||||
"bootstrap-icons": "^1.4.1",
|
||||
"jquery": "^3.6.0",
|
||||
"popper.js": "^1.16.1"
|
||||
},
|
||||
"targets": {
|
||||
"main": false
|
||||
}
|
||||
}
|
||||
|
|
@ -37,6 +37,7 @@ import java.util.Optional;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.mvc.Controller;
|
||||
import javax.mvc.Models;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.transaction.Transactional;
|
||||
|
|
@ -50,6 +51,7 @@ import javax.ws.rs.core.Context;
|
|||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@Controller
|
||||
public abstract class AbstractContactableEntityEditStep
|
||||
extends AbstractMvcAssetEditStep {
|
||||
|
||||
|
|
@ -152,6 +154,14 @@ public abstract class AbstractContactableEntityEditStep
|
|||
@FormParam("entryKey") final String entryKeyParam,
|
||||
@FormParam("entryValue") final String entryValue
|
||||
) {
|
||||
try {
|
||||
init();
|
||||
} catch (ContentSectionNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
} catch (AssetNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
}
|
||||
|
||||
final Optional<ContactEntryKey> entryKeyResult = entryKeyRepo
|
||||
.findByEntryKey(entryKeyParam);
|
||||
if (!entryKeyResult.isPresent()) {
|
||||
|
|
@ -178,6 +188,14 @@ public abstract class AbstractContactableEntityEditStep
|
|||
@PathParam("index") final int index,
|
||||
@FormParam("entryValue") final String entryValue
|
||||
) {
|
||||
try {
|
||||
init();
|
||||
} catch (ContentSectionNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
} catch (AssetNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
}
|
||||
|
||||
final List<ContactEntry> entries = getContactableEntity()
|
||||
.getContactEntries();
|
||||
if (index >= entries.size()) {
|
||||
|
|
@ -199,6 +217,14 @@ public abstract class AbstractContactableEntityEditStep
|
|||
public String removeContactEntry(
|
||||
@PathParam("index") final int index
|
||||
) {
|
||||
try {
|
||||
init();
|
||||
} catch (ContentSectionNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
} catch (AssetNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
}
|
||||
|
||||
final List<ContactEntry> entries = getContactableEntity()
|
||||
.getContactEntries();
|
||||
if (index >= entries.size()) {
|
||||
|
|
@ -221,6 +247,14 @@ public abstract class AbstractContactableEntityEditStep
|
|||
@FormParam("postalAddressIdentifier")
|
||||
final String postalAddressIdentifier
|
||||
) {
|
||||
try {
|
||||
init();
|
||||
} catch (ContentSectionNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
} catch (AssetNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
}
|
||||
|
||||
final Identifier identifier = identifierParser
|
||||
.parseIdentifier(postalAddressIdentifier);
|
||||
final Optional<PostalAddress> postalAddressResult;
|
||||
|
|
@ -260,6 +294,14 @@ public abstract class AbstractContactableEntityEditStep
|
|||
@AuthorizationRequired
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
public String removePostalAddress() {
|
||||
try {
|
||||
init();
|
||||
} catch (ContentSectionNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
} catch (AssetNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
}
|
||||
|
||||
contactableManager.removePostalAddressFromContactableEntity(
|
||||
getContactableEntity().getPostalAddress(), getContactableEntity()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ async function selectAsset(event: Event, assetPickerElem: Element) {
|
|||
console.error("assetPickerParam is null");
|
||||
return;
|
||||
}
|
||||
assetPickerParam.value = assetUuid;
|
||||
assetPickerParam.value = `UUID-${assetUuid}`;
|
||||
|
||||
const form = assetPickerElem.querySelector("form") as HTMLFormElement;
|
||||
form.submit();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
module.exports = {
|
||||
mode: "production",
|
||||
devtool: "inline-source-map",
|
||||
entry: {
|
||||
"cms-admin": "./src/main/typescript/content-sections/cms-admin.ts",
|
||||
"cms-editor": "./src/main/typescript/content-sections/cms-editor.ts"
|
||||
},
|
||||
output: {
|
||||
filename: "[name].js",
|
||||
path: __dirname + "/target/generated-resources/assets/@content-sections"
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".tsx", ".ts", ".js", ".json"]
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
// all files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'
|
||||
{ test: /\.tsx?$/, use: ["ts-loader"], exclude: /node_modules/ }
|
||||
]
|
||||
}
|
||||
};
|
||||
Loading…
Reference in New Issue