Skip to content

Commit

Permalink
Merge branch 'master' into feat/pages
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkrick committed Feb 19, 2025
2 parents c32df25 + e8c4e70 commit b804544
Show file tree
Hide file tree
Showing 31 changed files with 549 additions and 127 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ironbank.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ jobs:
env:
CLOUDSDK_AUTH_ACCESS_TOKEN: "${{ steps.auth.outputs.access_token }}"
with:
args: storage cp ${{ github.event.inputs.version_number }}.zip gs://ironbank-proving-ground/${{ github.event.inputs.version_number }}.zip
args: storage cp ${{ github.event.inputs.version_number }}.zip gs://parabol-ironbank-resources/${{ github.event.inputs.version_number }}.zip
cli: gcloud
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "8.26.3"
".": "8.27.2"
}
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,38 @@ This project adheres to [Semantic Versioning](http://semver.org/).

This CHANGELOG follows conventions [outlined here](http://keepachangelog.com/).

## [8.27.2](https://github.com/ParabolInc/parabol/compare/v8.27.1...v8.27.2) (2025-02-19)


### Fixed

* Increase integration OAuth2 access token size ([#10892](https://github.com/ParabolInc/parabol/issues/10892)) ([c0134ef](https://github.com/ParabolInc/parabol/commit/c0134ef0d35da2e12b919c752c044d3a24d65e59))

## [8.27.1](https://github.com/ParabolInc/parabol/compare/v8.27.0...v8.27.1) (2025-02-18)


### Fixed

* Show error message when failing to integrate with Azure DevOps ([#10888](https://github.com/ParabolInc/parabol/issues/10888)) ([f2d530d](https://github.com/ParabolInc/parabol/commit/f2d530d701563011096cabd81f03f64205061aac))

## [8.27.0](https://github.com/ParabolInc/parabol/compare/v8.26.3...v8.27.0) (2025-02-18)


### Added

* **Mattermost Plugin:** TipTap link menu ([#10863](https://github.com/ParabolInc/parabol/issues/10863)) ([5593b75](https://github.com/ParabolInc/parabol/commit/5593b75b6b74a3b3fcd777925e1a09e1506ea239))


### Fixed

* empty discussion stages ([#10836](https://github.com/ParabolInc/parabol/issues/10836)) ([2b4d134](https://github.com/ParabolInc/parabol/commit/2b4d134f33316bc7ccb8cfb82ceefc7aafd720e3))
* Failed to execute `removeChild` ([#10886](https://github.com/ParabolInc/parabol/issues/10886)) ([ddff9dd](https://github.com/ParabolInc/parabol/commit/ddff9ddae059edd0c5d18247561276eda75a4d7b))


### Changed

* update target GCS bucket for IB action ([#10882](https://github.com/ParabolInc/parabol/issues/10882)) ([3fb8e5c](https://github.com/ParabolInc/parabol/commit/3fb8e5ce5e561bda44d967639a85753fb2caf9c7))

## [8.26.3](https://github.com/ParabolInc/parabol/compare/v8.26.2...v8.26.3) (2025-02-14)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "An open-source app for building smarter, more agile teams.",
"author": "Parabol Inc. <[email protected]> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "8.26.3",
"version": "8.27.2",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
Expand Down
4 changes: 2 additions & 2 deletions packages/chronos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chronos",
"version": "8.26.3",
"version": "8.27.2",
"description": "A cron job scheduler",
"author": "Matt Krick <[email protected]>",
"homepage": "https://github.com/ParabolInc/parabol/tree/master/packages/chronos#readme",
Expand All @@ -25,6 +25,6 @@
},
"dependencies": {
"cron": "^2.3.1",
"parabol-server": "8.26.3"
"parabol-server": "8.27.2"
}
}
14 changes: 11 additions & 3 deletions packages/client/components/RetroGroupPhase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ const RetroGroupPhase = (props: Props) => {
id
endedAt
showSidebar
localStage {
isComplete
phaseType
}
autogroupReflectionGroups {
groupTitle
}
Expand All @@ -78,9 +82,11 @@ const RetroGroupPhase = (props: Props) => {
showSidebar,
organization,
autogroupReflectionGroups,
resetReflectionGroups
resetReflectionGroups,
localStage
} = meeting
const {useAI, tier} = organization
const isGroupPhaseActive = localStage?.phaseType === 'group' && !localStage?.isComplete
const {openTooltip, closeTooltip, tooltipPortal, originRef} = useTooltip<HTMLDivElement>(
MenuPosition.UPPER_CENTER
)
Expand Down Expand Up @@ -119,7 +125,7 @@ const RetroGroupPhase = (props: Props) => {
(showSuggestGroups ? (
<ButtonWrapper>
<StyledButton
disabled={!autogroupReflectionGroups?.length}
disabled={!autogroupReflectionGroups?.length || !isGroupPhaseActive}
onClick={handleAutoGroupClick}
>
{'Suggest Groups ✨'}
Expand All @@ -135,7 +141,9 @@ const RetroGroupPhase = (props: Props) => {
</ButtonWrapper>
) : (
<ButtonWrapper>
<StyledButton onClick={handleResetGroupsClick}>{'Reset Groups'}</StyledButton>
<StyledButton disabled={!isGroupPhaseActive} onClick={handleResetGroupsClick}>
{'Reset Groups'}
</StyledButton>
<div
onMouseEnter={openTooltip}
onMouseLeave={closeTooltip}
Expand Down
69 changes: 38 additions & 31 deletions packages/client/components/promptResponse/StandardBubbleMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,44 @@ export const StandardBubbleMenu = (props: Props) => {
editor.emit('linkStateChange', {editor, linkState: 'edit'})
}

// wrapping in div is necessary, https://github.com/ueberdosis/tiptap/issues/3784
return (
<BubbleMenu editor={editor} tippyOptions={{duration: 100}} shouldShow={shouldShowBubbleMenu}>
<div className='flex items-center rounded-sm border-[1px] border-solid border-slate-600 bg-white p-[3px]'>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleBold().run()}
isActive={editor.isActive('bold')}
>
<b>B</b>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleItalic().run()}
isActive={editor.isActive('italic')}
>
<i>I</i>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleUnderline().run()}
isActive={editor.isActive('underline')}
>
<u>U</u>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleStrike().run()}
isActive={editor.isActive('strike')}
>
<s>S</s>
</BubbleMenuButton>
<BubbleMenuButton onClick={openLinkEditor}>
<Link className='h-[18px] w-[18px]' />
</BubbleMenuButton>
</div>
</BubbleMenu>
<div>
<BubbleMenu
editor={editor}
tippyOptions={{duration: 100, role: 'dialog'}}
shouldShow={shouldShowBubbleMenu}
>
<div className='flex items-center rounded-sm border-[1px] border-solid border-slate-600 bg-white p-[3px]'>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleBold().run()}
isActive={editor.isActive('bold')}
>
<b>B</b>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleItalic().run()}
isActive={editor.isActive('italic')}
>
<i>I</i>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleUnderline().run()}
isActive={editor.isActive('underline')}
>
<u>U</u>
</BubbleMenuButton>
<BubbleMenuButton
onClick={() => editor.chain().focus().toggleStrike().run()}
isActive={editor.isActive('strike')}
>
<s>S</s>
</BubbleMenuButton>
<BubbleMenuButton onClick={openLinkEditor}>
<Link className='h-[18px] w-[18px]' />
</BubbleMenuButton>
</div>
</BubbleMenu>
</div>
)
}
62 changes: 5 additions & 57 deletions packages/client/components/promptResponse/TipTapLinkMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
import * as Popover from '@radix-ui/react-popover'
import type {EditorEvents} from '@tiptap/core'
import {Editor, getMarkRange, getMarkType, getTextBetween, useEditorState} from '@tiptap/react'
import {Editor, getTextBetween, useEditorState} from '@tiptap/react'
import {useCallback, useEffect, useRef, useState} from 'react'
import {TipTapLinkEditor} from './TipTapLinkEditor'
import {TipTapLinkPreview} from './TipTapLinkPreview'
import {getRangeForType, LinkMenuState} from './TiptapLinkExtension'

const getContent = (editor: Editor, typeOrName: string) => {
const range = getRangeForType(editor, typeOrName)
const range = getRangeForType(editor.state, typeOrName)
if (!range) return ''
return getTextBetween(editor.state.doc, range)
}

const getRangeForType = (editor: Editor, typeOrName: string) => {
const {state} = editor
const {selection, schema} = state
const {$from} = selection
const type = getMarkType(typeOrName, schema)
return getMarkRange($from, type)
}

export type LinkMenuState = 'preview' | 'edit' | null
interface Props {
editor: Editor
useLinkEditor?: () => void
Expand Down Expand Up @@ -69,57 +61,13 @@ export const TipTapLinkMenu = (props: Props) => {

const onSetLink = useCallback(
({text, url}: {text: string; url: string}) => {
const range = getRangeForType(editor, 'link')
if (!range) {
const {state} = editor
const {selection} = state
const {from} = selection
const nextTo = from + text.length
// adding a new link
editor
.chain()
.focus()
.command(({tr}) => {
tr.insertText(text)
return true
})
.setTextSelection({
from,
to: nextTo
})
.setLink({href: url, target: '_blank'})
.setTextSelection({from: nextTo, to: nextTo})
.run()
return
}
const {from} = range
const to = from + text.length
editor
.chain()
.focus()
.setTextSelection(range)
.insertContent(text)
.setTextSelection({
from,
to
})
.setLink({href: url, target: '_blank'})
.setTextSelection({from: to, to})
.run()
editor.commands.upsertLink({text, url})
setLinkState(null)
},
[editor]
)
const onUnsetLink = useCallback(() => {
const range = getRangeForType(editor, 'link')
if (!range) return
editor
.chain()
.focus()
.extendMarkRange('link')
.unsetLink()
.setTextSelection({from: range.to, to: range.to})
.run()
editor.commands.removeLink()
setLinkState(null)
}, [editor])
const onOpenChange = (willOpen: boolean) => {
Expand Down
77 changes: 74 additions & 3 deletions packages/client/components/promptResponse/TiptapLinkExtension.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
import {mergeAttributes, type Editor} from '@tiptap/core'
import {getMarkRange, getMarkType, mergeAttributes, type Editor} from '@tiptap/core'
import BaseLink from '@tiptap/extension-link'
import {Plugin} from '@tiptap/pm/state'
import {LinkMenuState} from './TipTapLinkMenu'
import {EditorState, Plugin} from '@tiptap/pm/state'

export type LinkMenuState = 'preview' | 'edit' | null

declare module '@tiptap/core' {
interface EditorEvents {
linkStateChange: {editor: Editor; linkState: LinkMenuState}
}

interface Commands<ReturnType> {
upsertLink: {
upsertLink: (link: {text: string; url: string}) => ReturnType
}
removeLink: {
removeLink: () => ReturnType
}
}
}

export const getRangeForType = (state: EditorState, typeOrName: string) => {
const {selection, schema} = state
const {$from} = selection
const type = getMarkType(typeOrName, schema)
return getMarkRange($from, type)
}

export const TiptapLinkExtension = BaseLink.extend({
Expand All @@ -20,6 +37,60 @@ export const TiptapLinkExtension = BaseLink.extend({
}
}
},
addCommands(this) {
return {
...this.parent?.(),
upsertLink:
({text, url}) =>
({chain, state}) => {
const range = getRangeForType(state, 'link')
if (!range) {
const {selection} = state
const {from} = selection
const nextTo = from + text.length
// adding a new link
return chain()
.focus()
.command(({tr}) => {
tr.insertText(text)
return true
})
.setTextSelection({
from,
to: nextTo
})
.setLink({href: url, target: '_blank'})
.setTextSelection({from: nextTo, to: nextTo})
.run()
}
const {from} = range
const to = from + text.length
return chain()
.focus()
.setTextSelection(range)
.insertContent(text)
.setTextSelection({
from,
to
})
.setLink({href: url, target: '_blank'})
.setTextSelection({from: to, to})
.run()
},
removeLink:
() =>
({state, chain}) => {
const range = getRangeForType(state, 'link')
if (!range) return false
return chain()
.focus()
.extendMarkRange('link')
.unsetLink()
.setTextSelection({from: range.to, to: range.to})
.run()
}
}
},
parseHTML() {
return [{tag: 'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const AzureDevOpsProviderRow = (props: Props) => {
viewerRef
)
const atmosphere = useAtmosphere()
const {submitting, submitMutation, onError, onCompleted} = useMutationProps()
const {submitting, submitMutation, error, onError, onCompleted} = useMutationProps()
const mutationProps = {submitting, submitMutation, onError, onCompleted} as MenuMutationProps
const {teamMember} = viewer
const {integrations} = teamMember!
Expand All @@ -78,6 +78,7 @@ const AzureDevOpsProviderRow = (props: Props) => {
providerName={Providers.AZUREDEVOPS_NAME}
providerDescription={Providers.AZUREDEVOPS_DESC}
providerLogo={<AzureDevOpsProviderLogo />}
error={error?.message}
/>
{menuPortal(
<AzureDevOpsConfigMenu
Expand Down
Loading

0 comments on commit b804544

Please sign in to comment.