Skip to content

Commit cbb431d

Browse files
committed
Merge branch 'master' into move-symlinks-on-dataset-delete
2 parents 1f59a64 + 975d1dc commit cbb431d

File tree

7 files changed

+33
-21
lines changed

7 files changed

+33
-21
lines changed

CHANGELOG.unreleased.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
3333
- Fixed the alignment of the button that allows restricting floodfill operations to a bounding box. [#8388](https://github.com/scalableminds/webknossos/pull/8388)
3434
- Fixed a bug for rotated dataset where volume tools were disabled although the dataset was rendered untransformed. [#8432](https://github.com/scalableminds/webknossos/pull/8432)
3535
- Fixed rare bug where saving got stuck. [#8409](https://github.com/scalableminds/webknossos/pull/8409)
36+
- Re-enabled jobs planned to be paid with credits for organizations without a paid plan. [#8478](https://github.com/scalableminds/webknossos/pull/8478)
3637
- Fixed that the dataset extent tooltip in the right details bar in the dashboard did not properly update when switching datasets. [#8477](https://github.com/scalableminds/webknossos/pull/8477)
3738
- Fixed some rendering bugs for float datasets that used a large dynamic range. [#8325](https://github.com/scalableminds/webknossos/pull/8325)
3839
- Fixed a bug where reverting annotations could get stuck if some of its layers had been deleted in the meantime. [#8405](https://github.com/scalableminds/webknossos/pull/8405)

app/controllers/JobController.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ class JobController @Inject()(jobDAO: JobDAO,
294294
_ <- datasetService.assertValidDatasetName(newDatasetName)
295295
_ <- datasetService.assertValidLayerNameLax(layerName)
296296
multiUser <- multiUserDAO.findOne(request.identity._multiUser)
297+
_ <- bool2Fox(multiUser.isSuperUser) ?~> "job.inferMitochondria.notAllowed.onlySuperUsers"
297298
command = JobCommand.infer_mitochondria
298299
parsedBoundingBox <- BoundingBox.fromLiteral(bbox).toFox
299300
_ <- Fox.runIf(!multiUser.isSuperUser)(jobService.assertBoundingBoxLimits(bbox, None))
@@ -335,8 +336,6 @@ class JobController @Inject()(jobDAO: JobDAO,
335336
.dataSourceFor(dataset)
336337
.flatMap(_.toUsable)
337338
.map(_.boundingBox) ?~> "dataset.boundingBox.unset"
338-
multiUser <- multiUserDAO.findOne(request.identity._multiUser)
339-
_ <- Fox.runIf(!multiUser.isSuperUser)(jobService.assertBoundingBoxLimits(datasetBoundingBox.toLiteral, None))
340339
command = JobCommand.align_sections
341340
commandArgs = Json.obj(
342341
"dataset_id" -> dataset._id,

app/models/organization/OrganizationService.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,8 @@ class OrganizationService @Inject()(organizationDAO: OrganizationDAO,
182182
_ <- organizationDAO.acceptTermsOfService(organizationId, version, Instant.now)
183183
} yield ()
184184

185-
def assertOrganizationHasPaidPlan(organizationId: String): Fox[Unit] =
186-
for {
187-
organization <- organizationDAO.findOne(organizationId)(GlobalAccessContext)
188-
_ <- bool2Fox(PricingPlan.isPaidPlan(organization.pricingPlan)) ?~> "creditTransaction.notPaidPlan"
189-
} yield ()
185+
// Currently disabled as in the credit system trail phase all organizations should be able to start paid jobs.
186+
// See tracking issue: https://github.com/scalableminds/webknossos/issues/8458
187+
def assertOrganizationHasPaidPlan(organizationId: String): Fox[Unit] = Fox.successful(())
188+
190189
}

conf/evolutions/130-replace-text-types.sql

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ ALTER TABLE webknossos.annotations ADD CONSTRAINT _team_objectId CHECK (_team ~
2121
ALTER TABLE webknossos.annotations ALTER COLUMN _user SET DATA TYPE TEXT;
2222
ALTER TABLE webknossos.annotations ADD CONSTRAINT _user_objectId CHECK (_user ~ '^[0-9a-f]{24}$');
2323
ALTER TABLE webknossos.annotations ALTER COLUMN _publication SET DATA TYPE TEXT;
24-
ALTER TABLE webknossos.annotations ADD CONSTRAINT _publication_objectId CHECK (_publication ~ '^[0-9a-f]{24}$');
24+
-- Dropped because there are publication ids that are not valid objectIds
25+
-- ALTER TABLE webknossos.annotations ADD CONSTRAINT _publication_objectId CHECK (_publication ~ '^[0-9a-f]{24}$');
2526
ALTER TABLE webknossos.annotations ALTER COLUMN name SET DATA TYPE TEXT;
2627
ALTER TABLE webknossos.annotations ALTER COLUMN name SET DEFAULT ''::TEXT;
2728
ALTER TABLE webknossos.annotations ALTER COLUMN tags SET DATA TYPE TEXT[];
@@ -69,7 +70,8 @@ COMMIT TRANSACTION;
6970
START TRANSACTION;
7071
DROP VIEW webknossos.publications_;
7172
ALTER TABLE webknossos.publications ALTER COLUMN _id SET DATA TYPE TEXT;
72-
ALTER TABLE webknossos.publications ADD CONSTRAINT _id_objectId CHECK (_id ~ '^[0-9a-f]{24}$');
73+
-- Dropped because there are publication ids that are not valid objectIds
74+
--ALTER TABLE webknossos.publications ADD CONSTRAINT _id_objectId CHECK (_id ~ '^[0-9a-f]{24}$');
7375
ALTER TABLE webknossos.publications ALTER COLUMN imageUrl SET DATA TYPE TEXT;
7476
ALTER TABLE webknossos.publications ALTER COLUMN title SET DATA TYPE TEXT;
7577
CREATE VIEW webknossos.publications_ AS SELECT * FROM webknossos.publications WHERE NOT isDeleted;
@@ -82,7 +84,8 @@ ALTER TABLE webknossos.datasets ADD CONSTRAINT _id_objectId CHECK (_id ~ '^[0-9a
8284
ALTER TABLE webknossos.datasets ALTER COLUMN _dataStore SET DATA TYPE TEXT;
8385
ALTER TABLE webknossos.datasets ALTER COLUMN _organization SET DATA TYPE TEXT;
8486
ALTER TABLE webknossos.datasets ALTER COLUMN _publication SET DATA TYPE TEXT;
85-
ALTER TABLE webknossos.datasets ADD CONSTRAINT _publication_objectId CHECK (_publication ~ '^[0-9a-f]{24}$');
87+
-- Dropped because there are publication ids that are not valid objectIds
88+
--ALTER TABLE webknossos.datasets ADD CONSTRAINT _publication_objectId CHECK (_publication ~ '^[0-9a-f]{24}$');
8689
ALTER TABLE webknossos.datasets ALTER COLUMN _uploader SET DATA TYPE TEXT;
8790
ALTER TABLE webknossos.datasets ADD CONSTRAINT _uploader_objectId CHECK (_uploader ~ '^[0-9a-f]{24}$');
8891
ALTER TABLE webknossos.datasets ALTER COLUMN _folder SET DATA TYPE TEXT;

conf/messages

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ job.convertToWkw.notAllowed.organization = Converting to WKW is only allowed for
340340
job.inferNuclei.notAllowed.organization = Currently nuclei inferral is only allowed for datasets of your own organization.
341341
job.inferNeurons.notAllowed.organization = Currently neuron inferral is only allowed for datasets of your own organization.
342342
job.inferNeurons.annotationIdEvalParamsMissing=A evaluation of the neuron inferral jobs was requested but no annotation was supplied.
343+
job.inferMitochondria.notAllowed.onlySuperUsers=Currently mitochondria inferral is only allowed for super users.
343344
job.meshFile.notAllowed.organization = Calculating mesh files is only allowed for datasets of your own organization.
344345
job.exportTiff.notAllowed.organization=Exporting tiff files is only allowed for datasets of your own organization.
345346
job.segmentIndexFile.notAllowed.organization = Calculating segment index files is only allowed for datasets of your own organization.
@@ -354,7 +355,6 @@ job.trainModel.notAllowed.organization = Training AI models is only allowed for
354355
job.runInference.notAllowed.organization = Running inference is only allowed for datasets of your own organization.
355356
job.paidJob.notAllowed.noPaidPlan = You are not allowed to run this job because your organization does not have a paid plan.
356357
job.notEnoughCredits = Your organization does not have enough WEBKNOSSOS credits to run this job.
357-
358358
creditTransaction.notPaidPlan = Your organization does not have a paid plan.
359359

360360
voxelytics.disabled = Voxelytics workflow reporting and logging are not enabled for this WEBKNOSSOS instance.

frontend/javascripts/oxalis/view/action-bar/starting_job_modals.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -675,13 +675,23 @@ function useCurrentlySelectedBoundingBox(
675675
): UserBoundingBox | undefined {
676676
const selectedBoundingBoxId = Form.useWatch("boundingBoxId", form);
677677
const currentlySelectedLayerName = Form.useWatch("layerName", form);
678-
const currentSelectedLayer = layers.find((layer) => layer.name === currentlySelectedLayerName);
679-
const indexOfLayer = currentSelectedLayer ? layers.indexOf(currentSelectedLayer) : -1;
680-
return isBoundingBoxConfigurable
681-
? userBoundingBoxes.find((bbox) => bbox.id === selectedBoundingBoxId)
682-
: indexOfLayer >= 0
683-
? defaultBBForLayers[indexOfLayer]
684-
: undefined;
678+
const [currentlySelectedBoundingBox, setCurrentlySelectedBoundingBox] = useState<
679+
UserBoundingBox | undefined
680+
>(undefined);
681+
// userBoundingBoxes, defaultBBForLayers, layers are different objects with each calls,
682+
// but they shouldn't be able to change while the modal is open
683+
// biome-ignore lint/correctness/useExhaustiveDependencies: see above
684+
useEffect(() => {
685+
const currentSelectedLayer = layers.find((layer) => layer.name === currentlySelectedLayerName);
686+
const indexOfLayer = currentSelectedLayer ? layers.indexOf(currentSelectedLayer) : -1;
687+
const newCurrentlySelectedBoundingBox = isBoundingBoxConfigurable
688+
? userBoundingBoxes.find((bbox) => bbox.id === selectedBoundingBoxId)
689+
: indexOfLayer >= 0
690+
? defaultBBForLayers[indexOfLayer]
691+
: undefined;
692+
setCurrentlySelectedBoundingBox(newCurrentlySelectedBoundingBox);
693+
}, [selectedBoundingBoxId, currentlySelectedLayerName, isBoundingBoxConfigurable]);
694+
return currentlySelectedBoundingBox;
685695
}
686696

687697
function StartJobForm(props: StartJobFormProps) {

tools/postgres/schema.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CREATE TABLE webknossos.annotations(
3434
_task TEXT CONSTRAINT _task_objectId CHECK (_task ~ '^[0-9a-f]{24}$'),
3535
_team TEXT CONSTRAINT _team_objectId CHECK (_team ~ '^[0-9a-f]{24}$') NOT NULL,
3636
_user TEXT CONSTRAINT _user_objectId CHECK (_user ~ '^[0-9a-f]{24}$') NOT NULL,
37-
_publication TEXT CONSTRAINT _publication_objectId CHECK (_publication ~ '^[0-9a-f]{24}$'),
37+
_publication TEXT,
3838
description TEXT NOT NULL DEFAULT '',
3939
visibility webknossos.ANNOTATION_VISIBILITY NOT NULL DEFAULT 'Internal',
4040
name TEXT NOT NULL DEFAULT '',
@@ -93,7 +93,7 @@ CREATE TABLE webknossos.meshes(
9393
);
9494

9595
CREATE TABLE webknossos.publications(
96-
_id TEXT CONSTRAINT _id_objectId CHECK (_id ~ '^[0-9a-f]{24}$') PRIMARY KEY,
96+
_id TEXT PRIMARY KEY,
9797
publicationDate TIMESTAMPTZ,
9898
imageUrl TEXT,
9999
title TEXT,
@@ -107,7 +107,7 @@ CREATE TABLE webknossos.datasets(
107107
_id TEXT CONSTRAINT _id_objectId CHECK (_id ~ '^[0-9a-f]{24}$') PRIMARY KEY,
108108
_dataStore TEXT NOT NULL,
109109
_organization TEXT NOT NULL,
110-
_publication TEXT CONSTRAINT _publication_objectId CHECK (_publication ~ '^[0-9a-f]{24}$'),
110+
_publication TEXT,
111111
_uploader TEXT CONSTRAINT _uploader_objectId CHECK (_uploader ~ '^[0-9a-f]{24}$'),
112112
_folder TEXT CONSTRAINT _folder_objectId CHECK (_folder ~ '^[0-9a-f]{24}$') NOT NULL,
113113
inboxSourceHash INT,

0 commit comments

Comments
 (0)