OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Simplify generation logic
Klaus Zanders81bc35da8e09
diff --git a/modules/github_integration/frontend/module/git-actions/git-actions.service.ts b/modules/github_integration/frontend/module/git-actions/git-actions.service.tsindex 980b5958bd5..7744deddde1 100644--- a/modules/github_integration/frontend/module/git-actions/git-actions.service.ts+++ b/modules/github_integration/frontend/module/git-actions/git-actions.service.ts@@ -37,11 +37,9 @@ export class GitActionsService {// This sanitization tries to be harsher than those rulesreturn str.replace(/&/g, "and ") // & becomes and- .replace(/ +/g, "-") // Spaces become dashes- .replace(/[^\w\-]+/g, "") // Remove any non ascii characters as they might make trouble in some tools- .replace(/^[-]+/g, "") // Dashes at the start are removed- .replace(/[-]+$/g, "") // Dashes at the end are removed- .replace(/-+/g, "-") // Multiple dashes in a row are deduped+ .replace(/\W+/g, "-") // Replace any consecutive non ascii characters by a single dash as they might make trouble in some tools.+ .replace(/^-/g, "") // Dash at the start is removed+ .replace(/-$/g, "") // Dash at the end is removed.trim();}diff --git a/modules/gitlab_integration/frontend/module/git-actions/git-actions.service.ts b/modules/gitlab_integration/frontend/module/git-actions/git-actions.service.tsindex 63e612ebc2b..7332dd6b7c8 100644--- a/modules/gitlab_integration/frontend/module/git-actions/git-actions.service.ts+++ b/modules/gitlab_integration/frontend/module/git-actions/git-actions.service.ts@@ -40,11 +40,9 @@ export class GitActionsService {// This sanitization tries to be harsher than those rulesreturn str.replace(/&/g, "and ") // & becomes and- .replace(/ +/g, "-") // Spaces become dashes- .replace(/[^\w\-]+/g, "") // Remove any non ascii characters as they might make trouble in some tools- .replace(/^[-]+/g, "") // Dashes at the start are removed- .replace(/[-]+$/g, "") // Dashes at the end are removed- .replace(/-+/g, "-") // Multiple dashes in a row are deduped+ .replace(/\W+/g, "-") // Replace any consecutive non ascii characters by a single dash as they might make trouble in some tools.+ .replace(/^-/g, "") // Dash at the start is removed+ .replace(/-$/g, "") // Dash at the end is removed.trim();}