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.

exposeLibraries.ts 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2019 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 ReactRedux from 'react-redux';
  21. import * as ReactRouter from 'react-router';
  22. import { FormattedMessage } from 'react-intl';
  23. import AlertErrorIcon from 'sonar-ui-common/components/icons/AlertErrorIcon';
  24. import AlertSuccessIcon from 'sonar-ui-common/components/icons/AlertSuccessIcon';
  25. import AlertWarnIcon from 'sonar-ui-common/components/icons/AlertWarnIcon';
  26. import CheckIcon from 'sonar-ui-common/components/icons/CheckIcon';
  27. import ClearIcon from 'sonar-ui-common/components/icons/ClearIcon';
  28. import SecurityHotspotIcon from 'sonar-ui-common/components/icons/SecurityHotspotIcon';
  29. import VulnerabilityIcon from 'sonar-ui-common/components/icons/VulnerabilityIcon';
  30. import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon';
  31. import PlusCircleIcon from 'sonar-ui-common/components/icons/PlusCircleIcon';
  32. import HelpIcon from 'sonar-ui-common/components/icons/HelpIcon';
  33. import LockIcon from 'sonar-ui-common/components/icons/LockIcon';
  34. import DetachIcon from 'sonar-ui-common/components/icons/DetachIcon';
  35. import QualifierIcon from 'sonar-ui-common/components/icons/QualifierIcon';
  36. import LongLivingBranchIcon from 'sonar-ui-common/components/icons/LongLivingBranchIcon';
  37. import PullRequestIcon from 'sonar-ui-common/components/icons/PullRequestIcon';
  38. import { formatMeasure } from 'sonar-ui-common/helpers/measures';
  39. import * as request from 'sonar-ui-common/helpers/request';
  40. import Tooltip from 'sonar-ui-common/components/controls/Tooltip';
  41. import {
  42. EditButton,
  43. Button,
  44. SubmitButton,
  45. ResetButtonLink
  46. } from 'sonar-ui-common/components/controls/buttons';
  47. import DeferredSpinner from 'sonar-ui-common/components/ui/DeferredSpinner';
  48. import Modal from 'sonar-ui-common/components/controls/Modal';
  49. import SimpleModal from 'sonar-ui-common/components/controls/SimpleModal';
  50. import ConfirmButton from 'sonar-ui-common/components/controls/ConfirmButton';
  51. import { Alert } from 'sonar-ui-common/components/ui/Alert';
  52. import HelpTooltip from 'sonar-ui-common/components/controls/HelpTooltip';
  53. import Checkbox from 'sonar-ui-common/components/controls/Checkbox';
  54. import SearchBox from 'sonar-ui-common/components/controls/SearchBox';
  55. import DuplicationsRating from 'sonar-ui-common/components/ui/DuplicationsRating';
  56. import Level from 'sonar-ui-common/components/ui/Level';
  57. import ListFooter from 'sonar-ui-common/components/controls/ListFooter';
  58. import Rating from 'sonar-ui-common/components/ui/Rating';
  59. import Dropdown from 'sonar-ui-common/components/controls/Dropdown';
  60. import ActionsDropdown, {
  61. ActionsDropdownItem
  62. } from 'sonar-ui-common/components/controls/ActionsDropdown';
  63. import RadioToggle from 'sonar-ui-common/components/controls/RadioToggle';
  64. import ReloadButton from 'sonar-ui-common/components/controls/ReloadButton';
  65. import Select from 'sonar-ui-common/components/controls/Select';
  66. import SearchSelect from 'sonar-ui-common/components/controls/SearchSelect';
  67. import throwGlobalError from '../../utils/throwGlobalError';
  68. import addGlobalSuccessMessage from '../../utils/addGlobalSuccessMessage';
  69. import Suggestions from '../embed-docs-modal/Suggestions';
  70. import * as measures from '../../../helpers/measures';
  71. import {
  72. getBranchLikeQuery,
  73. isBranch,
  74. isLongLivingBranch,
  75. isPullRequest
  76. } from '../../../helpers/branches';
  77. import { getComponentIssuesUrl, getRulesUrl } from '../../../helpers/urls';
  78. import {
  79. getStandards,
  80. renderCWECategory,
  81. renderOwaspTop10Category,
  82. renderSansTop25Category,
  83. renderSonarSourceSecurityCategory
  84. } from '../../../helpers/security-standard';
  85. import DateFromNow from '../../../components/intl/DateFromNow';
  86. import DateFormatter from '../../../components/intl/DateFormatter';
  87. import DateTimeFormatter from '../../../components/intl/DateTimeFormatter';
  88. import Favorite from '../../../components/controls/Favorite';
  89. import HomePageSelect from '../../../components/controls/HomePageSelect';
  90. import BranchIcon from '../../../components/icons-components/BranchIcon';
  91. import SelectList from '../../../components/SelectList/SelectList';
  92. import CoverageRating from '../../../components/ui/CoverageRating';
  93. import NotFound from '../../../app/components/NotFound';
  94. import A11ySkipTarget from '../a11y/A11ySkipTarget';
  95. const exposeLibraries = () => {
  96. const global = window as any;
  97. global.ReactRedux = ReactRedux;
  98. global.ReactRouter = ReactRouter;
  99. global.SonarHelpers = {
  100. getBranchLikeQuery,
  101. isBranch,
  102. isLongLivingBranch,
  103. isPullRequest,
  104. getStandards,
  105. renderCWECategory,
  106. renderOwaspTop10Category,
  107. renderSansTop25Category,
  108. renderSonarSourceSecurityCategory,
  109. getComponentIssuesUrl,
  110. getRulesUrl
  111. };
  112. global.SonarMeasures = { ...measures, formatMeasure };
  113. global.SonarRequest = { ...request, throwGlobalError, addGlobalSuccessMessage };
  114. global.SonarComponents = {
  115. A11ySkipTarget,
  116. ActionsDropdown,
  117. ActionsDropdownItem,
  118. Alert,
  119. AlertErrorIcon,
  120. AlertSuccessIcon,
  121. AlertWarnIcon,
  122. BranchIcon,
  123. Button,
  124. Checkbox,
  125. CheckIcon,
  126. ClearIcon,
  127. ConfirmButton,
  128. CoverageRating,
  129. DateFormatter,
  130. DateFromNow,
  131. DateTimeFormatter,
  132. DeferredSpinner,
  133. DetachIcon,
  134. Dropdown,
  135. DropdownIcon,
  136. DuplicationsRating,
  137. EditButton,
  138. Favorite,
  139. FormattedMessage,
  140. HelpIcon,
  141. HelpTooltip,
  142. HomePageSelect,
  143. Level,
  144. ListFooter,
  145. LockIcon,
  146. LongLivingBranchIcon,
  147. Modal,
  148. NotFound,
  149. PlusCircleIcon,
  150. PullRequestIcon,
  151. QualifierIcon,
  152. RadioToggle,
  153. Rating,
  154. ReloadButton,
  155. ResetButtonLink,
  156. SearchBox,
  157. SearchSelect,
  158. SecurityHotspotIcon,
  159. Select,
  160. SelectList,
  161. SimpleModal,
  162. SubmitButton,
  163. Suggestions,
  164. Tooltip,
  165. VulnerabilityIcon
  166. };
  167. };
  168. export default exposeLibraries;