From 57ad9bac963163f00c65c6569f9997a5470853d3 Mon Sep 17 00:00:00 2001 From: guillaume-peoch-sonarsource Date: Mon, 16 Oct 2023 16:24:20 +0200 Subject: [PATCH] SONAR-20720 Update Sort by select on Projects list + url param --- .../create/project/components/NewCodeDefinitionSelection.tsx | 2 +- server/sonar-web/src/main/js/apps/projects/utils.ts | 3 +++ sonar-core/src/main/resources/org/sonar/l10n/core.properties | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/create/project/components/NewCodeDefinitionSelection.tsx b/server/sonar-web/src/main/js/apps/create/project/components/NewCodeDefinitionSelection.tsx index e2d22150707..e49ae22d118 100644 --- a/server/sonar-web/src/main/js/apps/create/project/components/NewCodeDefinitionSelection.tsx +++ b/server/sonar-web/src/main/js/apps/create/project/components/NewCodeDefinitionSelection.tsx @@ -72,7 +72,7 @@ export default function NewCodeDefinitionSelection(props: Props) { } else { navigate({ pathname: '/projects', - search: queryToSearch({ recent: true }), + search: queryToSearch({ sort: '-creation_date' }), }); } }, [data, projectCount, mutateCount, reset, intl, navigate]); diff --git a/server/sonar-web/src/main/js/apps/projects/utils.ts b/server/sonar-web/src/main/js/apps/projects/utils.ts index 219a4ab0808..439365374a3 100644 --- a/server/sonar-web/src/main/js/apps/projects/utils.ts +++ b/server/sonar-web/src/main/js/apps/projects/utils.ts @@ -40,6 +40,7 @@ export const PROJECTS_ALL = 'all'; export const SORTING_METRICS: SortingOption[] = [ { value: 'name' }, { value: 'analysis_date' }, + { value: 'creation_date' }, { value: 'reliability' }, { value: 'security' }, { value: 'security_review' }, @@ -52,6 +53,7 @@ export const SORTING_METRICS: SortingOption[] = [ export const SORTING_LEAK_METRICS: SortingOption[] = [ { value: 'name' }, { value: 'analysis_date' }, + { value: 'creation_date' }, { value: 'new_reliability', class: 'projects-leak-sorting-option' }, { value: 'new_security', class: 'projects-leak-sorting-option' }, { value: 'new_security_review', class: 'projects-leak-sorting-option' }, @@ -303,6 +305,7 @@ const propertyToMetricMap: Dict = { tags: 'tags', search: 'query', qualifier: 'qualifier', + creation_date: 'creationDate', }; const metricToPropertyMap = invert(propertyToMetricMap); diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 09b12b70209..463c1e7b682 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -1230,6 +1230,7 @@ projects.sort_descending=Result sorted in descending order projects.sorting.default=default projects.sorting.name=Name projects.sorting.analysis_date=Last analysis date +projects.sorting.creation_date=Creation date projects.sorting.reliability=Reliability projects.sorting.security=Security projects.sorting.security_review=Security Review @@ -4197,7 +4198,6 @@ onboarding.create_project.new_code_definition.title=Set up project for Clean as onboarding.create_x_project.new_code_definition.title=Set up {count, plural, one {project} other {# projects}} for Clean as You Code onboarding.create_project.new_code_definition.description=The new code definition sets which part of your code will be considered new code. This helps you focus attention on the most recent changes to your project, enabling you to follow the Clean as You Code methodology. Learn more: {link} onboarding.create_project.new_code_definition.description.link=Defining New Code -onboarding.create_project.new_code_definition.create_project=Create project onboarding.create_project.new_code_definition.create_x_projects=Create {count, plural, one {project} other {# projects}} onboarding.create_projects.new_code_definition.change_info=You can change this for each project individually at any time in the project administration. onboarding.create_project.success=Your {count, plural, one {project has} other {# projects have}} been created. -- 2.39.5