pr_31004.patch 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. --- a/services/web/frontend/js/features/ide-redesign/components/rail/rail-help-dropdown.tsx
  2. +++ b/services/web/frontend/js/features/ide-redesign/components/rail/rail-help-dropdown.tsx
  3. @@ -10,6 +10,7 @@ import {
  4. export default function RailHelpDropdown() {
  5. const showSupport = getMeta('ol-showSupport')
  6. + const showDocumentation = getMeta('ol-wikiEnabled')
  7. const { t } = useTranslation()
  8. const { setActiveModal } = useRailContext()
  9. const openKeyboardShortcutsModal = useCallback(() => {
  10. @@ -24,20 +25,24 @@ export default function RailHelpDropdown() {
  11. <DropdownItem onClick={openKeyboardShortcutsModal}>
  12. {t('keyboard_shortcuts')}
  13. </DropdownItem>
  14. - <DropdownItem
  15. - href="/learn"
  16. - role="menuitem"
  17. - target="_blank"
  18. - rel="noopener noreferrer"
  19. - >
  20. - {t('documentation')}
  21. - </DropdownItem>
  22. - <DropdownDivider />
  23. - {showSupport && (
  24. - <DropdownItem onClick={openContactUsModal}>
  25. - {t('contact_us')}
  26. + {showDocumentation && (
  27. + <DropdownItem
  28. + href="/learn"
  29. + role="menuitem"
  30. + target="_blank"
  31. + rel="noopener noreferrer"
  32. + >
  33. + {t('documentation')}
  34. </DropdownItem>
  35. )}
  36. + {showSupport && (
  37. + <>
  38. + <DropdownDivider />
  39. + <DropdownItem onClick={openContactUsModal}>
  40. + {t('contact_us')}
  41. + </DropdownItem>
  42. + </>
  43. + )}
  44. </DropdownMenu>
  45. )
  46. }
  47. diff --git a/services/web/frontend/js/features/ide-redesign/components/toolbar/menu-bar.tsx b/services/web/frontend/js/features/ide-redesign/components/toolbar/menu-bar.tsx
  48. index 1610cdb89675..648d2f47fb53 100644
  49. --- a/services/web/frontend/js/features/ide-redesign/components/toolbar/menu-bar.tsx
  50. +++ b/services/web/frontend/js/features/ide-redesign/components/toolbar/menu-bar.tsx
  51. @@ -43,6 +43,8 @@ export const ToolbarMenuBar = () => {
  52. const openProject = useOpenProject()
  53. const anonymous = getMeta('ol-anonymous')
  54. + const showSupport = getMeta('ol-showSupport')
  55. + const showDocumentation = getMeta('ol-wikiEnabled')
  56. useCommandProvider(
  57. () => [
  58. @@ -266,19 +268,25 @@ export const ToolbarMenuBar = () => {
  59. title={t('keyboard_shortcuts')}
  60. onClick={openKeyboardShortcutsModal}
  61. />
  62. - <MenuBarOption
  63. - title={t('documentation')}
  64. - eventKey="documentation"
  65. - href="/learn"
  66. - target="_blank"
  67. - rel="noopener noreferrer"
  68. - />
  69. - <DropdownDivider />
  70. - <MenuBarOption
  71. - eventKey="contact_us"
  72. - title={t('contact_us')}
  73. - onClick={openContactUsModal}
  74. - />
  75. + {showDocumentation && (
  76. + <MenuBarOption
  77. + title={t('documentation')}
  78. + eventKey="documentation"
  79. + href="/learn"
  80. + target="_blank"
  81. + rel="noopener noreferrer"
  82. + />
  83. + )}
  84. + {showSupport && (
  85. + <>
  86. + <DropdownDivider />
  87. + <MenuBarOption
  88. + eventKey="contact_us"
  89. + title={t('contact_us')}
  90. + onClick={openContactUsModal}
  91. + />
  92. + </>
  93. + )}
  94. </MenuBarDropdown>
  95. </MenuBar>
  96. <WordCountModal
  97. diff --git a/services/web/frontend/js/features/ide-redesign/contexts/settings-modal-context.tsx b/services/web/frontend/js/features/ide-redesign/contexts/settings-modal-context.tsx
  98. index 56f0d4e30fe4..ab3bbd9d2b7f 100644
  99. --- a/services/web/frontend/js/features/ide-redesign/contexts/settings-modal-context.tsx
  100. +++ b/services/web/frontend/js/features/ide-redesign/contexts/settings-modal-context.tsx
  101. @@ -29,6 +29,7 @@ import DarkModePdfSetting from '../components/settings/appearance-settings/dark-
  102. import { useProjectSettingsContext } from '@/features/editor-left-menu/context/project-settings-context'
  103. import { useFeatureFlag } from '@/shared/context/split-test-context'
  104. import ProjectNotificationsSetting from '../components/settings/editor-settings/project-notifications-setting'
  105. +import getMeta from '@/utils/meta'
  106. const [referenceSearchSettingModule] = importOverleafModules(
  107. 'referenceSearchSetting'
  108. @@ -82,6 +83,7 @@ export const SettingsModalProvider: FC<React.PropsWithChildren> = ({
  109. children,
  110. }) => {
  111. const { t } = useTranslation()
  112. + const { isOverleaf } = getMeta('ol-ExposedSettings')
  113. const { overallTheme } = useProjectSettingsContext()
  114. // TODO ide-redesign-cleanup: Rename this field and move it directly into this context
  115. @@ -265,9 +267,10 @@ export const SettingsModalProvider: FC<React.PropsWithChildren> = ({
  116. title: t('subscription'),
  117. icon: 'account_balance',
  118. href: '/user/subscription',
  119. + hidden: !isOverleaf,
  120. },
  121. ],
  122. - [t, overallTheme, hasEmailNotifications, noNewEditorOptOut]
  123. + [t, overallTheme, hasEmailNotifications, noNewEditorOptOut, isOverleaf]
  124. )
  125. const settingsTabs = useMemo(