aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/app
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-09-05 11:00:00 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-09-11 11:28:29 +0200
commit71fec25c4056c1dcfe75769c2041b1d56a89a2e5 (patch)
treee640a76709b242652d3cc274a9d0a98f720ae768 /server/sonar-web/src/main/js/app
parent0926670e79d919e0afa3f0a2e11f656bdcd05916 (diff)
downloadsonarqube-71fec25c4056c1dcfe75769c2041b1d56a89a2e5.tar.gz
sonarqube-71fec25c4056c1dcfe75769c2041b1d56a89a2e5.zip
SONAR-9784 rewrite projects management page
Diffstat (limited to 'server/sonar-web/src/main/js/app')
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.js4
-rw-r--r--server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsNav-test.js.snap2
-rw-r--r--server/sonar-web/src/main/js/app/types.ts120
-rw-r--r--server/sonar-web/src/main/js/app/utils/startReactApp.js8
4 files changed, 129 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.js b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.js
index 21540b25a99..903de6c74ea 100644
--- a/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.js
+++ b/server/sonar-web/src/main/js/app/components/nav/settings/SettingsNav.js
@@ -42,7 +42,7 @@ class SettingsNav extends React.PureComponent {
}
isProjectsActive() {
- const urls = ['/projects_admin', '/background_tasks'];
+ const urls = ['/admin/projects_management', '/background_tasks'];
return this.isSomethingActive(urls);
}
@@ -158,7 +158,7 @@ class SettingsNav extends React.PureComponent {
<ul className="dropdown-menu">
{!this.props.customOrganizations &&
<li>
- <IndexLink to="/projects_admin" activeClassName="active">
+ <IndexLink to="/admin/projects_management" activeClassName="active">
Management
</IndexLink>
</li>}
diff --git a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsNav-test.js.snap b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsNav-test.js.snap
index 7f285d4906c..c66d4b28859 100644
--- a/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsNav-test.js.snap
+++ b/server/sonar-web/src/main/js/app/components/nav/settings/__tests__/__snapshots__/SettingsNav-test.js.snap
@@ -154,7 +154,7 @@ exports[`should work with extensions 1`] = `
<li>
<IndexLink
activeClassName="active"
- to="/projects_admin"
+ to="/admin/projects_management"
>
Management
</IndexLink>
diff --git a/server/sonar-web/src/main/js/app/types.ts b/server/sonar-web/src/main/js/app/types.ts
new file mode 100644
index 00000000000..d5ff4713845
--- /dev/null
+++ b/server/sonar-web/src/main/js/app/types.ts
@@ -0,0 +1,120 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+export enum BranchType {
+ LONG = 'LONG',
+ SHORT = 'SHORT'
+}
+
+export interface MainBranch {
+ isMain: true;
+ name: string;
+ status?: {
+ qualityGateStatus: string;
+ };
+}
+
+export interface LongLivingBranch {
+ isMain: false;
+ name: string;
+ status?: {
+ qualityGateStatus: string;
+ };
+ type: BranchType.LONG;
+}
+
+export interface ShortLivingBranch {
+ isMain: false;
+ isOrphan?: true;
+ mergeBranch: string;
+ name: string;
+ status?: {
+ bugs: number;
+ codeSmells: number;
+ vulnerabilities: number;
+ };
+ type: BranchType.SHORT;
+}
+
+export type Branch = MainBranch | LongLivingBranch | ShortLivingBranch;
+
+export interface ComponentExtension {
+ key: string;
+ name: string;
+}
+
+export interface Component {
+ analysisDate?: string;
+ breadcrumbs: Array<{
+ key: string;
+ name: string;
+ qualifier: string;
+ }>;
+ configuration?: ComponentConfiguration;
+ extensions?: ComponentExtension[];
+ isFavorite?: boolean;
+ key: string;
+ name: string;
+ organization: string;
+ path?: string;
+ qualifier: string;
+ refKey?: string;
+ version?: string;
+}
+
+export interface ComponentConfiguration {
+ extensions?: ComponentExtension[];
+ showBackgroundTasks?: boolean;
+ showLinks?: boolean;
+ showManualMeasures?: boolean;
+ showQualityGates?: boolean;
+ showQualityProfiles?: boolean;
+ showPermissions?: boolean;
+ showSettings?: boolean;
+ showUpdateKey?: boolean;
+}
+
+export interface Metric {
+ custom?: boolean;
+ decimalScale?: number;
+ description?: string;
+ direction?: number;
+ domain?: string;
+ hidden?: boolean;
+ key: string;
+ name: string;
+ qualitative?: boolean;
+ type: string;
+}
+
+export interface Organization {
+ adminPages?: Array<{ key: string; name: string }>;
+ avatar?: string;
+ canAdmin?: boolean;
+ canDelete?: boolean;
+ canProvisionProjects?: boolean;
+ canUpdateProjectsVisibilityToPrivate?: boolean;
+ description?: string;
+ isDefault?: boolean;
+ key: string;
+ name: string;
+ pages?: Array<{ key: string; name: string }>;
+ projectVisibility: string;
+ url?: string;
+}
diff --git a/server/sonar-web/src/main/js/app/utils/startReactApp.js b/server/sonar-web/src/main/js/app/utils/startReactApp.js
index cda4a172b5e..910761f150c 100644
--- a/server/sonar-web/src/main/js/app/utils/startReactApp.js
+++ b/server/sonar-web/src/main/js/app/utils/startReactApp.js
@@ -56,7 +56,7 @@ import permissionTemplatesRoutes from '../../apps/permission-templates/routes';
import projectActivityRoutes from '../../apps/projectActivity/routes';
import projectAdminRoutes from '../../apps/project-admin/routes';
import projectsRoutes from '../../apps/projects/routes';
-import projectsAdminRoutes from '../../apps/projects-admin/routes';
+import projectsManagementRoutes from '../../apps/projectsManagement/routes';
import qualityGatesRoutes from '../../apps/quality-gates/routes';
import qualityProfilesRoutes from '../../apps/quality-profiles/routes';
import sessionsRoutes from '../../apps/sessions/routes';
@@ -115,6 +115,7 @@ const startReactApp = () => {
}}
/>
+ <Redirect from="/projects_admin" to="/admin/projects_management" />
<Redirect from="/component/index" to="/component" />
<Redirect from="/component_issues" to="/project/issues" />
<Redirect from="/dashboard/index" to="/dashboard" />
@@ -203,7 +204,10 @@ const startReactApp = () => {
<Route path="groups" childRoutes={groupsRoutes} />
<Route path="metrics" childRoutes={metricsRoutes} />
<Route path="permission_templates" childRoutes={permissionTemplatesRoutes} />
- <Route path="projects_admin" childRoutes={projectsAdminRoutes} />
+ <Route
+ path="admin/projects_management"
+ childRoutes={projectsManagementRoutes}
+ />
<Route path="roles/global" childRoutes={globalPermissionsRoutes} />
<Route path="settings" childRoutes={settingsRoutes} />
<Route path="system" childRoutes={systemRoutes} />