Skip to content

Commit

Permalink
chore(release): Test and deploy to Production v8.13.1 (#10617)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Krick <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: parabol-release-bot[bot] <150284312+parabol-release-bot[bot]@users.noreply.github.com>
Co-authored-by: Matt Krick <[email protected]>
Co-authored-by: Terry Acker <[email protected]>
Co-authored-by: Bruce Tian <[email protected]>
Co-authored-by: Nick O'Ferrall <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Georg Bremer <[email protected]>
Co-authored-by: snyk-bot <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Rafa <[email protected]>
Co-authored-by: Dale Bumblis <[email protected]>
Co-authored-by: Sven Seeberg <[email protected]>
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
14 people authored Dec 18, 2024
1 parent ab3dac6 commit f6ea5e4
Show file tree
Hide file tree
Showing 64 changed files with 3,715 additions and 506 deletions.
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.13.0"
".": "8.13.1"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).

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

## [8.13.1](https://github.com/ParabolInc/parabol/compare/v8.13.0...v8.13.1) (2024-12-18)


### Changed

* Mattermost plugin module federation ([#10517](https://github.com/ParabolInc/parabol/issues/10517)) ([79fd8a2](https://github.com/ParabolInc/parabol/commit/79fd8a212d51dda6cc3951b9ed91c87d0a24d6bd))
* migrate existing comments to TipTap ([#10584](https://github.com/ParabolInc/parabol/issues/10584)) ([d136564](https://github.com/ParabolInc/parabol/commit/d1365646831a9720836d49e1011446e423b5a12e))

## [8.13.0](https://github.com/ParabolInc/parabol/compare/v8.12.4...v8.13.0) (2024-12-17)


Expand Down
10 changes: 6 additions & 4 deletions 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.13.0",
"version": "8.13.1",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
Expand Down Expand Up @@ -69,7 +69,8 @@
"git-url-parse": "12.0.0",
"fbjs": "^3.0.0",
"parse-url": "^8.1.0",
"recursive-readdir": "^2.2.3"
"recursive-readdir": "^2.2.3",
"axios": "^1.7.8"
},
"devDependencies": {
"@babel/core": "^7.20.12",
Expand Down Expand Up @@ -117,7 +118,7 @@
"prettier-plugin-organize-imports": "^4.0.0",
"prettier-plugin-tailwindcss": "^0.5.13",
"raw-loader": "^4.0.2",
"relay-compiler": "^18.0.0",
"relay-compiler": "^18.2.0",
"relay-config": "^12.0.1",
"sucrase": "^3.35.0",
"tailwindcss": "^3.2.7",
Expand All @@ -127,12 +128,13 @@
"typescript-eslint": "^8.3.0",
"vscode-apollo-relay": "^1.5.0",
"webpack": "^5.89.0",
"webpack-cli": "4.9.1",
"webpack-cli": "5.1.4",
"workbox-webpack-plugin": "^6.5.4",
"yargs": "^17.7.2",
"yarn-deduplicate": "^3.1.0"
},
"dependencies": {
"@module-federation/enhanced": "^0.7.6",
"dotenv": "8.0.0",
"dotenv-expand": "5.1.0",
"lodash.toarray": "^4.4.0",
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.13.0",
"version": "8.13.1",
"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.13.0"
"parabol-server": "8.13.1"
}
}
2 changes: 1 addition & 1 deletion packages/client/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.13.0",
"version": "8.13.1",
"repository": {
"type": "git",
"url": "https://github.com/ParabolInc/parabol"
Expand Down
2 changes: 1 addition & 1 deletion packages/embedder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parabol-embedder",
"version": "8.13.0",
"version": "8.13.1",
"description": "A service that computes embedding vectors from Parabol objects",
"author": "Jordan Husney <[email protected]>",
"homepage": "https://github.com/ParabolInc/parabol/tree/master/packages/embedder#readme",
Expand Down
6 changes: 3 additions & 3 deletions packages/gql-executor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gql-executor",
"version": "8.13.0",
"version": "8.13.1",
"description": "A Stateless GraphQL Executor",
"author": "Matt Krick <[email protected]>",
"homepage": "https://github.com/ParabolInc/parabol/tree/master/packages/gqlExecutor#readme",
Expand All @@ -25,8 +25,8 @@
},
"dependencies": {
"dd-trace": "^5.0.0",
"parabol-client": "8.13.0",
"parabol-server": "8.13.0",
"parabol-client": "8.13.1",
"parabol-server": "8.13.1",
"undici": "^5.26.2"
}
}
2 changes: 1 addition & 1 deletion packages/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "integration-tests",
"author": "Parabol Inc. <[email protected]> (http://github.com/ParabolInc)",
"license": "AGPL-3.0",
"version": "8.13.0",
"version": "8.13.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions packages/mattermost-plugin/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__generated__/*
97 changes: 97 additions & 0 deletions packages/mattermost-plugin/Atmosphere.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import {Variables} from 'react-relay'
import {
Environment,
Network,
Observable,
RecordSource,
RelayFeatureFlags,
RelayFieldLogger,
RequestParameters
} from 'relay-runtime'
import RelayModernStore from 'relay-runtime/lib/store/RelayModernStore'

import {AnyAction, Store} from '@reduxjs/toolkit'
import {Client4} from 'mattermost-redux/client'
import {GlobalState} from 'mattermost-redux/types/store'
RelayFeatureFlags.ENABLE_RELAY_RESOLVERS = true

type State = {
authToken: string | null
serverUrl: string
store: Store<GlobalState, AnyAction>
}

const fetchFunction = (state: State) => (params: RequestParameters, variables: Variables) => {
const {serverUrl, authToken} = state
const response = fetch(
serverUrl,
Client4.getOptions({
method: 'POST',
headers: {
accept: 'application/json',
'content-type': 'application/json',
'x-application-authorization': authToken ? `Bearer ${authToken}` : ''
},
body: JSON.stringify({
type: 'start',
payload: {
documentId: params.id,
query: params.text,
variables
}
})
})
)

return Observable.from(
response.then(async (data) => {
const json = await data.json()
return json.payload
})
)
}

const relayFieldLogger: RelayFieldLogger = (event) => {
if (event.kind === 'relay_resolver.error') {
console.warn(`Resolver error encountered in ${event.owner}.${event.fieldPath}`)
console.warn(event.error)
}
}

export type ResolverContext = {
serverUrl: string
store: Store<GlobalState, AnyAction>
}

export class Atmosphere extends Environment {
state: State

constructor(serverUrl: string, reduxStore: Store<GlobalState, AnyAction>) {
const state = {
serverUrl: serverUrl + '/graphql',
store: reduxStore,
authToken: null
}

const network = Network.create(fetchFunction(state))
const relayStore = new RelayModernStore(new RecordSource(), {
resolverContext: {
store: reduxStore,
serverUrl
}
})
super({
store: relayStore,
network,
relayFieldLogger
})
this.state = state
}
}

/**
* Creates a new Relay environment instance for managing (fetching, storing) GraphQL data.
*/
export function createEnvironment(serverUrl: string, reduxStore: Store<GlobalState, AnyAction>) {
return new Atmosphere(serverUrl, reduxStore)
}
41 changes: 41 additions & 0 deletions packages/mattermost-plugin/AtmosphereProvider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import {Client4} from 'mattermost-redux/client'
import {ReactNode, useCallback, useEffect} from 'react'
import {useSelector} from 'react-redux'
import {RelayEnvironmentProvider} from 'react-relay'
import {Atmosphere} from './Atmosphere'
import {getPluginServerRoute} from './selectors'

type Props = {
environment: Atmosphere
children: ReactNode
}

export default function AtmosphereProvider({environment, children}: Props) {
const pluginServerRoute = useSelector(getPluginServerRoute)
const serverUrl = `${pluginServerRoute}/login`
const login = useCallback(async () => {
const response = await fetch(
serverUrl,
Client4.getOptions({
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
})
)
const body = await response.json()
environment.state.authToken = body.authToken
}, [serverUrl])

useEffect(() => {
if (!environment.state.authToken) {
login()
}
}, [environment.state.authToken, login])

if (!environment.state.authToken) {
return null
}

return <RelayEnvironmentProvider environment={environment}>{children}</RelayEnvironmentProvider>
}
6 changes: 6 additions & 0 deletions packages/mattermost-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# `Mattermost Plugin`

The Mattermost plugin itself lives in [ParabolInc/parabol-mattermost-plugin](https://github.com/ParabolInc/parabol-mattermost-plugin).
It needs to be installed to the Mattermost server and configured to point to the Parabol instance.
It then loads the code in this package via Webpacks module federation.

116 changes: 116 additions & 0 deletions packages/mattermost-plugin/components/LinkTeamModal/LinkTeamModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
import graphql from 'babel-plugin-relay/macro'
import React, {useEffect} from 'react'
import {Modal} from 'react-bootstrap'
import {useDispatch, useSelector} from 'react-redux'

import {useLazyLoadQuery} from 'react-relay'
import {LinkTeamModalQuery} from '../../__generated__/LinkTeamModalQuery.graphql'
import {useConfig} from '../../hooks/useConfig'
import {useCurrentChannel} from '../../hooks/useCurrentChannel'
import {useLinkTeam} from '../../hooks/useLinkTeam'
import {closeLinkTeamModal} from '../../reducers'
import {getAssetsUrl, isLinkTeamModalVisible} from '../../selectors'
import Select from '../Select'

const LinkTeamModal = () => {
const isVisible = useSelector(isLinkTeamModalVisible)
const channel = useCurrentChannel()
const config = useConfig()
const data = useLazyLoadQuery<LinkTeamModalQuery>(
graphql`
query LinkTeamModalQuery($channel: ID!) {
viewer {
linkedTeamIds(channel: $channel)
teams {
id
name
}
}
}
`,
{
channel: channel.id
}
)
const viewer = data.viewer
const unlinkedTeams = viewer.teams.filter((team) => !viewer.linkedTeamIds?.includes(team.id))
const linkTeam = useLinkTeam()

const [selectedTeam, setSelectedTeam] = React.useState<(typeof data.viewer.teams)[number]>()

useEffect(() => {
if (!selectedTeam && unlinkedTeams && unlinkedTeams.length > 0) {
setSelectedTeam(unlinkedTeams[0])
}
}, [unlinkedTeams, selectedTeam])

const dispatch = useDispatch()

const handleClose = () => {
dispatch(closeLinkTeamModal())
}

const handleLink = async () => {
if (!selectedTeam) {
return
}
await linkTeam(selectedTeam.id)
handleClose()
}

const assetsPath = useSelector(getAssetsUrl)

if (!isVisible) {
return null
}

return (
<Modal
dialogClassName='modal--scroll'
show={true}
onHide={handleClose}
onExited={handleClose}
bsSize='large'
backdrop='static'
>
<Modal.Header closeButton={true}>
<Modal.Title>
<img width={36} height={36} src={`${assetsPath}/parabol.png`} />
{` Link a Parabol Team to ${channel.name}`}
</Modal.Title>
</Modal.Header>
<Modal.Body>
{unlinkedTeams && unlinkedTeams.length > 0 ? (
<>
<Select
label='Choose Parabol Team'
required={true}
value={selectedTeam}
options={unlinkedTeams}
onChange={setSelectedTeam}
/>
</>
) : (
<>
<div>
<p>
All your teams are already linked to this channel. Visit{' '}
<a href={`${config?.parabolUrl}/newteam/`}>Parabol</a> to create new teams.
</p>
</div>
</>
)}
</Modal.Body>
<Modal.Footer>
<button className='btn btn-tertiary cancel-button' onClick={handleClose}>
Cancel
</button>
<button className='btn btn-primary save-button' onClick={handleLink}>
Link Team
</button>
</Modal.Footer>
</Modal>
)
}

export default LinkTeamModal
Loading

0 comments on commit f6ea5e4

Please sign in to comment.