Skip to content

Commit efb78f3

Browse files
authored
Merge pull request #296 from clowder-framework/release/1.19.1
Release/1.19.1
2 parents cefe45a + cfdcb46 commit efb78f3

File tree

19 files changed

+209
-185
lines changed

19 files changed

+209
-185
lines changed

.github/workflows/docker.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636
- clowder
3737
- mongo-init
3838
- monitor
39-
- check
4039
include:
4140
- name: clowder
4241
FOLDER: "."
@@ -50,10 +49,6 @@ jobs:
5049
FOLDER: scripts/monitor
5150
IMAGE: monitor
5251
README: ""
53-
- name: check
54-
FOLDER: scripts/check
55-
IMAGE: check
56-
README: ""
5752
steps:
5853
- uses: actions/checkout@v2
5954

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## 1.19.1 - 2021-10-19
8+
9+
### Added
10+
- Support the [DefaultAWSCredentialsProviderChain](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html)
11+
for passing in credentials to the S3ByteStorageService.
12+
13+
### Fixed
14+
- Cleaning up after a failed upload should no longer decrement the file + byte counts.
15+
- Fix the broken preview after file deletion within a folder. [#277](https://github.com/clowder-framework/clowder/issues/277)
16+
- Fix public spaces not displaying correctly if not logged in.
17+
18+
### Changed
19+
- Now building mongo-init and monitor docker containers with python 3.8
20+
- Upgraded extractor parameters jsonform to version `2.2.5`.
21+
22+
### Removed
23+
- Check image is now part of [ncsa/checks](https://github.com/ncsa/checks/)
24+
725
## 1.19.0 - 2021-10-05
826
**_Important:_** This update requires a MongoDB update schema due to the new ability of showing summary statistics at the
927
space level. Make sure to start the application with -DMONGOUPDATE=1.

app/api/Folders.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import scala.collection.mutable.ListBuffer
2222
class Folders @Inject() (
2323
folders: FolderService,
2424
datasets: DatasetService,
25+
collections: CollectionService,
2526
files: FileService,
2627
events: EventService,
2728
routing: ExtractorRoutingService) extends ApiController {
@@ -316,6 +317,23 @@ class Folders @Inject() (
316317
if(dataset.files.contains(fileId)) {
317318
folders.addFile(newFolder.id, fileId)
318319
datasets.removeFile(datasetId, fileId)
320+
321+
// when moving a file in the root of a dataset inside a folder
322+
// check if that file has been used as thumbnail
323+
// if yes, update the thumbnail of both dataset and collection
324+
if(!file.thumbnail_id.isEmpty && !dataset.thumbnail_id.isEmpty){
325+
if (file.thumbnail_id.get.equals(dataset.thumbnail_id.get)){
326+
datasets.newThumbnail(dataset.id)
327+
collections.get(dataset.collections).found.foreach(collection => {
328+
if(!collection.thumbnail_id.isEmpty){
329+
if(collection.thumbnail_id.get.equals(dataset.thumbnail_id.get)){
330+
collections.createThumbnail(collection.id)
331+
}
332+
}
333+
})
334+
}
335+
}
336+
319337
files.index(fileId)
320338
datasets.index(datasetId)
321339
Ok(toJson(Map("status" -> "success", "fileName" -> file.filename, "folderName" -> newFolder.name)))

app/controllers/Spaces.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class Spaces @Inject() (spaces: SpaceService, users: UserService, events: EventS
168168
val collectionsInSpace = spaces.getCollectionsInSpace(Some(id.stringify), Some(size))
169169
val datasetsInSpace = datasets.listSpace(size, id.toString(), user)
170170
val spaceBytes : Long = s.spaceBytes
171-
val spaceFiles : Integer = getFilesPerSpace(id, user.get)
171+
val spaceFiles : Integer = getFilesPerSpace(id, user)
172172
val publicDatasetsInSpace = datasets.listSpaceStatus(size, id.toString(), "publicAll", user)
173173
val usersInSpace = spaces.getUsersInSpace(id, None)
174174
var curationObjectsInSpace: List[CurationObject] = List()
@@ -641,9 +641,9 @@ class Spaces @Inject() (spaces: SpaceService, users: UserService, events: EventS
641641
}
642642
}
643643

644-
private def getFilesPerSpace(spaceId: UUID, user: models.User) : Integer = {
644+
private def getFilesPerSpace(spaceId: UUID, user: Option[User]) : Integer = {
645645
var spaceFiles: Integer = 0
646-
val allDatasetsInSpace = datasets.listSpace(0, spaceId.toString(), Some(user))
646+
val allDatasetsInSpace = datasets.listSpace(0, spaceId.toString(), user)
647647
for (ds <- allDatasetsInSpace) {
648648
val files_in_ds = ds.files.length
649649
spaceFiles += files_in_ds

app/services/mongodb/MongoDBFileService.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,20 +847,24 @@ class MongoDBFileService @Inject() (
847847
}
848848
}
849849

850+
850851
// delete the actual file
851-
if(isLastPointingToLoader(file.loader, file.loader_id)) {
852+
val fileSize = if(isLastPointingToLoader(file.loader, file.loader_id)) {
852853
for(preview <- previews.findByFileId(file.id)){
853854
previews.removePreview(preview)
854855
}
855856
if(!file.thumbnail_id.isEmpty)
856857
thumbnails.remove(UUID(file.thumbnail_id.get))
857858
ByteStorageService.delete(file.loader, file.loader_id, FileDAO.COLLECTION)
859+
file.length
860+
} else {
861+
0
858862
}
859863

860864
import UUIDConversions._
861865
FileDAO.removeById(file.id)
862866
appConfig.incrementCount('files, -1)
863-
appConfig.incrementCount('bytes, -file.length)
867+
appConfig.incrementCount('bytes, -1 * fileSize)
864868
current.plugin[ElasticsearchPlugin].foreach {
865869
_.delete(id.stringify)
866870
}

0 commit comments

Comments
 (0)