+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2018 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.
- */
-// @flow
-import React from 'react';
-import Modal from '../../../../components/controls/Modal';
-import { translate, translateWithParameters } from '../../../../helpers/l10n';
-import { Button, ResetButtonLink } from '../../../../components/ui/buttons';
-
-/*::
-type Props = {
- component: {
- name: string,
- qualifier: string
- },
- onClose: () => void,
- onConfirm: () => void
-};
-*/
-
-export default class PublicProjectDisclaimer extends React.PureComponent {
- /*:: props: Props; */
-
- handleConfirmClick = () => {
- this.props.onConfirm();
- this.props.onClose();
- };
-
- render() {
- const { qualifier } = this.props.component;
-
- return (
- <Modal contentLabel="modal form" onRequestClose={this.props.onClose}>
- <header className="modal-head">
- <h2>
- {translateWithParameters('projects_role.turn_x_to_public', this.props.component.name)}
- </h2>
- </header>
-
- <div className="modal-body">
- <p>{translate('projects_role.are_you_sure_to_turn_project_to_public', qualifier)}</p>
- <p className="spacer-top">
- {translate('projects_role.are_you_sure_to_turn_project_to_public.2', qualifier)}
- </p>
- </div>
-
- <footer className="modal-foot">
- <Button id="confirm-turn-to-public" onClick={this.handleConfirmClick}>
- {translate('projects_role.turn_project_to_public', qualifier)}
- </Button>
- <ResetButtonLink onClick={this.props.onClose}>{translate('cancel')}</ResetButtonLink>
- </footer>
- </Modal>
- );
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 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 ConfirmModal from '../../../../components/controls/ConfirmModal';
+import { translate, translateWithParameters } from '../../../../helpers/l10n';
+
+interface Props {
+ component: {
+ name: string;
+ qualifier: string;
+ };
+ onClose: () => void;
+ onConfirm: () => void;
+}
+
+export default function PublicProjectDisclaimer({ component, onClose, onConfirm }: Props) {
+ const { qualifier } = component;
+ return (
+ <ConfirmModal
+ confirmButtonText={translate('projects_role.turn_project_to_public', qualifier)}
+ header={translateWithParameters('projects_role.turn_x_to_public', component.name)}
+ onClose={onClose}
+ onConfirm={onConfirm}>
+ <div className="alert alert-warning modal-alert">
+ {translate('projects_role.are_you_sure_to_turn_project_to_public.warning', qualifier)}
+ </div>
+ <p>{translate('projects_role.are_you_sure_to_turn_project_to_public', qualifier)}</p>
+ </ConfirmModal>
+ );
+}
projects_role.turn_project_to_public.VW=Turn Portfolio to Public
projects_role.turn_project_to_public.APP=Turn Application to Public
projects_role.are_you_sure_to_turn_project_to_public.TRK=Are you sure you want to turn your project to public?
-projects_role.are_you_sure_to_turn_project_to_public.2.TRK=Everybody will be able to browse and see the source code of your project.
+projects_role.are_you_sure_to_turn_project_to_public.warning.TRK=Everybody will be able to browse and see the source code of your project.
projects_role.are_you_sure_to_turn_project_to_public.VW=Are you sure you want to turn your portfolio to public?
-projects_role.are_you_sure_to_turn_project_to_public.2.VW=Everybody will be able to browse it.
+projects_role.are_you_sure_to_turn_project_to_public.warning.VW=Everybody will be able to browse it.
projects_role.are_you_sure_to_turn_project_to_public.APP=Are you sure you want to turn your application to public?
-projects_role.are_you_sure_to_turn_project_to_public.2.APP=Everybody will be able to browse it.
+projects_role.are_you_sure_to_turn_project_to_public.warning.APP=Everybody will be able to browse it.
projects_role.public_projects_warning=This permission is always granted by default to everybody (anonymous and authenticated users) for public projects. Therefore, the selection made on this page will be applied to private projects only.