Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ and this project adheres to

### Fixed

- Allow special characters and non-Latin scripts in workflow step names
[#4577](https://github.com/OpenFn/lightning/issues/4577)
- Consider manual runs for "next cron run input" via the
`last_run_final_dataclip` function
[#4584](https://github.com/OpenFn/lightning/issues/4584)
Expand Down
1 change: 0 additions & 1 deletion assets/js/collaborative-editor/types/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const JobSchema = z
.string()
.min(1, "Job name can't be blank")
.max(100, "Job name shouldn't be longer than 100 characters.")
.regex(/^[a-zA-Z0-9_\- ]*$/, "Job name can't include special characters.")
.transform(val => val.trim()), // Auto-trim whitespace like backend
body: z.string().min(1, "can't be blank"),
adaptor: adaptorSchema.default('@openfn/language-common@latest'),
Expand Down
9 changes: 0 additions & 9 deletions assets/js/workflow-diagram/nodes/PlaceholderJob.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,6 @@ const PlaceholderJobNode = ({ id, data, selected }: NodeProps<NodeData>) => {
};
}

const regex = /^[a-zA-Z0-9_\- ]*$/;
if (!regex.test(name)) {
return {
isValid: false,
message:
'Name can only contain alphanumeric characters, underscores, dashes, and spaces.',
};
}

return {
isValid: true,
message: 'Valid name.',
Expand Down
3 changes: 0 additions & 3 deletions lib/lightning/workflows/job.ex
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ defmodule Lightning.Workflows.Job do
max: 100,
message: "job name should be at most %{count} character(s)"
)
|> validate_format(:name, ~r/^[a-zA-Z0-9_\- ]*$/,
message: "job name has invalid format"
)
end

defp validate_keychain_credential_project_membership(changeset) do
Expand Down
6 changes: 3 additions & 3 deletions test/lightning/workflows/job_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ defmodule Lightning.Workflows.JobTest do
assert errors[:name] == ["job name should be at most 100 character(s)"]
end

test "name can't contain non url-safe chars" do
["My project @ OpenFn", "Can't have a / slash"]
test "name accepts special characters and non-latin scripts" do
["My project @ OpenFn", "Can't have a / slash", "حساب", "étape 1"]
|> Enum.each(fn name ->
errors = Job.changeset(%Job{}, %{name: name}) |> errors_on()
assert errors[:name] == ["job name has invalid format"]
refute errors[:name]
end)
end

Expand Down