;
})();
-export const darkenedColours = {
- ...colours,
+export const darkenedColors = {
+ ...colors,
turquoise: "#00a6c0" as const,
lime: "#5eae00" as const,
yellow: "#e9ad00" as const,
diff --git a/client/src/components/Workflow/Editor/Tools/ToolBar.vue b/client/src/components/Workflow/Editor/Tools/ToolBar.vue
index e95c25f8aaae..8d63f9442d7b 100644
--- a/client/src/components/Workflow/Editor/Tools/ToolBar.vue
+++ b/client/src/components/Workflow/Editor/Tools/ToolBar.vue
@@ -14,7 +14,7 @@ import { match } from "@/utils/utils";
import { useToolLogic } from "./useToolLogic";
-import ColourSelector from "@/components/Workflow/Editor/Comments/ColourSelector.vue";
+import ColorSelector from "@/components/Workflow/Editor/Comments/ColorSelector.vue";
library.add(faMagnet, faMousePointer, faObjectGroup, faMarkdown, faPen, faEraser);
@@ -226,10 +226,10 @@ whenever(ctrl_7!, () => (toolbarStore.currentTool = "freehandEraser"));
- (commentOptions.colour = colour)" />
+ (commentOptions.color = color)" />
@@ -390,7 +390,7 @@ whenever(ctrl_7!, () => (toolbarStore.currentTool = "freehandEraser"));
justify-content: space-between;
}
-.colour-selector {
+.color-selector {
position: relative;
}
diff --git a/client/src/components/Workflow/Editor/Tools/useToolLogic.ts b/client/src/components/Workflow/Editor/Tools/useToolLogic.ts
index af7a84d4d4c2..022dfdb8201e 100644
--- a/client/src/components/Workflow/Editor/Tools/useToolLogic.ts
+++ b/client/src/components/Workflow/Editor/Tools/useToolLogic.ts
@@ -37,7 +37,7 @@ export function useToolLogic(toolbarStore: WorkflowEditorToolbarStore, commentSt
id: commentStore.highestCommentId + 1,
position: start,
size: [0, 0] as [number, number],
- colour: commentOptions.colour,
+ color: commentOptions.color,
};
comment = match(toolbarStore.currentTool, {
diff --git a/client/src/components/Workflow/Editor/modules/canvasDraw.ts b/client/src/components/Workflow/Editor/modules/canvasDraw.ts
index fe62c1dc63e7..9a3f26be6cf6 100644
--- a/client/src/components/Workflow/Editor/modules/canvasDraw.ts
+++ b/client/src/components/Workflow/Editor/modules/canvasDraw.ts
@@ -1,6 +1,6 @@
import { curveCatmullRom, line } from "d3";
-import * as commentColours from "@/components/Workflow/Editor/Comments/colours";
+import * as commentColors from "@/components/Workflow/Editor/Comments/colors";
import type {
FrameWorkflowComment,
FreehandWorkflowComment,
@@ -14,21 +14,21 @@ export function drawBoxComments(
ctx: CanvasRenderingContext2D,
comments: FrameWorkflowComment[] | TextWorkflowComment[] | MarkdownWorkflowComment[],
lineWidth: number,
- defaultColour: string,
- colourFill = false
+ defaultColor: string,
+ colorFill = false
) {
ctx.lineWidth = lineWidth;
- if (colourFill) {
+ if (colorFill) {
comments.forEach((comment) => {
ctx.beginPath();
- if (comment.colour !== "none") {
- ctx.fillStyle = commentColours.brighterColours[comment.colour];
- ctx.strokeStyle = commentColours.colours[comment.colour];
+ if (comment.color !== "none") {
+ ctx.fillStyle = commentColors.brighterColors[comment.color];
+ ctx.strokeStyle = commentColors.colors[comment.color];
} else {
ctx.fillStyle = "rgba(0, 0, 0, 0)";
- ctx.strokeStyle = defaultColour;
+ ctx.strokeStyle = defaultColor;
}
ctx.rect(comment.position[0], comment.position[1], comment.size[0], comment.size[1]);
@@ -39,10 +39,10 @@ export function drawBoxComments(
comments.forEach((comment) => {
ctx.beginPath();
- if (comment.colour !== "none") {
- ctx.strokeStyle = commentColours.colours[comment.colour];
+ if (comment.color !== "none") {
+ ctx.strokeStyle = commentColors.colors[comment.color];
} else {
- ctx.strokeStyle = defaultColour;
+ ctx.strokeStyle = defaultColor;
}
ctx.rect(comment.position[0], comment.position[1], comment.size[0], comment.size[1]);
@@ -55,11 +55,11 @@ export function drawBoxComments(
export function drawSteps(
ctx: CanvasRenderingContext2D,
steps: Step[],
- colour: string,
+ color: string,
stateStore: ReturnType
) {
ctx.beginPath();
- ctx.fillStyle = colour;
+ ctx.fillStyle = color;
steps.forEach((step) => {
const rect = stateStore.stepPosition[step.id];
@@ -73,15 +73,15 @@ export function drawSteps(
export function drawFreehandComments(
ctx: CanvasRenderingContext2D,
comments: FreehandWorkflowComment[],
- defaultColour: string
+ defaultColor: string
) {
const catmullRom = line().curve(curveCatmullRom).context(ctx);
comments.forEach((comment) => {
- if (comment.colour === "none") {
- ctx.strokeStyle = defaultColour;
+ if (comment.color === "none") {
+ ctx.strokeStyle = defaultColor;
} else {
- ctx.strokeStyle = commentColours.colours[comment.colour];
+ ctx.strokeStyle = commentColors.colors[comment.color];
}
ctx.lineWidth = comment.data.thickness;
diff --git a/client/src/stores/workflowEditorCommentStore.test.ts b/client/src/stores/workflowEditorCommentStore.test.ts
index ad433b494e73..20d1ffdd95fe 100644
--- a/client/src/stores/workflowEditorCommentStore.test.ts
+++ b/client/src/stores/workflowEditorCommentStore.test.ts
@@ -10,7 +10,7 @@ import {
const freehandComment: FreehandWorkflowComment = {
type: "freehand",
- colour: "none",
+ color: "none",
data: {
thickness: 10,
line: [[100, 100]],
@@ -22,7 +22,7 @@ const freehandComment: FreehandWorkflowComment = {
const textComment: TextWorkflowComment = {
type: "text",
- colour: "none",
+ color: "none",
data: {
size: 1,
text: "Hello World",
@@ -34,7 +34,7 @@ const textComment: TextWorkflowComment = {
const markdownComment: MarkdownWorkflowComment = {
type: "markdown",
- colour: "none",
+ color: "none",
data: {
text: "# Hello World",
},
@@ -45,7 +45,7 @@ const markdownComment: MarkdownWorkflowComment = {
const frameComment: FrameWorkflowComment = {
type: "frame",
- colour: "none",
+ color: "none",
data: {
title: "My Frame",
},
@@ -56,7 +56,7 @@ const frameComment: FrameWorkflowComment = {
const frameCommentTwo: FrameWorkflowComment = {
type: "frame",
- colour: "none",
+ color: "none",
data: {
title: "My Frame",
},
@@ -143,13 +143,13 @@ describe("workflowEditorCommentStore", () => {
it("does not mutate input data", () => {
const commentStore = useWorkflowCommentStore("mock-id");
- const comment: TextWorkflowComment = { ...textComment, id: 0, colour: "pink" };
+ const comment: TextWorkflowComment = { ...textComment, id: 0, color: "pink" };
commentStore.addComments([comment]);
- commentStore.changeColour(0, "blue");
+ commentStore.changeColor(0, "blue");
- expect(commentStore.comments[0]?.colour).toBe("blue");
- expect(comment.colour).toBe("pink");
+ expect(commentStore.comments[0]?.color).toBe("blue");
+ expect(comment.color).toBe("pink");
});
it("implements reset", () => {
diff --git a/client/src/stores/workflowEditorCommentStore.ts b/client/src/stores/workflowEditorCommentStore.ts
index a88c184ca9a1..261887e66e76 100644
--- a/client/src/stores/workflowEditorCommentStore.ts
+++ b/client/src/stores/workflowEditorCommentStore.ts
@@ -1,7 +1,7 @@
import { defineStore } from "pinia";
import { computed, del, ref, set } from "vue";
-import type { Colour } from "@/components/Workflow/Editor/Comments/colours";
+import type { Color } from "@/components/Workflow/Editor/Comments/colors";
import {
AxisAlignedBoundingBox,
type Rectangle,
@@ -18,12 +18,12 @@ import { hasKeys, match } from "@/utils/utils";
import { useWorkflowStateStore } from "./workflowEditorStateStore";
import { Step, useWorkflowStepStore } from "./workflowStepStore";
-export type WorkflowCommentColour = Colour | "none";
+export type WorkflowCommentColor = Color | "none";
export interface BaseWorkflowComment {
id: number;
type: string;
- colour: WorkflowCommentColour;
+ color: WorkflowCommentColor;
position: [number, number];
size: [number, number];
data: unknown;
@@ -139,9 +139,9 @@ export const useWorkflowCommentStore = (workflowId: string) => {
set(comment, "data", data);
}
- function changeColour(id: number, colour: WorkflowCommentColour) {
+ function changeColor(id: number, color: WorkflowCommentColor) {
const comment = getComment.value(id);
- set(comment, "colour", colour);
+ set(comment, "color", color);
}
function addPoint(id: number, point: [number, number]) {
@@ -294,7 +294,7 @@ export const useWorkflowCommentStore = (workflowId: string) => {
changePosition,
changeSize,
changeData,
- changeColour,
+ changeColor,
addPoint,
deleteComment,
createComment,
diff --git a/client/src/stores/workflowEditorToolbarStore.ts b/client/src/stores/workflowEditorToolbarStore.ts
index 5b51506e538b..4743fc304683 100644
--- a/client/src/stores/workflowEditorToolbarStore.ts
+++ b/client/src/stores/workflowEditorToolbarStore.ts
@@ -4,7 +4,7 @@ import { computed, onScopeDispose, reactive, ref, watch } from "vue";
import { useUserLocalStorage } from "@/composables/userLocalStorage";
-import { WorkflowCommentColour } from "./workflowEditorCommentStore";
+import { WorkflowCommentColor } from "./workflowEditorCommentStore";
export type CommentTool = "textComment" | "markdownComment" | "frameComment" | "freehandComment" | "freehandEraser";
export type EditorTool = "pointer" | CommentTool;
@@ -38,7 +38,7 @@ export const useWorkflowEditorToolbarStore = (workflowId: string) => {
const commentOptions = reactive({
bold: false,
italic: false,
- colour: "none" as WorkflowCommentColour,
+ color: "none" as WorkflowCommentColor,
textSize: 2,
lineThickness: 5,
smoothing: 2,
diff --git a/client/src/utils/navigation/navigation.yml b/client/src/utils/navigation/navigation.yml
index fc90bd332e07..59134f93b4f0 100644
--- a/client/src/utils/navigation/navigation.yml
+++ b/client/src/utils/navigation/navigation.yml
@@ -690,7 +690,7 @@ workflow_editor:
snapping_distance: "[data-option='snapping-distance']"
toggle_bold: "[data-option='toggle-bold']"
toggle_italic: "[data-option='toggle-italic']"
- colour: ".colour-selector [data-colour='${colour}']"
+ color: ".color-selector [data-color='${color}']"
font_size: "[data-option='font-size']"
line_thickness: "[data-option='line-thickness']"
smoothing: "[data-option='smoothing']"
diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py
index 3e6280c5ad79..2b8521db0e01 100644
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -7987,7 +7987,7 @@ class WorkflowComment(Base, RepresentById):
position = Column(MutableJSONType)
size = Column(JSONType)
type = Column(String(16))
- colour = Column(String(16))
+ color = Column(String(16))
data = Column(JSONType)
parent_comment_id = Column(Integer, ForeignKey("workflow_comment.id"), nullable=True)
@@ -8022,7 +8022,7 @@ def to_dict(self):
"position": self.position,
"size": self.size,
"type": self.type,
- "colour": self.colour,
+ "color": self.color,
"data": self.data,
}
@@ -8044,7 +8044,7 @@ def from_dict(dict):
comment.type = dict.get("type", "text")
comment.position = dict.get("position", None)
comment.size = dict.get("size", None)
- comment.colour = dict.get("colour", "none")
+ comment.color = dict.get("color", "none")
comment.data = dict.get("data", None)
return comment
diff --git a/lib/galaxy/model/migrations/alembic/versions_gxy/ddbdbc40bdc1_add_workflow_comment_table.py b/lib/galaxy/model/migrations/alembic/versions_gxy/ddbdbc40bdc1_add_workflow_comment_table.py
index 1b297478eac5..59e1e58f9960 100644
--- a/lib/galaxy/model/migrations/alembic/versions_gxy/ddbdbc40bdc1_add_workflow_comment_table.py
+++ b/lib/galaxy/model/migrations/alembic/versions_gxy/ddbdbc40bdc1_add_workflow_comment_table.py
@@ -39,7 +39,7 @@ def upgrade():
sa.Column("position", MutableJSONType),
sa.Column("size", JSONType),
sa.Column("type", sa.String(16)),
- sa.Column("colour", sa.String(16)),
+ sa.Column("color", sa.String(16)),
sa.Column("data", JSONType),
sa.Column(PARENT_COMMENT_COLUMN_NAME, sa.Integer, sa.ForeignKey("workflow_comment.id"), nullable=True),
)
diff --git a/lib/galaxy/schema/workflow/comments.py b/lib/galaxy/schema/workflow/comments.py
index 3e270ace9ed2..89e526bd516c 100644
--- a/lib/galaxy/schema/workflow/comments.py
+++ b/lib/galaxy/schema/workflow/comments.py
@@ -14,8 +14,8 @@
class BaseComment(BaseModel):
id: int = Field(..., description="Unique identifier for this comment. Determined by the comments order")
- colour: Literal["none", "black", "blue", "turquoise", "green", "lime", "orange", "yellow", "red", "pink"] = Field(
- ..., description="Colour this comment is displayed as. The exact colour hex is determined by the client"
+ color: Literal["none", "black", "blue", "turquoise", "green", "lime", "orange", "yellow", "red", "pink"] = Field(
+ ..., description="Color this comment is displayed as. The exact color hex is determined by the client"
)
position: Tuple[float, float] = Field(..., description="[x, y] position of this comment in the Workflow")
size: Tuple[float, float] = Field(..., description="[width, height] size of this comment")