forked from RocketChat/Rocket.Chat.PWA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'PWA' into channel-component
# Conflicts: # package.json # src/app/app.module.ts # src/app/components/login-page/login-page.component.scss # src/app/components/login-page/login-page.component.ts
- Loading branch information
Showing
15 changed files
with
1,111 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,5 @@ | ||
# RocketchatPwa | ||
# Rocketchat Pwa | ||
|
||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.4. | ||
Rocketchat progressive web app built on Angular and apollo graphql stack . | ||
|
||
## Development server | ||
|
||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. | ||
|
||
## Code scaffolding | ||
|
||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|module`. | ||
|
||
## Build | ||
|
||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. | ||
|
||
## Running unit tests | ||
|
||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
|
||
## Running end-to-end tests | ||
|
||
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). | ||
Before running the tests make sure you are serving the app via `ng serve`. | ||
|
||
## Further help | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). | ||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli). |
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,36 @@ | ||
{ | ||
|
||
"README_schema" : "Specifies how to load the GraphQL schema that completion, error highlighting, and documentation is based on in the IDE", | ||
"schema": { | ||
|
||
"README_file" : "Remove 'file' to use request url below. A relative or absolute path to the JSON from a schema introspection query, e.g. '{ data: ... }'. Changes to the file are watched.", | ||
"README_request" : "To request the schema from a url instead, remove the 'file' JSON property above (and optionally delete the default graphql.schema.json file).", | ||
"request": { | ||
"url" : "http://localhost:3000/graphql", | ||
"method" : "POST", | ||
"README_postIntrospectionQuery" : "Whether to POST an introspectionQuery to the url. If the url always returns the schema JSON, set to false and consider using GET", | ||
"postIntrospectionQuery" : true, | ||
"README_options" : "See the 'Options' section at https://github.com/then/then-request", | ||
"options" : { | ||
"headers": { | ||
"user-agent" : "JS GraphQL" | ||
} | ||
} | ||
} | ||
|
||
}, | ||
|
||
"README_endpoints": "A list of GraphQL endpoints that can be queried from '.graphql' files in the IDE", | ||
"endpoints" : [ | ||
{ | ||
"name": "Default (http://localhost:3000/graphql)", | ||
"url": "http://localhost:3000/graphql", | ||
"options" : { | ||
"headers": { | ||
"user-agent" : "JS GraphQL" | ||
} | ||
} | ||
} | ||
] | ||
|
||
} |
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,27 @@ | ||
import * as express from 'express'; | ||
import * as bodyParser from 'body-parser'; | ||
import * as cors from 'cors'; | ||
import { graphiqlExpress, graphqlExpress } from 'graphql-server-express'; | ||
import { addMockFunctionsToSchema, makeExecutableSchema } from 'graphql-tools'; | ||
import Schema from './schema'; | ||
|
||
const PORT = 3000; | ||
|
||
const executableSchema = makeExecutableSchema({ | ||
typeDefs: Schema, | ||
logger: { log: (e) => console.log(e) }, | ||
}); | ||
// Add mocks, modifies schema in place | ||
addMockFunctionsToSchema({ schema: executableSchema }); | ||
|
||
const app = express(); | ||
app.use(cors()); | ||
app.use('/graphql', bodyParser.json(), graphqlExpress({ | ||
schema : executableSchema, | ||
debug : true, | ||
})); | ||
app.use('/graphiql', graphiqlExpress({ | ||
endpointURL : '/graphql', | ||
})); | ||
|
||
app.listen(PORT, () => console.log('Mock server running on: ' + PORT)); |
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,172 @@ | ||
export default ` | ||
type scheme { | ||
query: Query | ||
mutation: Mutation | ||
} | ||
type Mutation { | ||
leaveChannel(channelId: String!): Boolean | ||
hideChannel(channelId: String!): Boolean | ||
setStatus(status: UserStatus!): User | ||
logout: Boolean #JSAccount | ||
createChannel(name: String!, private: Boolean = false, readOnly: Boolean = false, membersId: [String!]): Channel | ||
sendMessage(channelId: String!, messageInput: MessageInput!): Message | ||
deleteMessage(messageId: MessageIdentifier!): Boolean | ||
editMessage(messageId: MessageIdentifier!, messageInput: MessageInput!): Message | ||
addReactionToMassage(messageId: MessageIdentifier!, icon: String!): Message | ||
updateUserSettings(userSettings: UserSettings): User | ||
#updateUserChannelSettings(channelId: String!,settings: ChannelSettings ) | ||
} | ||
type Query { | ||
me: User | ||
messages(channelId: String!, paginationId: String, count: Int, SearchRegex: String): [Message] | ||
channelsByUser(userId: String): [Channel] | ||
channels(filter: ChannelFilter = {privacy: ALL, joinedChannels: false, sortBy: NAME}): [Channel] | ||
} | ||
input ChannelFilter { | ||
nameFilter: String | ||
privacy: Privacy | ||
joinedChannels: Boolean | ||
sortBy: ChannelSort | ||
} | ||
enum Privacy { | ||
PRIVATE | ||
PUBLIC | ||
ALL | ||
} | ||
enum ChannelSort { | ||
NAME | ||
NUMBER_OF_MESSAGES | ||
} | ||
type Message { | ||
id: String! | ||
user: User! | ||
content: String! | ||
creationTime: String! | ||
fromServer: Boolean #when user joins a channel we get a message from server - text is grey | ||
tags: [String] | ||
userRef: [User] | ||
channelRef: [Channel] | ||
reactions: [Reaction] | ||
} | ||
input MessageInput { | ||
content: String! | ||
userRef: [String] #userId | ||
channelRef: [String] #channelId | ||
} | ||
input MessageIdentifier { | ||
channelId: String! | ||
messageId: String! | ||
} | ||
type Reaction { | ||
username: String! | ||
icon: String! | ||
} | ||
type User { | ||
username: String! | ||
status: UserStatus | ||
email: String! | ||
avatar: String | ||
name: String | ||
lastLogin: String | ||
userPreferences: UserPreferences! | ||
channels: [Channel] | ||
directMessages: [Channel] | ||
} | ||
enum UserStatus { | ||
ONLINE | ||
AWAY | ||
BUSY | ||
INVISIBLE | ||
} | ||
type UserPreferences { | ||
language: String | ||
notificationDuration: Float | ||
unreadTrayIconAlert: Boolean | ||
useEmojis: Boolean | ||
convertAsciiToEmoji: Boolean | ||
autoLoadImages: Boolean | ||
saveMobileBandwith: Boolean | ||
collapseEmbeddedMeida: Boolean | ||
unreadRoomsMode: Boolean | ||
hideUserName: Boolean | ||
hideRoles: Boolean | ||
hideRightSideBarWithClick: Boolean | ||
hideAvatars: Boolean | ||
mergePrivateGroupsWithChannels: Boolean | ||
enterKeyBehaviour: String | ||
viewMode: String | ||
offlineEmailNotifications: String | ||
highlights: String | ||
newRoomNotificationSound: String | ||
newMessageNotificationSound: String | ||
} | ||
input UserSettings { | ||
language: String | ||
notificationDuration: Float | ||
unreadTrayIconAlert: Boolean | ||
useEmojis: Boolean | ||
convertAsciiToEmoji: Boolean | ||
autoLoadImages: Boolean | ||
saveMobileBandwith: Boolean | ||
collapseEmbeddedMeida: Boolean | ||
unreadRoomsMode: Boolean | ||
hideUserName: Boolean | ||
hideRoles: Boolean | ||
hideRightSideBarWithClick: Boolean | ||
hideAvatars: Boolean | ||
mergePrivateGroupsWithChannels: Boolean | ||
enterKeyBehaviour: String | ||
viewMode: String | ||
offlineEmailNotifications: String | ||
highlights: String | ||
newRoomNotificationSound: String | ||
newMessageNotificationSound: String | ||
email: String | ||
avatar: String | ||
name: String | ||
} | ||
type ChannelSettings { | ||
disableNotification: Boolean | ||
audio: String | ||
desktop: String | ||
duration: Int | ||
mobile: String | ||
mail: String | ||
hideUnreadRoomStatus : Boolean | ||
unreadTrayIconAlert: String | ||
} | ||
type Channel { | ||
id: String! | ||
title: String! | ||
# topic: TODO | ||
# userNotificationSettings: ChannelSettings | ||
description: String! | ||
announcement: String! | ||
numberOfMembers: Int! | ||
members: [User] | ||
owners: [User] | ||
direct: Boolean | ||
private: Boolean | ||
readOnly: Boolean | ||
archived: Boolean | ||
favorite: Boolean | ||
unseenMessages: Int | ||
} | ||
`; |
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.