diff options
Diffstat (limited to 'server/sonar-web/src/main/js/app')
6 files changed, 181 insertions, 28 deletions
diff --git a/server/sonar-web/src/main/js/app/components/AccountDeleted.tsx b/server/sonar-web/src/main/js/app/components/AccountDeleted.tsx new file mode 100644 index 00000000000..d91059bf630 --- /dev/null +++ b/server/sonar-web/src/main/js/app/components/AccountDeleted.tsx @@ -0,0 +1,53 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 SonarSource SA + * mailto:info 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. + */ + +import * as React from 'react'; +import { FormattedMessage } from 'react-intl'; +import { Link } from 'react-router'; +import { Alert } from 'sonar-ui-common/components/ui/Alert'; +import { translate } from 'sonar-ui-common/helpers/l10n'; + +export default function AccountDeleted() { + return ( + <div className="page-wrapper-simple display-flex-column"> + <Alert className="huge-spacer-bottom" variant="success"> + {translate('my_profile.delete_account.success')} + </Alert> + + <div className="page-simple text-center"> + <p className="big-spacer-bottom"> + <h1>{translate('my_profile.delete_account.feedback.reason.explanation')}</h1> + </p> + <p className="spacer-bottom"> + <FormattedMessage + defaultMessage={translate('my_profile.delete_account.feedback.call_to_action')} + id="my_profile.delete_account.feedback.call_to_action" + values={{ + link: <Link to="/about/contact">{translate('footer.contact_us')}</Link> + }} + /> + </p> + <p> + <Link to="/">{translate('go_back_to_homepage')}</Link> + </p> + </div> + </div> + ); +} diff --git a/server/sonar-web/src/main/js/app/components/__tests__/AccountDeleted-test.tsx b/server/sonar-web/src/main/js/app/components/__tests__/AccountDeleted-test.tsx new file mode 100644 index 00000000000..911ce7ae432 --- /dev/null +++ b/server/sonar-web/src/main/js/app/components/__tests__/AccountDeleted-test.tsx @@ -0,0 +1,27 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 SonarSource SA + * mailto:info 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. + */ + +import * as React from 'react'; +import { shallow } from 'enzyme'; +import AccountDeleted from '../AccountDeleted'; + +it('should render correctly', () => { + expect(shallow(<AccountDeleted />)).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AccountDeleted-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AccountDeleted-test.tsx.snap new file mode 100644 index 00000000000..8bffcc4ae6e --- /dev/null +++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/AccountDeleted-test.tsx.snap @@ -0,0 +1,53 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +<div + className="page-wrapper-simple display-flex-column" +> + <Alert + className="huge-spacer-bottom" + variant="success" + > + my_profile.delete_account.success + </Alert> + <div + className="page-simple text-center" + > + <p + className="big-spacer-bottom" + > + <h1> + my_profile.delete_account.feedback.reason.explanation + </h1> + </p> + <p + className="spacer-bottom" + > + <FormattedMessage + defaultMessage="my_profile.delete_account.feedback.call_to_action" + id="my_profile.delete_account.feedback.call_to_action" + values={ + Object { + "link": <Link + onlyActiveOnIndex={false} + style={Object {}} + to="/about/contact" + > + footer.contact_us + </Link>, + } + } + /> + </p> + <p> + <Link + onlyActiveOnIndex={false} + style={Object {}} + to="/" + > + go_back_to_homepage + </Link> + </p> + </div> +</div> +`; diff --git a/server/sonar-web/src/main/js/app/styles/init/lists.css b/server/sonar-web/src/main/js/app/styles/init/lists.css index 42d19d67d32..fe2e6c9cd52 100644 --- a/server/sonar-web/src/main/js/app/styles/init/lists.css +++ b/server/sonar-web/src/main/js/app/styles/init/lists.css @@ -28,6 +28,10 @@ ul { padding-left: 40px; } +.list-styled.no-padding { + padding-left: calc(var(--gridSize) * 2); +} + ul.list-styled { list-style: disc; } diff --git a/server/sonar-web/src/main/js/app/types.d.ts b/server/sonar-web/src/main/js/app/types.d.ts index f1f0bc2e88b..415a5f2e276 100644 --- a/server/sonar-web/src/main/js/app/types.d.ts +++ b/server/sonar-web/src/main/js/app/types.d.ts @@ -239,12 +239,7 @@ declare namespace T { }; projectKey: string; pending?: boolean; - user: { - active?: boolean; - email?: string; - login: string; - name: string; - }; + user: T.UserBase; value: string; updatedAt?: string; } @@ -333,7 +328,7 @@ declare namespace T { export interface Issue { actions: string[]; assignee?: string; - assigneeActive?: string; + assigneeActive?: boolean; assigneeAvatar?: string; assigneeLogin?: string; assigneeName?: string; @@ -374,6 +369,21 @@ declare namespace T { type: T.IssueType; } + export interface IssueChangelog { + avatar?: string; + creationDate: string; + diffs: IssueChangelogDiff[]; + user: string; + isUserActive: boolean; + userName: string; + } + + export interface IssueChangelogDiff { + key: string; + newValue?: string; + oldValue?: string; + } + export interface IssueComment { author?: string; authorActive?: boolean; @@ -423,17 +433,14 @@ declare namespace T { open?: boolean; } - export interface LoggedInUser extends CurrentUser { - avatar?: string; - email?: string; + export interface LoggedInUser extends CurrentUser, UserActive { externalIdentity?: string; externalProvider?: string; groups: string[]; homepage?: HomePage; isLoggedIn: true; local?: boolean; - login: string; - name: string; + personalOrganization?: string; scmAccounts: string[]; settings?: CurrentUserSetting[]; } @@ -527,10 +534,7 @@ declare namespace T { url?: string; } - export interface OrganizationMember { - login: string; - name: string; - avatar?: string; + export interface OrganizationMember extends UserActive { groupCount?: number; } @@ -590,11 +594,7 @@ declare namespace T { permissions: string[]; } - export interface PermissionUser { - avatar?: string; - email?: string; - login: string; - name: string; + export interface PermissionUser extends UserActive { permissions: string[]; } @@ -987,21 +987,33 @@ declare namespace T { endOffset: number; } - export interface User { - active: boolean; - avatar?: string; - email?: string; + export interface User extends UserBase { externalIdentity?: string; externalProvider?: string; groups?: string[]; lastConnectionDate?: string; local: boolean; - login: string; - name: string; scmAccounts?: string[]; tokensCount?: number; } + export interface UserActive extends UserBase { + active?: true; + name: string; + } + + export interface UserBase { + active?: boolean; + avatar?: string; + email?: string; + login: string; + name?: string; + } + + export interface UserSelected extends UserActive { + selected: boolean; + } + export interface UserToken { name: string; createdAt: string; diff --git a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx index 714cba17a37..6560bb4bef2 100644 --- a/server/sonar-web/src/main/js/app/utils/startReactApp.tsx +++ b/server/sonar-web/src/main/js/app/utils/startReactApp.tsx @@ -20,7 +20,7 @@ /* eslint-disable react/jsx-sort-props */ import * as React from 'react'; import { render } from 'react-dom'; -import { Router, Route, IndexRoute, Redirect, RouteProps, RouteConfig } from 'react-router'; +import { IndexRoute, Redirect, Route, RouteConfig, RouteProps, Router } from 'react-router'; import { Provider } from 'react-redux'; import { IntlProvider } from 'react-intl'; import { Location } from 'history'; @@ -202,6 +202,10 @@ export default function startReactApp( import('../../apps/feedback/downgrade/DowngradeFeedback') )} /> + <Route + path="account-deleted" + component={lazyLoad(() => import('../components/AccountDeleted'))} + /> </> )} <RouteWithChildRoutes path="organizations" childRoutes={organizationsRoutes} /> |