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.

PageUnavailableDueToIndexation.tsx 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2023 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 { FlagMessage, Link } from 'design-system';
  21. import * as React from 'react';
  22. import { FormattedMessage } from 'react-intl';
  23. import withIndexationContext, {
  24. WithIndexationContextProps,
  25. } from '../../../components/hoc/withIndexationContext';
  26. import { translate } from '../../../helpers/l10n';
  27. export class PageUnavailableDueToIndexation extends React.PureComponent<WithIndexationContextProps> {
  28. componentDidUpdate() {
  29. if (
  30. this.props.indexationContext.status.isCompleted &&
  31. !this.props.indexationContext.status.hasFailures
  32. ) {
  33. window.location.reload();
  34. }
  35. }
  36. render() {
  37. return (
  38. <div className="page-wrapper-simple">
  39. <FlagMessage className="sw-m-10" variant="info">
  40. <span className="sw-w-[290px]">
  41. {translate('indexation.page_unavailable.description')}
  42. <span className="sw-ml-1">
  43. <FormattedMessage
  44. defaultMessage={translate(
  45. 'indexation.page_unavailable.description.additional_information'
  46. )}
  47. id="indexation.page_unavailable.description.additional_information"
  48. values={{
  49. link: (
  50. <Link to="https://docs.sonarsource.com/sonarqube/latest/instance-administration/reindexing/">
  51. {translate('learn_more')}
  52. </Link>
  53. ),
  54. }}
  55. />
  56. </span>
  57. </span>
  58. </FlagMessage>
  59. </div>
  60. );
  61. }
  62. }
  63. export default withIndexationContext(PageUnavailableDueToIndexation);