mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #18690 from overleaf/ii-bs5-projects-welcome
[web] Welcome page migration GitOrigin-RevId: 2469786372df24d579d1987cf5bb1113450e9d78
This commit is contained in:
+1
-1
@@ -51,7 +51,7 @@ export function OwnerPaywallPrompt() {
|
|||||||
<p>
|
<p>
|
||||||
<StartFreeTrialButton
|
<StartFreeTrialButton
|
||||||
source="history"
|
source="history"
|
||||||
buttonProps={{ bsStyle: 'default', className: 'btn-premium' }}
|
buttonProps={{ variant: 'premium' }}
|
||||||
handleClick={handleFreeTrialClick}
|
handleClick={handleFreeTrialClick}
|
||||||
>
|
>
|
||||||
{hasNewPaywallCta
|
{hasNewPaywallCta
|
||||||
|
|||||||
+4
-2
@@ -84,9 +84,11 @@ const CompileTimeout = memo(function CompileTimeout({
|
|||||||
<StartFreeTrialButton
|
<StartFreeTrialButton
|
||||||
source="compile-timeout"
|
source="compile-timeout"
|
||||||
buttonProps={{
|
buttonProps={{
|
||||||
bsStyle: 'success',
|
variant: 'primary',
|
||||||
className: 'row-spaced-small',
|
className: 'row-spaced-small',
|
||||||
block: true,
|
bs3Props: {
|
||||||
|
block: true,
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{hasNewPaywallCta
|
{hasNewPaywallCta
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
import AccessibleModal from '../../../../shared/components/accessible-modal'
|
|
||||||
import ModalContentNewProjectForm from './modal-content-new-project-form'
|
import ModalContentNewProjectForm from './modal-content-new-project-form'
|
||||||
|
import OLModal from '@/features/ui/components/ol/ol-modal'
|
||||||
|
|
||||||
type BlankProjectModalProps = {
|
type BlankProjectModalProps = {
|
||||||
onHide: () => void
|
onHide: () => void
|
||||||
@@ -7,7 +7,7 @@ type BlankProjectModalProps = {
|
|||||||
|
|
||||||
function BlankProjectModal({ onHide }: BlankProjectModalProps) {
|
function BlankProjectModal({ onHide }: BlankProjectModalProps) {
|
||||||
return (
|
return (
|
||||||
<AccessibleModal
|
<OLModal
|
||||||
show
|
show
|
||||||
animation
|
animation
|
||||||
onHide={onHide}
|
onHide={onHide}
|
||||||
@@ -15,7 +15,7 @@ function BlankProjectModal({ onHide }: BlankProjectModalProps) {
|
|||||||
backdrop="static"
|
backdrop="static"
|
||||||
>
|
>
|
||||||
<ModalContentNewProjectForm onCancel={onHide} />
|
<ModalContentNewProjectForm onCancel={onHide} />
|
||||||
</AccessibleModal>
|
</OLModal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
import AccessibleModal from '../../../../shared/components/accessible-modal'
|
import OLModal from '@/features/ui/components/ol/ol-modal'
|
||||||
import ModalContentNewProjectForm from './modal-content-new-project-form'
|
import ModalContentNewProjectForm from './modal-content-new-project-form'
|
||||||
|
|
||||||
type ExampleProjectModalProps = {
|
type ExampleProjectModalProps = {
|
||||||
@@ -7,7 +7,7 @@ type ExampleProjectModalProps = {
|
|||||||
|
|
||||||
function ExampleProjectModal({ onHide }: ExampleProjectModalProps) {
|
function ExampleProjectModal({ onHide }: ExampleProjectModalProps) {
|
||||||
return (
|
return (
|
||||||
<AccessibleModal
|
<OLModal
|
||||||
show
|
show
|
||||||
animation
|
animation
|
||||||
onHide={onHide}
|
onHide={onHide}
|
||||||
@@ -15,7 +15,7 @@ function ExampleProjectModal({ onHide }: ExampleProjectModalProps) {
|
|||||||
backdrop="static"
|
backdrop="static"
|
||||||
>
|
>
|
||||||
<ModalContentNewProjectForm onCancel={onHide} template="example" />
|
<ModalContentNewProjectForm onCancel={onHide} template="example" />
|
||||||
</AccessibleModal>
|
</OLModal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+27
-21
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { Alert, Button, Form, FormControl, Modal } from 'react-bootstrap'
|
import { Alert } from 'react-bootstrap'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import useAsync from '../../../../shared/hooks/use-async'
|
import useAsync from '../../../../shared/hooks/use-async'
|
||||||
import {
|
import {
|
||||||
@@ -10,6 +10,15 @@ import { useRefWithAutoFocus } from '../../../../shared/hooks/use-ref-with-auto-
|
|||||||
import { useLocation } from '../../../../shared/hooks/use-location'
|
import { useLocation } from '../../../../shared/hooks/use-location'
|
||||||
import getMeta from '@/utils/meta'
|
import getMeta from '@/utils/meta'
|
||||||
import Notification from '@/shared/components/notification'
|
import Notification from '@/shared/components/notification'
|
||||||
|
import {
|
||||||
|
OLModalBody,
|
||||||
|
OLModalFooter,
|
||||||
|
OLModalHeader,
|
||||||
|
OLModalTitle,
|
||||||
|
} from '@/features/ui/components/ol/ol-modal'
|
||||||
|
import OLFormControl from '@/features/ui/components/ol/ol-form-control'
|
||||||
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
||||||
|
import OLForm from '@/features/ui/components/ol/ol-form'
|
||||||
|
|
||||||
type NewProjectData = {
|
type NewProjectData = {
|
||||||
project_id: string
|
project_id: string
|
||||||
@@ -56,24 +65,22 @@ function ModalContentNewProjectForm({ onCancel, template = 'none' }: Props) {
|
|||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleChangeName = (
|
const handleChangeName = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
e: React.ChangeEvent<HTMLInputElement & FormControl>
|
|
||||||
) => {
|
|
||||||
setProjectName(e.currentTarget.value)
|
setProjectName(e.currentTarget.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmit = (e: React.FormEvent<Form>) => {
|
const handleSubmit = (e: React.FormEvent) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
createNewProject()
|
createNewProject()
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Modal.Header closeButton>
|
<OLModalHeader closeButton>
|
||||||
<Modal.Title>{t('new_project')}</Modal.Title>
|
<OLModalTitle>{t('new_project')}</OLModalTitle>
|
||||||
</Modal.Header>
|
</OLModalHeader>
|
||||||
|
|
||||||
<Modal.Body>
|
<OLModalBody>
|
||||||
{isError &&
|
{isError &&
|
||||||
(newNotificationStyle ? (
|
(newNotificationStyle ? (
|
||||||
<div className="notification-list">
|
<div className="notification-list">
|
||||||
@@ -85,30 +92,29 @@ function ModalContentNewProjectForm({ onCancel, template = 'none' }: Props) {
|
|||||||
) : (
|
) : (
|
||||||
<Alert bsStyle="danger">{getUserFacingMessage(error)}</Alert>
|
<Alert bsStyle="danger">{getUserFacingMessage(error)}</Alert>
|
||||||
))}
|
))}
|
||||||
<Form onSubmit={handleSubmit}>
|
<OLForm onSubmit={handleSubmit}>
|
||||||
<input
|
<OLFormControl
|
||||||
type="text"
|
type="text"
|
||||||
className="form-control"
|
|
||||||
ref={autoFocusedRef}
|
ref={autoFocusedRef}
|
||||||
placeholder={t('project_name')}
|
placeholder={t('project_name')}
|
||||||
onChange={handleChangeName}
|
onChange={handleChangeName}
|
||||||
value={projectName}
|
value={projectName}
|
||||||
/>
|
/>
|
||||||
</Form>
|
</OLForm>
|
||||||
</Modal.Body>
|
</OLModalBody>
|
||||||
|
|
||||||
<Modal.Footer>
|
<OLModalFooter>
|
||||||
<Button bsStyle={null} className="btn-secondary" onClick={onCancel}>
|
<OLButton variant="secondary" onClick={onCancel}>
|
||||||
{t('cancel')}
|
{t('cancel')}
|
||||||
</Button>
|
</OLButton>
|
||||||
<Button
|
<OLButton
|
||||||
bsStyle="primary"
|
variant="primary"
|
||||||
onClick={createNewProject}
|
onClick={createNewProject}
|
||||||
disabled={projectName === '' || isLoading}
|
disabled={projectName === '' || isLoading}
|
||||||
>
|
>
|
||||||
{isLoading ? `${t('creating')}…` : t('create')}
|
{isLoading ? `${t('creating')}…` : t('create')}
|
||||||
</Button>
|
</OLButton>
|
||||||
</Modal.Footer>
|
</OLModalFooter>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-16
@@ -1,10 +1,15 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { Button, Modal } from 'react-bootstrap'
|
import OLModal, {
|
||||||
|
OLModalBody,
|
||||||
|
OLModalFooter,
|
||||||
|
OLModalHeader,
|
||||||
|
OLModalTitle,
|
||||||
|
} from '@/features/ui/components/ol/ol-modal'
|
||||||
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Uppy from '@uppy/core'
|
import Uppy from '@uppy/core'
|
||||||
import { Dashboard } from '@uppy/react'
|
import { Dashboard } from '@uppy/react'
|
||||||
import XHRUpload from '@uppy/xhr-upload'
|
import XHRUpload from '@uppy/xhr-upload'
|
||||||
import AccessibleModal from '../../../../shared/components/accessible-modal'
|
|
||||||
import getMeta from '../../../../utils/meta'
|
import getMeta from '../../../../utils/meta'
|
||||||
import { ExposedSettings } from '../../../../../../types/exposed-settings'
|
import { ExposedSettings } from '../../../../../../types/exposed-settings'
|
||||||
|
|
||||||
@@ -85,19 +90,17 @@ function UploadProjectModal({ onHide, openProject }: UploadProjectModalProps) {
|
|||||||
}, [ableToUpload, uppy])
|
}, [ableToUpload, uppy])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AccessibleModal
|
<OLModal
|
||||||
show
|
show
|
||||||
animation
|
animation
|
||||||
onHide={onHide}
|
onHide={onHide}
|
||||||
id="upload-project-modal"
|
id="upload-project-modal"
|
||||||
backdrop="static"
|
backdrop="static"
|
||||||
>
|
>
|
||||||
<Modal.Header closeButton>
|
<OLModalHeader closeButton>
|
||||||
<Modal.Title componentClass="h3">
|
<OLModalTitle as="h3">{t('upload_zipped_project')}</OLModalTitle>
|
||||||
{t('upload_zipped_project')}
|
</OLModalHeader>
|
||||||
</Modal.Title>
|
<OLModalBody>
|
||||||
</Modal.Header>
|
|
||||||
<Modal.Body>
|
|
||||||
<Dashboard
|
<Dashboard
|
||||||
uppy={uppy}
|
uppy={uppy}
|
||||||
proudlyDisplayPoweredByUppy={false}
|
proudlyDisplayPoweredByUppy={false}
|
||||||
@@ -113,14 +116,13 @@ function UploadProjectModal({ onHide, openProject }: UploadProjectModalProps) {
|
|||||||
}}
|
}}
|
||||||
className="project-list-upload-project-modal-uppy-dashboard"
|
className="project-list-upload-project-modal-uppy-dashboard"
|
||||||
/>
|
/>
|
||||||
</Modal.Body>
|
</OLModalBody>
|
||||||
|
<OLModalFooter>
|
||||||
<Modal.Footer>
|
<OLButton variant="secondary" onClick={onHide}>
|
||||||
<Button onClick={onHide} bsStyle={null} className="btn-secondary">
|
|
||||||
{t('cancel')}
|
{t('cancel')}
|
||||||
</Button>
|
</OLButton>
|
||||||
</Modal.Footer>
|
</OLModalFooter>
|
||||||
</AccessibleModal>
|
</OLModal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import { useEffect } from 'react'
|
|||||||
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
import withErrorBoundary from '../../../infrastructure/error-boundary'
|
||||||
import { GenericErrorBoundaryFallback } from '../../../shared/components/generic-error-boundary-fallback'
|
import { GenericErrorBoundaryFallback } from '../../../shared/components/generic-error-boundary-fallback'
|
||||||
import { SplitTestProvider } from '@/shared/context/split-test-context'
|
import { SplitTestProvider } from '@/shared/context/split-test-context'
|
||||||
|
import OLCol from '@/features/ui/components/ol/ol-col'
|
||||||
import { bsVersion } from '@/features/utils/bootstrap-5'
|
import { bsVersion } from '@/features/utils/bootstrap-5'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
|
|
||||||
@@ -170,20 +171,18 @@ function ProjectListPageContent() {
|
|||||||
<div className="project-list-welcome-wrapper">
|
<div className="project-list-welcome-wrapper">
|
||||||
{error ? <DashApiError /> : ''}
|
{error ? <DashApiError /> : ''}
|
||||||
<Row className="row-spaced mx-0">
|
<Row className="row-spaced mx-0">
|
||||||
<Col
|
<OLCol
|
||||||
sm={10}
|
md={{ span: 10, offset: 1 }}
|
||||||
smOffset={1}
|
lg={{ span: 8, offset: 2 }}
|
||||||
md={8}
|
|
||||||
mdOffset={2}
|
|
||||||
className="project-list-empty-col"
|
className="project-list-empty-col"
|
||||||
>
|
>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={12}>
|
<OLCol>
|
||||||
<UserNotifications />
|
<UserNotifications />
|
||||||
</Col>
|
</OLCol>
|
||||||
</Row>
|
</Row>
|
||||||
<WelcomeMessage />
|
<WelcomeMessage />
|
||||||
</Col>
|
</OLCol>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
@@ -196,11 +195,16 @@ function DashApiError() {
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
return (
|
return (
|
||||||
<Row className="row-spaced">
|
<Row className="row-spaced">
|
||||||
<Col xs={8} xsOffset={2} aria-live="polite" className="text-center">
|
<OLCol
|
||||||
|
xs={{ span: 8, offset: 2 }}
|
||||||
|
bs3Props={{ xs: 8, xsOffset: 2 }}
|
||||||
|
aria-live="polite"
|
||||||
|
className="text-center"
|
||||||
|
>
|
||||||
<div className="alert alert-danger">
|
<div className="alert alert-danger">
|
||||||
{t('generic_something_went_wrong')}
|
{t('generic_something_went_wrong')}
|
||||||
</div>
|
</div>
|
||||||
</Col>
|
</OLCol>
|
||||||
</Row>
|
</Row>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+206
-74
@@ -1,10 +1,56 @@
|
|||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState, forwardRef } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import type { PortalTemplate } from '../../../../../../types/portal-template'
|
import type { PortalTemplate } from '../../../../../../types/portal-template'
|
||||||
import { sendMB } from '../../../../infrastructure/event-tracking'
|
import { sendMB } from '../../../../infrastructure/event-tracking'
|
||||||
import getMeta from '../../../../utils/meta'
|
import getMeta from '../../../../utils/meta'
|
||||||
import { NewProjectButtonModalVariant } from '../new-project-button/new-project-button-modal'
|
import { NewProjectButtonModalVariant } from '../new-project-button/new-project-button-modal'
|
||||||
import { ExposedSettings } from '../../../../../../types/exposed-settings'
|
import { ExposedSettings } from '../../../../../../types/exposed-settings'
|
||||||
|
import {
|
||||||
|
Dropdown,
|
||||||
|
DropdownDivider,
|
||||||
|
DropdownHeader,
|
||||||
|
DropdownItem,
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownToggle,
|
||||||
|
} from '@/features/ui/components/bootstrap-5/dropdown-menu'
|
||||||
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
||||||
|
|
||||||
|
const CustomDropdownToggle = forwardRef<
|
||||||
|
HTMLButtonElement,
|
||||||
|
React.ComponentProps<'button'>
|
||||||
|
>(({ onClick, 'aria-expanded': ariaExpanded }, ref) => {
|
||||||
|
const { t } = useTranslation()
|
||||||
|
|
||||||
|
const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
|
e.preventDefault()
|
||||||
|
onClick?.(e)
|
||||||
|
|
||||||
|
sendMB('welcome-page-create-first-project-click', {
|
||||||
|
dropdownMenu: 'main-button',
|
||||||
|
dropdownOpen: ariaExpanded,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
ref={ref}
|
||||||
|
className="card welcome-message-card"
|
||||||
|
onClick={handleClick}
|
||||||
|
id="create-new-project-dropdown-button"
|
||||||
|
aria-expanded={ariaExpanded}
|
||||||
|
aria-haspopup="true"
|
||||||
|
>
|
||||||
|
<span>{t('create_a_new_project')}</span>
|
||||||
|
<img
|
||||||
|
className="welcome-message-card-img"
|
||||||
|
src="/img/welcome-page/create-a-new-project.svg"
|
||||||
|
aria-hidden="true"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
CustomDropdownToggle.displayName = 'CustomDropdownToggle'
|
||||||
|
|
||||||
type WelcomeMessageCreateNewProjectDropdownProps = {
|
type WelcomeMessageCreateNewProjectDropdownProps = {
|
||||||
setActiveModal: (modal: NewProjectButtonModalVariant) => void
|
setActiveModal: (modal: NewProjectButtonModalVariant) => void
|
||||||
@@ -47,7 +93,7 @@ function WelcomeMessageCreateNewProjectDropdown({
|
|||||||
|
|
||||||
const handleDropdownItemClick = useCallback(
|
const handleDropdownItemClick = useCallback(
|
||||||
(
|
(
|
||||||
e: React.MouseEvent<HTMLButtonElement, MouseEvent>,
|
e: React.MouseEvent,
|
||||||
modalVariant: NewProjectButtonModalVariant,
|
modalVariant: NewProjectButtonModalVariant,
|
||||||
dropdownMenuEvent: string
|
dropdownMenuEvent: string
|
||||||
) => {
|
) => {
|
||||||
@@ -66,10 +112,7 @@ function WelcomeMessageCreateNewProjectDropdown({
|
|||||||
)
|
)
|
||||||
|
|
||||||
const handlePortalTemplateClick = useCallback(
|
const handlePortalTemplateClick = useCallback(
|
||||||
(
|
(e: React.MouseEvent, institutionTemplateName: string) => {
|
||||||
e: React.MouseEvent<HTMLAnchorElement, MouseEvent>,
|
|
||||||
institutionTemplateName: string
|
|
||||||
) => {
|
|
||||||
// prevent firing the main dropdown onClick event
|
// prevent firing the main dropdown onClick event
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
|
|
||||||
@@ -85,78 +128,167 @@ function WelcomeMessageCreateNewProjectDropdown({
|
|||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<BootstrapVersionSwitcher
|
||||||
role="button"
|
bs3={
|
||||||
tabIndex={0}
|
<div
|
||||||
className="card welcome-message-card"
|
role="button"
|
||||||
onClick={handleClick}
|
tabIndex={0}
|
||||||
onKeyDown={handleKeyDown}
|
className="card welcome-message-card"
|
||||||
>
|
onClick={handleClick}
|
||||||
<p>{t('create_a_new_project')}</p>
|
onKeyDown={handleKeyDown}
|
||||||
<img
|
>
|
||||||
className="welcome-message-card-img"
|
<p>{t('create_a_new_project')}</p>
|
||||||
src="/img/welcome-page/create-a-new-project.svg"
|
<img
|
||||||
aria-hidden="true"
|
className="welcome-message-card-img"
|
||||||
alt=""
|
src="/img/welcome-page/create-a-new-project.svg"
|
||||||
/>
|
aria-hidden="true"
|
||||||
{showDropdown ? (
|
alt=""
|
||||||
<div className="card create-new-project-dropdown">
|
/>
|
||||||
<button
|
{showDropdown && (
|
||||||
onClick={e =>
|
<div className="card create-new-project-dropdown">
|
||||||
handleDropdownItemClick(e, 'blank_project', 'blank-project')
|
<button
|
||||||
}
|
onClick={e =>
|
||||||
>
|
handleDropdownItemClick(e, 'blank_project', 'blank-project')
|
||||||
{t('blank_project')}
|
}
|
||||||
</button>
|
>
|
||||||
<button
|
{t('blank_project')}
|
||||||
onClick={e =>
|
</button>
|
||||||
handleDropdownItemClick(e, 'example_project', 'example-project')
|
<button
|
||||||
}
|
onClick={e =>
|
||||||
>
|
handleDropdownItemClick(
|
||||||
{t('example_project')}
|
e,
|
||||||
</button>
|
'example_project',
|
||||||
<button
|
'example-project'
|
||||||
onClick={e =>
|
)
|
||||||
handleDropdownItemClick(e, 'upload_project', 'upload-project')
|
}
|
||||||
}
|
>
|
||||||
>
|
{t('example_project')}
|
||||||
{t('upload_project')}
|
</button>
|
||||||
</button>
|
<button
|
||||||
{isOverleaf && (
|
onClick={e =>
|
||||||
<button
|
handleDropdownItemClick(e, 'upload_project', 'upload-project')
|
||||||
onClick={e =>
|
}
|
||||||
handleDropdownItemClick(
|
>
|
||||||
e,
|
{t('upload_project')}
|
||||||
'import_from_github',
|
</button>
|
||||||
'import-from-github'
|
{isOverleaf && (
|
||||||
)
|
<button
|
||||||
}
|
|
||||||
>
|
|
||||||
{t('import_from_github')}
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
{(portalTemplates?.length ?? 0) > 0 ? (
|
|
||||||
<>
|
|
||||||
<hr />
|
|
||||||
<div className="dropdown-header">
|
|
||||||
{t('institution_templates')}
|
|
||||||
</div>
|
|
||||||
{portalTemplates?.map((portalTemplate, index) => (
|
|
||||||
<a
|
|
||||||
key={`portal-template-${index}`}
|
|
||||||
href={`${portalTemplate.url}#templates`}
|
|
||||||
onClick={e =>
|
onClick={e =>
|
||||||
handlePortalTemplateClick(e, portalTemplate.name)
|
handleDropdownItemClick(
|
||||||
|
e,
|
||||||
|
'import_from_github',
|
||||||
|
'import-from-github'
|
||||||
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{portalTemplate.name}
|
{t('import_from_github')}
|
||||||
</a>
|
</button>
|
||||||
))}
|
)}
|
||||||
</>
|
{(portalTemplates?.length ?? 0) > 0 ? (
|
||||||
) : null}
|
<>
|
||||||
|
<hr />
|
||||||
|
<div className="dropdown-header">
|
||||||
|
{t('institution_templates')}
|
||||||
|
</div>
|
||||||
|
{portalTemplates?.map((portalTemplate, index) => (
|
||||||
|
<a
|
||||||
|
key={`portal-template-${index}`}
|
||||||
|
href={`${portalTemplate.url}#templates`}
|
||||||
|
onClick={e =>
|
||||||
|
handlePortalTemplateClick(e, portalTemplate.name)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{portalTemplate.name}
|
||||||
|
</a>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
}
|
||||||
</div>
|
bs5={
|
||||||
|
<Dropdown>
|
||||||
|
<DropdownToggle
|
||||||
|
as={CustomDropdownToggle}
|
||||||
|
id="create-new-project-dropdown-toggle-btn"
|
||||||
|
/>
|
||||||
|
<DropdownMenu flip={false} className="create-new-project-dropdown">
|
||||||
|
<li role="none">
|
||||||
|
<DropdownItem
|
||||||
|
as="button"
|
||||||
|
onClick={e =>
|
||||||
|
handleDropdownItemClick(e, 'blank_project', 'blank-project')
|
||||||
|
}
|
||||||
|
tabIndex={-1}
|
||||||
|
>
|
||||||
|
{t('blank_project')}
|
||||||
|
</DropdownItem>
|
||||||
|
</li>
|
||||||
|
<li role="none">
|
||||||
|
<DropdownItem
|
||||||
|
as="button"
|
||||||
|
onClick={e =>
|
||||||
|
handleDropdownItemClick(
|
||||||
|
e,
|
||||||
|
'example_project',
|
||||||
|
'example-project'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
tabIndex={-1}
|
||||||
|
>
|
||||||
|
{t('example_project')}
|
||||||
|
</DropdownItem>
|
||||||
|
</li>
|
||||||
|
<li role="none">
|
||||||
|
<DropdownItem
|
||||||
|
as="button"
|
||||||
|
onClick={e =>
|
||||||
|
handleDropdownItemClick(e, 'upload_project', 'upload-project')
|
||||||
|
}
|
||||||
|
tabIndex={-1}
|
||||||
|
>
|
||||||
|
{t('upload_project')}
|
||||||
|
</DropdownItem>
|
||||||
|
</li>
|
||||||
|
{isOverleaf && (
|
||||||
|
<li role="none">
|
||||||
|
<DropdownItem
|
||||||
|
as="button"
|
||||||
|
onClick={e =>
|
||||||
|
handleDropdownItemClick(
|
||||||
|
e,
|
||||||
|
'import_from_github',
|
||||||
|
'import-from-github'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
tabIndex={-1}
|
||||||
|
>
|
||||||
|
{t('import_from_github')}
|
||||||
|
</DropdownItem>
|
||||||
|
</li>
|
||||||
|
)}
|
||||||
|
{(portalTemplates?.length ?? 0) > 0 ? (
|
||||||
|
<>
|
||||||
|
<DropdownDivider />
|
||||||
|
<DropdownHeader>{t('institution_templates')}</DropdownHeader>
|
||||||
|
{portalTemplates?.map((portalTemplate, index) => (
|
||||||
|
<DropdownItem
|
||||||
|
key={`portal-template-${index}`}
|
||||||
|
onClick={e =>
|
||||||
|
handlePortalTemplateClick(e, portalTemplate.name)
|
||||||
|
}
|
||||||
|
href={`${portalTemplate.url}#templates`}
|
||||||
|
>
|
||||||
|
{portalTemplate.name}
|
||||||
|
</DropdownItem>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
</DropdownMenu>
|
||||||
|
</Dropdown>
|
||||||
|
}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import WelcomeMessageLink from './welcome-message-new/welcome-message-link'
|
|||||||
import WelcomeMessageCreateNewProjectDropdown from './welcome-message-new/welcome-message-create-new-project-dropdown'
|
import WelcomeMessageCreateNewProjectDropdown from './welcome-message-new/welcome-message-create-new-project-dropdown'
|
||||||
import getMeta from '@/utils/meta'
|
import getMeta from '@/utils/meta'
|
||||||
import { ExposedSettings } from '../../../../../types/exposed-settings'
|
import { ExposedSettings } from '../../../../../types/exposed-settings'
|
||||||
|
import OLCard from '@/features/ui/components/ol/ol-card'
|
||||||
|
|
||||||
export default function WelcomeMessage() {
|
export default function WelcomeMessage() {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
@@ -19,31 +20,33 @@ export default function WelcomeMessage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="card welcome-new-wrapper">
|
<OLCard>
|
||||||
<div className="welcome text-centered">
|
<div className="welcome-new-wrapper">
|
||||||
<h2 className="welcome-title">{t('welcome_to_sl')}</h2>
|
<div className="welcome text-center">
|
||||||
<div className="welcome-message-cards-wrapper">
|
<h2 className="welcome-title">{t('welcome_to_sl')}</h2>
|
||||||
<WelcomeMessageCreateNewProjectDropdown
|
<div className="welcome-message-cards-wrapper">
|
||||||
setActiveModal={modal => setActiveModal(modal)}
|
<WelcomeMessageCreateNewProjectDropdown
|
||||||
/>
|
setActiveModal={modal => setActiveModal(modal)}
|
||||||
{wikiEnabled && (
|
|
||||||
<WelcomeMessageLink
|
|
||||||
imgSrc="/img/welcome-page/learn-latex.svg"
|
|
||||||
title="Learn LaTeX with a tutorial"
|
|
||||||
href="/learn/latex/Learn_LaTeX_in_30_minutes"
|
|
||||||
target="_blank"
|
|
||||||
/>
|
/>
|
||||||
)}
|
{wikiEnabled && (
|
||||||
{templatesEnabled && (
|
<WelcomeMessageLink
|
||||||
<WelcomeMessageLink
|
imgSrc="/img/welcome-page/learn-latex.svg"
|
||||||
imgSrc="/img/welcome-page/browse-templates.svg"
|
title="Learn LaTeX with a tutorial"
|
||||||
title="Browse templates"
|
href="/learn/latex/Learn_LaTeX_in_30_minutes"
|
||||||
href="/templates"
|
target="_blank"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{templatesEnabled && (
|
||||||
|
<WelcomeMessageLink
|
||||||
|
imgSrc="/img/welcome-page/browse-templates.svg"
|
||||||
|
title="Browse templates"
|
||||||
|
href="/templates"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</OLCard>
|
||||||
<NewProjectButtonModal
|
<NewProjectButtonModal
|
||||||
modal={activeModal}
|
modal={activeModal}
|
||||||
onHide={() => setActiveModal(null)}
|
onHide={() => setActiveModal(null)}
|
||||||
|
|||||||
@@ -161,12 +161,7 @@ function AddEmail() {
|
|||||||
</Cell>
|
</Cell>
|
||||||
</OLCol>
|
</OLCol>
|
||||||
<OLCol lg={4}>
|
<OLCol lg={4}>
|
||||||
<Cell
|
<Cell className="text-lg-end">
|
||||||
className={bsVersion({
|
|
||||||
bs5: 'text-lg-end',
|
|
||||||
bs3: 'text-md-right',
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<AddNewEmailBtn email={newEmail} disabled />
|
<AddNewEmailBtn email={newEmail} disabled />
|
||||||
</Cell>
|
</Cell>
|
||||||
</OLCol>
|
</OLCol>
|
||||||
@@ -206,12 +201,7 @@ function AddEmail() {
|
|||||||
</OLCol>
|
</OLCol>
|
||||||
{!isSsoAvailableForDomain ? (
|
{!isSsoAvailableForDomain ? (
|
||||||
<OLCol lg={4}>
|
<OLCol lg={4}>
|
||||||
<Cell
|
<Cell className="text-lg-end">
|
||||||
className={bsVersion({
|
|
||||||
bs5: 'text-lg-end',
|
|
||||||
bs3: 'text-md-right',
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<AddNewEmailBtn
|
<AddNewEmailBtn
|
||||||
email={newEmail}
|
email={newEmail}
|
||||||
disabled={state.isLoading}
|
disabled={state.isLoading}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import ReconfirmationInfo from './reconfirmation-info'
|
|||||||
import { useLocation } from '../../../../shared/hooks/use-location'
|
import { useLocation } from '../../../../shared/hooks/use-location'
|
||||||
import OLRow from '@/features/ui/components/ol/ol-row'
|
import OLRow from '@/features/ui/components/ol/ol-row'
|
||||||
import OLCol from '@/features/ui/components/ol/ol-col'
|
import OLCol from '@/features/ui/components/ol/ol-col'
|
||||||
import { bsVersion } from '@/features/utils/bootstrap-5'
|
|
||||||
import OLButton from '@/features/ui/components/ol/ol-button'
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
||||||
|
|
||||||
type EmailsRowProps = {
|
type EmailsRowProps = {
|
||||||
@@ -43,12 +42,7 @@ function EmailsRow({ userEmailData }: EmailsRowProps) {
|
|||||||
)}
|
)}
|
||||||
</OLCol>
|
</OLCol>
|
||||||
<OLCol lg={3}>
|
<OLCol lg={3}>
|
||||||
<EmailCell
|
<EmailCell className="text-lg-end">
|
||||||
className={bsVersion({
|
|
||||||
bs5: 'text-lg-end',
|
|
||||||
bs3: 'text-md-right',
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<Actions userEmailData={userEmailData} />
|
<Actions userEmailData={userEmailData} />
|
||||||
</EmailCell>
|
</EmailCell>
|
||||||
</OLCol>
|
</OLCol>
|
||||||
@@ -152,13 +146,7 @@ function SSOAffiliationInfo({ userEmailData }: SSOAffiliationInfoProps) {
|
|||||||
</p>
|
</p>
|
||||||
</EmailCell>
|
</EmailCell>
|
||||||
</OLCol>
|
</OLCol>
|
||||||
<OLCol
|
<OLCol lg={3} className="text-lg-end">
|
||||||
lg={3}
|
|
||||||
className={bsVersion({
|
|
||||||
bs5: 'text-lg-end',
|
|
||||||
bs3: 'text-md-right',
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<EmailCell>
|
<EmailCell>
|
||||||
<OLButton
|
<OLButton
|
||||||
variant="primary"
|
variant="primary"
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ export default function AddCollaboratorsUpgrade() {
|
|||||||
<p className="text-center row-spaced-thin">
|
<p className="text-center row-spaced-thin">
|
||||||
{user.allowedFreeTrial ? (
|
{user.allowedFreeTrial ? (
|
||||||
<StartFreeTrialButton
|
<StartFreeTrialButton
|
||||||
buttonProps={{ bsStyle: 'success' }}
|
buttonProps={{ variant: 'primary' }}
|
||||||
handleClick={() => setStartedFreeTrial(true)}
|
handleClick={() => setStartedFreeTrial(true)}
|
||||||
source="project-sharing"
|
source="project-sharing"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
DropdownMenu as BS5DropdownMenu,
|
DropdownMenu as BS5DropdownMenu,
|
||||||
DropdownItem as BS5DropdownItem,
|
DropdownItem as BS5DropdownItem,
|
||||||
DropdownDivider as BS5DropdownDivider,
|
DropdownDivider as BS5DropdownDivider,
|
||||||
|
DropdownHeader as BS5DropdownHeader,
|
||||||
} from 'react-bootstrap-5'
|
} from 'react-bootstrap-5'
|
||||||
import type {
|
import type {
|
||||||
DropdownProps,
|
DropdownProps,
|
||||||
@@ -12,6 +13,7 @@ import type {
|
|||||||
DropdownToggleProps,
|
DropdownToggleProps,
|
||||||
DropdownMenuProps,
|
DropdownMenuProps,
|
||||||
DropdownDividerProps,
|
DropdownDividerProps,
|
||||||
|
DropdownHeaderProps,
|
||||||
} from '@/features/ui/components/types/dropdown-menu-props'
|
} from '@/features/ui/components/types/dropdown-menu-props'
|
||||||
import MaterialIcon from '@/shared/components/material-icon'
|
import MaterialIcon from '@/shared/components/material-icon'
|
||||||
|
|
||||||
@@ -69,3 +71,7 @@ export function DropdownMenu({ as = 'ul', ...props }: DropdownMenuProps) {
|
|||||||
export function DropdownDivider({ as = 'li' }: DropdownDividerProps) {
|
export function DropdownDivider({ as = 'li' }: DropdownDividerProps) {
|
||||||
return <BS5DropdownDivider as={as} />
|
return <BS5DropdownDivider as={as} />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function DropdownHeader({ as = 'li', ...props }: DropdownHeaderProps) {
|
||||||
|
return <BS5DropdownHeader as={as} {...props} />
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { Table as BS5Table } from 'react-bootstrap-5'
|
||||||
|
import classnames from 'classnames'
|
||||||
|
|
||||||
|
function Table({ responsive, ...rest }: React.ComponentProps<typeof BS5Table>) {
|
||||||
|
const content = (
|
||||||
|
<div
|
||||||
|
className={classnames('table-container', {
|
||||||
|
'table-container-bordered': rest.bordered,
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<BS5Table {...rest} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
|
||||||
|
if (responsive) {
|
||||||
|
return <div className="table-responsive d-flex">{content}</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
return content
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Table
|
||||||
@@ -11,6 +11,7 @@ export type OLButtonProps = ButtonProps & {
|
|||||||
bs3Props?: {
|
bs3Props?: {
|
||||||
loading?: React.ReactNode
|
loading?: React.ReactNode
|
||||||
bsSize?: BS3ButtonSize
|
bsSize?: BS3ButtonSize
|
||||||
|
block?: boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import { Form } from 'react-bootstrap-5'
|
||||||
|
import { Form as BS3Form } from 'react-bootstrap'
|
||||||
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
||||||
|
|
||||||
|
type OLFormProps = React.ComponentProps<typeof Form> & {
|
||||||
|
bs3Props?: React.ComponentProps<typeof BS3Form>
|
||||||
|
}
|
||||||
|
|
||||||
|
function OLForm(props: OLFormProps) {
|
||||||
|
const { bs3Props, ...rest } = props
|
||||||
|
|
||||||
|
const bs3FormProps: React.ComponentProps<typeof BS3Form> = {
|
||||||
|
componentClass: rest.as,
|
||||||
|
bsClass: rest.className,
|
||||||
|
children: rest.children,
|
||||||
|
...bs3Props,
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<BootstrapVersionSwitcher
|
||||||
|
bs3={<BS3Form {...bs3FormProps} />}
|
||||||
|
bs5={<Form {...rest} />}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default OLForm
|
||||||
@@ -42,6 +42,7 @@ export default function OLModal({ children, ...props }: OLModalProps) {
|
|||||||
onHide: bs5Props.onHide,
|
onHide: bs5Props.onHide,
|
||||||
backdrop: bs5Props.backdrop,
|
backdrop: bs5Props.backdrop,
|
||||||
animation: bs5Props.animation,
|
animation: bs5Props.animation,
|
||||||
|
id: bs5Props.id,
|
||||||
...bs3Props,
|
...bs3Props,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import Table from '@/features/ui/components/bootstrap-5/table'
|
||||||
|
import { Table as BS3Table } from 'react-bootstrap'
|
||||||
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
||||||
|
|
||||||
|
type OLFormProps = React.ComponentProps<typeof Table> & {
|
||||||
|
bs3Props?: React.ComponentProps<typeof BS3Table>
|
||||||
|
}
|
||||||
|
|
||||||
|
function OLTable(props: OLFormProps) {
|
||||||
|
const { bs3Props, ...rest } = props
|
||||||
|
|
||||||
|
const bs3FormProps: React.ComponentProps<typeof BS3Table> = {
|
||||||
|
bsClass: rest.className,
|
||||||
|
condensed: rest.size === 'sm',
|
||||||
|
children: rest.children,
|
||||||
|
responsive:
|
||||||
|
typeof rest.responsive !== 'string' ? rest.responsive : undefined,
|
||||||
|
...bs3Props,
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<BootstrapVersionSwitcher
|
||||||
|
bs3={<BS3Table {...bs3FormProps} />}
|
||||||
|
bs5={<Table {...rest} />}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default OLTable
|
||||||
@@ -25,27 +25,35 @@ export type DropdownItemProps = PropsWithChildren<{
|
|||||||
eventKey?: string | number
|
eventKey?: string | number
|
||||||
href?: string
|
href?: string
|
||||||
leadingIcon?: string
|
leadingIcon?: string
|
||||||
onClick?: () => void
|
onClick?: React.MouseEventHandler
|
||||||
trailingIcon?: string
|
trailingIcon?: string
|
||||||
variant?: 'default' | 'danger'
|
variant?: 'default' | 'danger'
|
||||||
className?: string
|
className?: string
|
||||||
role?: string
|
role?: string
|
||||||
|
tabIndex?: number
|
||||||
}>
|
}>
|
||||||
|
|
||||||
export type DropdownToggleProps = PropsWithChildren<{
|
export type DropdownToggleProps = PropsWithChildren<{
|
||||||
bsPrefix?: string
|
bsPrefix?: string
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
split?: boolean
|
split?: boolean
|
||||||
id: string // necessary for assistive technologies
|
id?: string // necessary for assistive technologies
|
||||||
variant: SplitButtonVariants
|
variant?: SplitButtonVariants
|
||||||
|
as?: ElementType
|
||||||
}>
|
}>
|
||||||
|
|
||||||
export type DropdownMenuProps = PropsWithChildren<{
|
export type DropdownMenuProps = PropsWithChildren<{
|
||||||
as?: ElementType
|
as?: ElementType
|
||||||
disabled?: boolean
|
disabled?: boolean
|
||||||
show?: boolean
|
show?: boolean
|
||||||
|
className?: string
|
||||||
|
flip?: boolean
|
||||||
}>
|
}>
|
||||||
|
|
||||||
export type DropdownDividerProps = PropsWithChildren<{
|
export type DropdownDividerProps = PropsWithChildren<{
|
||||||
as?: ElementType
|
as?: ElementType
|
||||||
}>
|
}>
|
||||||
|
|
||||||
|
export type DropdownHeaderProps = PropsWithChildren<{
|
||||||
|
as?: ElementType
|
||||||
|
}>
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import { MouseEventHandler, useCallback, useEffect } from 'react'
|
import { MouseEventHandler, useCallback, useEffect } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Button } from 'react-bootstrap'
|
|
||||||
import { startFreeTrial } from '../../main/account-upgrade'
|
import { startFreeTrial } from '../../main/account-upgrade'
|
||||||
import * as eventTracking from '../../infrastructure/event-tracking'
|
import * as eventTracking from '../../infrastructure/event-tracking'
|
||||||
|
import OLButton from '@/features/ui/components/ol/ol-button'
|
||||||
|
|
||||||
type StartFreeTrialButtonProps = {
|
type StartFreeTrialButtonProps = {
|
||||||
source: string
|
source: string
|
||||||
variant?: string
|
variant?: string
|
||||||
buttonProps?: Button.ButtonProps
|
buttonProps?: React.ComponentProps<typeof OLButton>
|
||||||
children?: React.ReactNode
|
children?: React.ReactNode
|
||||||
handleClick?: MouseEventHandler<Button>
|
handleClick?: MouseEventHandler<typeof OLButton>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function StartFreeTrialButton({
|
export default function StartFreeTrialButton({
|
||||||
buttonProps = {
|
buttonProps = {
|
||||||
bsStyle: 'info',
|
variant: 'secondary',
|
||||||
},
|
},
|
||||||
children,
|
children,
|
||||||
handleClick,
|
handleClick,
|
||||||
@@ -47,8 +47,8 @@ export default function StartFreeTrialButton({
|
|||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button {...buttonProps} onClick={onClick}>
|
<OLButton {...buttonProps} onClick={onClick}>
|
||||||
{children || t('start_free_trial')}
|
{children || t('start_free_trial')}
|
||||||
</Button>
|
</OLButton>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ export const ButtonStyle = args => {
|
|||||||
return (
|
return (
|
||||||
<StartFreeTrialButton
|
<StartFreeTrialButton
|
||||||
{...args}
|
{...args}
|
||||||
buttonProps={{ bsStyle: 'danger', bsSize: 'lg' }}
|
buttonProps={{
|
||||||
|
variant: 'danger',
|
||||||
|
size: 'large',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,32 @@ $btn-border-radius-lg: $border-radius-full;
|
|||||||
$btn-border-radius-sm: $border-radius-full;
|
$btn-border-radius-sm: $border-radius-full;
|
||||||
$btn-white-space: nowrap;
|
$btn-white-space: nowrap;
|
||||||
|
|
||||||
|
// Tables
|
||||||
|
$table-cell-padding-y: $spacing-04;
|
||||||
|
$table-cell-padding-x: $spacing-04;
|
||||||
|
$table-cell-padding-y-sm: $spacing-02;
|
||||||
|
$table-cell-padding-x-sm: $spacing-02;
|
||||||
|
|
||||||
|
$table-color: var(--content-secondary);
|
||||||
|
$table-bg: var(--bg-light-primary);
|
||||||
|
|
||||||
|
$table-th-font-weight: 600;
|
||||||
|
|
||||||
|
$table-striped-color: $table-color;
|
||||||
|
$table-striped-bg: var(--bg-light-secondary);
|
||||||
|
|
||||||
|
$table-active-color: $table-color;
|
||||||
|
$table-active-bg: $bg-accent-03;
|
||||||
|
|
||||||
|
$table-hover-color: $table-color;
|
||||||
|
$table-hover-bg: var(--bg-light-tertiary);
|
||||||
|
|
||||||
|
$table-border-color: $border-divider;
|
||||||
|
|
||||||
|
$table-striped-order: even;
|
||||||
|
|
||||||
|
$table-caption-color: var(--content-secondary);
|
||||||
|
|
||||||
// Forms
|
// Forms
|
||||||
|
|
||||||
// form-text-variables
|
// form-text-variables
|
||||||
@@ -214,3 +240,4 @@ $dropdown-padding-x: var(--spacing-02);
|
|||||||
$dropdown-padding-y: var(--spacing-02);
|
$dropdown-padding-y: var(--spacing-02);
|
||||||
$dropdown-item-padding-x: var(--spacing-04);
|
$dropdown-item-padding-x: var(--spacing-04);
|
||||||
$dropdown-item-padding-y: var(--spacing-05);
|
$dropdown-item-padding-y: var(--spacing-05);
|
||||||
|
$dropdown-header-color: var(--content-secondary);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
@import 'bootstrap-5/scss/images';
|
@import 'bootstrap-5/scss/images';
|
||||||
@import 'bootstrap-5/scss/containers';
|
@import 'bootstrap-5/scss/containers';
|
||||||
@import 'bootstrap-5/scss/grid';
|
@import 'bootstrap-5/scss/grid';
|
||||||
|
@import 'bootstrap-5/scss/tables';
|
||||||
@import 'bootstrap-5/scss/forms';
|
@import 'bootstrap-5/scss/forms';
|
||||||
@import 'bootstrap-5/scss/buttons';
|
@import 'bootstrap-5/scss/buttons';
|
||||||
@import 'bootstrap-5/scss/dropdown';
|
@import 'bootstrap-5/scss/dropdown';
|
||||||
|
|||||||
@@ -38,3 +38,19 @@ hr {
|
|||||||
.hidden-print {
|
.hidden-print {
|
||||||
@extend .d-print-none;
|
@extend .d-print-none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.row-spaced {
|
||||||
|
margin-top: var(--line-height-03);
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-spaced-small {
|
||||||
|
margin-top: calc(var(--line-height-03) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-spaced-large {
|
||||||
|
margin-top: calc(var(--line-height-03) * 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-spaced-extra-large {
|
||||||
|
margin-top: calc(var(--line-height-03) * 4);
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,3 +11,4 @@
|
|||||||
@import 'footer';
|
@import 'footer';
|
||||||
@import 'nav';
|
@import 'nav';
|
||||||
@import 'navbar';
|
@import 'navbar';
|
||||||
|
@import 'table';
|
||||||
|
|||||||
@@ -198,7 +198,8 @@
|
|||||||
|
|
||||||
// Set the visited colour for a link that is styled as a button. This is necessary because we have a generic rule that
|
// Set the visited colour for a link that is styled as a button. This is necessary because we have a generic rule that
|
||||||
// sets the colour of visited links
|
// sets the colour of visited links
|
||||||
a[role='button']:visited {
|
a[role='button']:visited,
|
||||||
|
a.btn:visited {
|
||||||
color: var(--bs-btn-color);
|
color: var(--bs-btn-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,12 @@
|
|||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropdown-header {
|
||||||
|
@include body-xs;
|
||||||
|
padding: var(--spacing-05) var(--spacing-06) var(--spacing-02)
|
||||||
|
var(--spacing-04);
|
||||||
|
}
|
||||||
|
|
||||||
.dropdown-menu {
|
.dropdown-menu {
|
||||||
@include shadow-md;
|
@include shadow-md;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
.table-container {
|
||||||
|
flex: 1;
|
||||||
|
margin-bottom: var(--spacing-06);
|
||||||
|
|
||||||
|
.table {
|
||||||
|
margin-bottom: initial;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-container-bordered {
|
||||||
|
--table-container-border-width: var(--bs-border-width);
|
||||||
|
|
||||||
|
border-color: $table-border-color;
|
||||||
|
border-radius: var(--border-radius-base);
|
||||||
|
border-width: var(--table-container-border-width);
|
||||||
|
border-style: solid;
|
||||||
|
|
||||||
|
.table {
|
||||||
|
th,
|
||||||
|
td {
|
||||||
|
&:first-child {
|
||||||
|
border-left-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-right-width: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tr:first-child {
|
||||||
|
border-top-width: 0;
|
||||||
|
|
||||||
|
th,
|
||||||
|
td {
|
||||||
|
&:first-child {
|
||||||
|
border-top-left-radius: calc(
|
||||||
|
var(--border-radius-base) - var(--table-container-border-width)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
th,
|
||||||
|
td {
|
||||||
|
&:last-child {
|
||||||
|
border-top-right-radius: calc(
|
||||||
|
var(--border-radius-base) - var(--table-container-border-width)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tr:last-child {
|
||||||
|
border-bottom-width: 0;
|
||||||
|
|
||||||
|
th,
|
||||||
|
td {
|
||||||
|
&:first-child {
|
||||||
|
border-bottom-left-radius: calc(
|
||||||
|
var(--border-radius-base) - var(--table-container-border-width)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
th,
|
||||||
|
td {
|
||||||
|
&:last-child {
|
||||||
|
border-bottom-right-radius: calc(
|
||||||
|
var(--border-radius-base) - var(--table-container-border-width)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
@import 'account-settings';
|
@import 'account-settings';
|
||||||
@import 'project-list-react';
|
@import 'project-list';
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
.project-list-react {
|
|
||||||
body > &.content {
|
|
||||||
padding-top: $header-height;
|
|
||||||
padding-bottom: 0;
|
|
||||||
min-height: calc(100vh - #{$header-height});
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.project-list-wrapper {
|
|
||||||
display: flex;
|
|
||||||
align-items: stretch;
|
|
||||||
width: 100%;
|
|
||||||
min-height: calc(100vh - #{$header-height});
|
|
||||||
}
|
|
||||||
|
|
||||||
.project-list-sidebar-wrapper-react {
|
|
||||||
position: relative;
|
|
||||||
background-color: var(--bg-dark-secondary);
|
|
||||||
flex: 0 0 15%;
|
|
||||||
min-height: calc(100vh - #{$header-height});
|
|
||||||
max-width: 320px;
|
|
||||||
min-width: 200px;
|
|
||||||
|
|
||||||
.project-list-sidebar-subwrapper {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.project-list-sidebar-react {
|
|
||||||
flex-grow: 1;
|
|
||||||
padding-left: var(--spacing-06);
|
|
||||||
padding-right: var(--spacing-06);
|
|
||||||
-ms-overflow-style: -ms-autohiding-scrollbar;
|
|
||||||
padding-top: var(--spacing-08);
|
|
||||||
padding-bottom: var(--spacing-08);
|
|
||||||
color: var(--neutral-40);
|
|
||||||
|
|
||||||
.small {
|
|
||||||
color: var(--neutral-40);
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
white-space: normal;
|
|
||||||
word-wrap: anywhere;
|
|
||||||
// prevents buttons from expanding sidebar width
|
|
||||||
}
|
|
||||||
|
|
||||||
> .dropdown {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.new-project-button {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.project-list-main-react {
|
|
||||||
flex: 1;
|
|
||||||
overflow-x: hidden;
|
|
||||||
padding: var(--spacing-08) var(--spacing-06);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,170 @@
|
|||||||
|
.project-list-empty-col {
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
flex-direction: column;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
.row:first-child {
|
||||||
|
flex-grow: 1; /* fill vertical space so notifications are pushed to bottom */
|
||||||
|
}
|
||||||
|
.card-body {
|
||||||
|
// h2 + .card-thin top padding
|
||||||
|
padding-bottom: calc(var(--line-height-03) + var(--line-height-03) / 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-list-react {
|
||||||
|
body > &.content {
|
||||||
|
padding-top: $header-height;
|
||||||
|
padding-bottom: 0;
|
||||||
|
min-height: calc(100vh - #{$header-height});
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-list-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: stretch;
|
||||||
|
width: 100%;
|
||||||
|
min-height: calc(100vh - #{$header-height});
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-list-sidebar-wrapper-react {
|
||||||
|
position: relative;
|
||||||
|
background-color: var(--bg-dark-secondary);
|
||||||
|
flex: 0 0 15%;
|
||||||
|
min-height: calc(100vh - #{$header-height});
|
||||||
|
max-width: 320px;
|
||||||
|
min-width: 200px;
|
||||||
|
|
||||||
|
.project-list-sidebar-subwrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.project-list-sidebar-react {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding-left: var(--spacing-06);
|
||||||
|
padding-right: var(--spacing-06);
|
||||||
|
-ms-overflow-style: -ms-autohiding-scrollbar;
|
||||||
|
padding-top: var(--spacing-08);
|
||||||
|
padding-bottom: var(--spacing-08);
|
||||||
|
color: var(--neutral-40);
|
||||||
|
|
||||||
|
.small {
|
||||||
|
color: var(--neutral-40);
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
white-space: normal;
|
||||||
|
word-wrap: anywhere;
|
||||||
|
// prevents buttons from expanding sidebar width
|
||||||
|
}
|
||||||
|
|
||||||
|
> .dropdown {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.new-project-button {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-list-welcome-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
padding-bottom: var(--spacing-08);
|
||||||
|
|
||||||
|
.welcome-new-wrapper {
|
||||||
|
.welcome-title {
|
||||||
|
@include heading-xl();
|
||||||
|
margin-top: var(--spacing-08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-message-cards-wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: var(--spacing-11);
|
||||||
|
|
||||||
|
@include media-breakpoint-up(lg) {
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-message-card {
|
||||||
|
border: 1px solid $bg-light-tertiary;
|
||||||
|
border-radius: $border-radius-large;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: var(--spacing-08) var(--spacing-06);
|
||||||
|
margin: var(--spacing-05) 0;
|
||||||
|
width: 280px;
|
||||||
|
height: 200px;
|
||||||
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
@include media-breakpoint-up(lg) {
|
||||||
|
margin: 0 var(--spacing-06);
|
||||||
|
height: 240px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: $bg-light-secondary;
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-message-card-img {
|
||||||
|
@include media-breakpoint-up(lg) {
|
||||||
|
margin-bottom: var(--spacing-07);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.create-new-project-dropdown {
|
||||||
|
transform: none !important;
|
||||||
|
top: 100% !important;
|
||||||
|
left: var(--spacing-06) !important;
|
||||||
|
right: var(--spacing-06) !important;
|
||||||
|
|
||||||
|
@include media-breakpoint-down(lg) {
|
||||||
|
left: 0 !important;
|
||||||
|
right: 0 !important;
|
||||||
|
margin-top: calc(var(--spacing-05) * -1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-message-card-link {
|
||||||
|
&,
|
||||||
|
&:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
color: $neutral-60;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-list-main-react {
|
||||||
|
flex: 1;
|
||||||
|
overflow-x: hidden;
|
||||||
|
padding: var(--spacing-08) var(--spacing-06);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-list-upload-project-modal-uppy-dashboard .uppy-Root {
|
||||||
|
.uppy-Dashboard-AddFiles-title {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
color: var(--neutral-60);
|
||||||
|
white-space: pre-line;
|
||||||
|
|
||||||
|
button.uppy-Dashboard-browse {
|
||||||
|
@extend .btn;
|
||||||
|
@extend .btn-lg;
|
||||||
|
@extend .btn-primary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -135,10 +135,12 @@ cite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Alignment
|
// Alignment
|
||||||
.text-left {
|
.text-left,
|
||||||
|
.text-start {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
.text-right {
|
.text-right,
|
||||||
|
.text-end {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.text-center {
|
.text-center {
|
||||||
@@ -151,7 +153,8 @@ cite {
|
|||||||
direction: rtl;
|
direction: rtl;
|
||||||
}
|
}
|
||||||
@media (min-width: @screen-md-min) {
|
@media (min-width: @screen-md-min) {
|
||||||
.text-md-right {
|
.text-md-right,
|
||||||
|
.text-lg-end {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,10 @@ describe('start free trial button', function () {
|
|||||||
cy.mount(
|
cy.mount(
|
||||||
<StartFreeTrialButton
|
<StartFreeTrialButton
|
||||||
source="cypress-test"
|
source="cypress-test"
|
||||||
buttonProps={{ bsStyle: 'danger', bsSize: 'lg' }}
|
buttonProps={{
|
||||||
|
variant: 'danger',
|
||||||
|
size: 'large',
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user