You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GlobalFooter.tsx 3.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2024 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. import * as React from 'react';
  21. import DocLink from '../../components/common/DocLink';
  22. import InstanceMessage from '../../components/common/InstanceMessage';
  23. import Link from '../../components/common/Link';
  24. import AppVersionStatus from '../../components/shared/AppVersionStatus';
  25. import { Alert } from '../../components/ui/Alert';
  26. import { getEdition } from '../../helpers/editions';
  27. import { translate } from '../../helpers/l10n';
  28. import { AppState } from '../../types/appstate';
  29. import GlobalFooterBranding from './GlobalFooterBranding';
  30. import withAppStateContext from './app-state/withAppStateContext';
  31. export interface GlobalFooterProps {
  32. hideLoggedInInfo?: boolean;
  33. appState?: AppState;
  34. }
  35. export function GlobalFooter({ hideLoggedInInfo, appState }: GlobalFooterProps) {
  36. const currentEdition = appState?.edition && getEdition(appState.edition);
  37. return (
  38. <div className="page-footer page-container" id="footer">
  39. {appState?.productionDatabase === false && (
  40. <Alert display="inline" id="evaluation_warning" variant="warning">
  41. <p className="big">{translate('footer.production_database_warning')}</p>
  42. <p>
  43. <InstanceMessage message={translate('footer.production_database_explanation')} />
  44. </p>
  45. </Alert>
  46. )}
  47. <GlobalFooterBranding />
  48. <ul className="page-footer-menu">
  49. {!hideLoggedInInfo && currentEdition && (
  50. <li className="page-footer-menu-item">{currentEdition.name}</li>
  51. )}
  52. {!hideLoggedInInfo && appState?.version && (
  53. <li className="page-footer-menu-item">
  54. <AppVersionStatus />
  55. </li>
  56. )}
  57. <li className="page-footer-menu-item">
  58. <Link
  59. to="https://www.gnu.org/licenses/lgpl-3.0.txt"
  60. rel="noopener noreferrer"
  61. target="_blank"
  62. >
  63. {translate('footer.license')}
  64. </Link>
  65. </li>
  66. <li className="page-footer-menu-item">
  67. <Link
  68. to="https://community.sonarsource.com/c/help/sq"
  69. rel="noopener noreferrer"
  70. target="_blank"
  71. >
  72. {translate('footer.community')}
  73. </Link>
  74. </li>
  75. <li className="page-footer-menu-item">
  76. <DocLink to="/">{translate('footer.documentation')}</DocLink>
  77. </li>
  78. <li className="page-footer-menu-item">
  79. <DocLink to="/instance-administration/plugin-version-matrix/">
  80. {translate('footer.plugins')}
  81. </DocLink>
  82. </li>
  83. {!hideLoggedInInfo && (
  84. <li className="page-footer-menu-item">
  85. <Link to="/web_api">{translate('footer.web_api')}</Link>
  86. </li>
  87. )}
  88. </ul>
  89. </div>
  90. );
  91. }
  92. export default withAppStateContext(GlobalFooter);