This repository has been archived by the owner on Oct 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'alpha' of github.com:withspectrum/spectrum into 2.2.8
- Loading branch information
Showing
111 changed files
with
3,257 additions
and
1,792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// @flow | ||
import { getManyMessages } from '../models/message'; | ||
import createLoader from './create-loader'; | ||
import type { Loader } from './types'; | ||
|
||
export const __createMessageLoader = createLoader((messages: string[]) => | ||
getManyMessages(messages) | ||
); | ||
|
||
export default () => { | ||
throw new Error( | ||
'⚠️ Do not import loaders directly, get them from the GraphQL context instead! ⚠️' | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// @flow | ||
import type { DBMessage } from 'shared/types'; | ||
import type { GraphQLContext } from '../../'; | ||
|
||
export default ( | ||
{ parentId }: DBMessage, | ||
_: void, | ||
{ loaders }: GraphQLContext | ||
) => { | ||
if (!parentId) return null; | ||
return loaders.message.load(parentId); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
// @flow | ||
import { getMessage } from '../../models/message'; | ||
import type { GraphQLContext } from '../../'; | ||
|
||
export default (_: any, { id }: { id: string }) => getMessage(id); | ||
export default (_: any, { id }: { id: string }, { loaders }: GraphQLContext) => | ||
loaders.message.load(id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import data from '../../shared/testing/data'; | ||
|
||
const thread = data.threads[0]; | ||
const community = data.communities.find( | ||
community => community.id === thread.communityId | ||
); | ||
const author = data.users.find(user => user.id === thread.creatorId); | ||
|
||
describe('/messages/new', () => { | ||
beforeEach(() => { | ||
cy.auth(author.id); | ||
cy.visit('/messages/new'); | ||
}); | ||
|
||
it('should allow to continue composing message incase of crash or reload', () => { | ||
const newMessage = 'Persist New Message'; | ||
cy.get('[contenteditable="true"]').type(newMessage); | ||
cy.get('[contenteditable="true"]').contains(newMessage); | ||
|
||
cy.wait(2000); | ||
// Reload page(incase page closed or crashed ,reload should have same effect) | ||
cy.reload(); | ||
cy.get('[contenteditable="true"]').contains(newMessage); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.