Skip to content

Commit

Permalink
Merge pull request #52 from sanctuuary/dev
Browse files Browse the repository at this point in the history
Release 1.5.0
  • Loading branch information
KoenHav authored Dec 20, 2021
2 parents c0c461b + 19fce2b commit 152fbe7
Show file tree
Hide file tree
Showing 25 changed files with 24,168 additions and 1,477 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.5.0] - 2021-12-20

### Added

- Clear buttons to clear all input data, output data, constraints on the explore page.
- Domains can now be permanently deleted in the domain edit page.

### Changed

- Update back-end Kotlin version from 1.3.72 -> 1.6.0.
- Update APE dependency version 1.1.9 -> 1.1.12 (includes log4j vulnerability fix).

### Fixed

- Remove "tab" as suggestion for separating data taxonomy roots as this also moves the user to the next input field.
- Some dependencies were updated to fix vulnerability issues.
- When there are many inputs, outputs, or constraints on the explore page; a scrollbar will now appear inside the workflow input box to prevent the workflow result from appearing far below.

## [1.4.0] - 2021-11-06

### Added
Expand Down Expand Up @@ -157,6 +175,7 @@ This release is paired with the APE Web [DOI release](https://zenodo.org/badge/l
* Approve user accounts.

[Unreleased]: https://github.com/sanctuuary/APE-Web/compare/master...dev
[1.5.0]: https://github.com/sanctuuary/APE-Web/compare/v1.4.0...v1.5.0
[1.4.0]: https://github.com/sanctuuary/APE-Web/compare/v1.3.3...v1.4.0
[1.3.3]: https://github.com/sanctuuary/APE-Web/compare/v1.3.2...v1.3.3
[1.3.2]: https://github.com/sanctuuary/APE-Web/compare/v1.3.1...v1.3.2
Expand Down
2 changes: 1 addition & 1 deletion back-end/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ COPY pom.xml /app
RUN mvn compile
COPY . /app
RUN mvn package -DskipTests=true -P docker
ENTRYPOINT ["java", "-jar", "target/backend-1.4.0.jar"]
ENTRYPOINT ["java", "-jar", "target/backend-1.5.0.jar"]
6 changes: 3 additions & 3 deletions back-end/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
</parent>
<groupId>com.apexdevs</groupId>
<artifactId>backend</artifactId>
<version>1.4.0</version>
<version>1.5.0</version>
<name>backend</name>
<description>APE Web back-end</description>

<properties>
<java.version>11</java.version>
<kotlin.version>1.3.72</kotlin.version>
<kotlin.version>1.6.0</kotlin.version>
<orchid.version>0.21.0</orchid.version>
</properties>

Expand Down Expand Up @@ -46,7 +46,7 @@
<dependency>
<groupId>io.github.sanctuuary</groupId>
<artifactId>APE</artifactId>
<version>1.1.9</version>
<version>1.1.12</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import nl.uu.cs.ape.sat.models.enums.SynthesisFlag
import nl.uu.cs.ape.sat.models.logic.constructs.TaxonomyPredicate
import java.io.ByteArrayOutputStream
import java.nio.file.Path
import java.util.Locale
import javax.imageio.ImageIO

/**
Expand Down Expand Up @@ -141,7 +142,11 @@ class ApeRequest(val domain: Domain, private val rootLocation: Path, val ape: AP
/**
* String extension to format taxonomy labels into a pretty printed label
*/
private fun String.formatLabel(): String = replace("_", " ").split(" ").joinToString(" ") { it.capitalize() }
private fun String.formatLabel(): String = replace("_", " ").split(" ").joinToString(" ") { it ->
it.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString()
}
}

private fun String.removePrefixIRI(): String = replace(domain.ontologyPrefixIRI, "").replace("\"", "")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,54 @@ class ApiDomainController(
}
}

/**
* Allows the owner of a domain to permanently delete a domain.
* @param user authenticated user, automatically retrieved from session
* @param domainId The ID of the domain that should be deleted.
*/
@ResponseStatus(HttpStatus.OK)
@PostMapping("/delete/{domainId}")
fun deleteDomain(@AuthenticationPrincipal user: User, @PathVariable domainId: ObjectId) {
try {
// find the current user in the database
val userResult = userOperation.getByEmail(user.username)

// check if the domain exists
val domain = domainOperation.getDomain(domainId)

// check if the user is the owner of the domain
val owner = domainOperation.getOwner(domainId)
if (owner.id != userResult.id)
throw AccessDeniedException("User is not the owner of this domain")

// delete the domain and related database entries
// delete access to the domain
val accessList = domainOperation.userDomainAccessRepository.findByDomainId(domainId)
for (access in accessList) {
domainOperation.userDomainAccessRepository.deleteById(access.id)
}
// delete the connections to topics
val domainTopics = domainOperation.domainTopicRepository.findByDomainId(domainId)
for (topic in domainTopics) {
domainOperation.domainTopicRepository.deleteById(topic.id)
}
// delete the domain itself
domainOperation.domainRepository.deleteById(domainId)
storageService.deleteDomainDirectories(domainId)
} catch (exc: Exception) {
when (exc) {
is UserNotFoundException ->
throw ResponseStatusException(HttpStatus.UNAUTHORIZED, "Authorized user not found", exc)
is DomainNotFoundException ->
throw ResponseStatusException(HttpStatus.BAD_REQUEST, exc.message, exc)
is AccessDeniedException ->
throw ResponseStatusException(HttpStatus.UNAUTHORIZED, exc.message, exc)
else ->
throw ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, exc.message, exc)
}
}
}

/**
* Downloads the toolsAnnotations file for the specified domain
* @param user if the user needs to be authenticated for the domain
Expand Down
10 changes: 5 additions & 5 deletions front-end/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ module.exports = {
"../styles/globals.less": "<rootDir>/config/jest/cssTransform.js",
"package.json": "<rootDir>/config/jest/packageTransform.js",
// Path aliases, same as in tsconfig.json
"@components(.*)$": "<rootDir>/src/components$1",
"@pages(.*)$": "<rootDir>/src/pages$1",
"@models(.*)$": "<rootDir>/src/models$1",
"@helpers(.*)$": "<rootDir>/src/helpers$1",
"@tests(.*)$": "<rootDir>/tests$1",
"@components/(.*)$": "<rootDir>/src/components/$1",
"@pages/(.*)$": "<rootDir>/src/pages/$1",
"@models/(.*)$": "<rootDir>/src/models/$1",
"@helpers/(.*)$": "<rootDir>/src/helpers/$1",
"@tests/(.*)$": "<rootDir>/tests/$1",
},
setupFiles: [
"<rootDir>/node_modules/jest-fetch-mock/setupJest.js"
Expand Down
Loading

0 comments on commit 152fbe7

Please sign in to comment.