Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
717f4c1
perf(exm): add sidebar and refactor home page
Apr 11, 2023
509278c
pref(exm): move files into folder
Apr 12, 2023
17435de
Merge branch 'dev' of github.com:erxes/erxes-community into perf-exm-…
Apr 12, 2023
7f50f6d
move exm to outside
Apr 17, 2023
3ee9ee2
Merge branch 'dev' of github.com:erxes/erxes-community into perf-exm-…
Apr 18, 2023
31dc72d
remove console.log
Apr 18, 2023
5289e45
add some change
Apr 19, 2023
20d025f
add signin page
Apr 19, 2023
492f007
add sidebar
Apr 19, 2023
961797d
add search
Apr 19, 2023
6d8358e
fix topbar
Apr 19, 2023
1ba0ddf
update feed form
Apr 20, 2023
8086ece
fix form
Apr 20, 2023
2d6b70a
add right sidebar
Apr 20, 2023
e006d73
add contact list
Apr 23, 2023
082ce5f
add exm learn
Apr 24, 2023
7c99278
Merge branch 'dev' of github.com:erxes/erxes-community into perf-exm-…
Apr 24, 2023
4ed32ac
add chats
ariunzayarin May 23, 2023
a4e841a
fix conflict
Jul 24, 2023
2af4ca8
fix apollo path
Jul 24, 2023
35f9092
fix yarn build errors
Jul 24, 2023
c1129f6
add exm workflow
Jul 24, 2023
a20f73d
update exm workflow
Jul 24, 2023
826a4d3
fix import
Jul 24, 2023
4c24fc7
fix .yaml
Jul 24, 2023
391bc06
fix .yaml
Jul 24, 2023
f96611f
remove all react-router-dom
Jul 24, 2023
9cc648b
add lodash
Jul 24, 2023
a855981
add lodash
Jul 24, 2023
328388d
update yarn.lock
Jul 24, 2023
508ca22
update yarn.lock
Jul 24, 2023
b62b4b5
update package.json
Jul 24, 2023
7dbfd21
update package.json
Jul 24, 2023
938f48e
update package.json
Jul 25, 2023
43ddb8c
Merge branch 'staging' of github.com:erxes/erxes-community into perf-…
Jul 25, 2023
72b4761
Merge branch 'dev' of github.com:erxes/erxes-community into perf-exm-…
Jul 25, 2023
39c900c
update build
Jul 25, 2023
9dea6dc
update
Jul 25, 2023
ce0e1a5
update package.json
Jul 25, 2023
359aa71
update package.json
Jul 25, 2023
2ad83cc
update
Jul 25, 2023
3f74bac
update docker file
Jul 25, 2023
d9507d1
feed list youtube link preview work
Gerelsukh Aug 8, 2023
e83e19c
fix chat ui
ariunzayarin Aug 8, 2023
6deac83
welcome section add on UI
Gerelsukh Aug 8, 2023
460daa2
Merge branch 'dev' of github.com:erxes/erxes-community into perf-exm-…
Gerelsukh Aug 8, 2023
a714e19
fix conflict
Gerelsukh Aug 8, 2023
44f0685
youtube link condition add
Gerelsukh Aug 8, 2023
c127e4e
check condition on allUsersQuery
Gerelsukh Aug 8, 2023
e026787
department, branch, unit add on EXM
Gerelsukh Aug 8, 2023
ab30ae7
Merge branch 'perf-exm-feed' of github.com:erxes/erxes-community into…
Gerelsukh Aug 8, 2023
2d59a8e
department branch unit add on event form
Gerelsukh Aug 8, 2023
d097dc8
add voice recorder and fix group chat
ariunzayarin Aug 10, 2023
3b449a6
hide not working parts
ariunzayarin Aug 10, 2023
6607a8c
Merge branch 'perf-exm-feed' of github.com:erxes/erxes-community into…
Gerelsukh Aug 10, 2023
77825eb
minor chat fixes
ariunzayarin Aug 10, 2023
565409c
readFile and uploadFile URL set
Gerelsukh Aug 10, 2023
5851738
Merge branch 'perf-exm-feed' of github.com:erxes/erxes-community into…
Gerelsukh Aug 10, 2023
f957eb5
delete-file URL set
Gerelsukh Aug 10, 2023
8abcee0
Merge branch 'dev' of github.com:erxes/erxes-community into perf-exm-…
Gerelsukh Aug 11, 2023
aa76254
fix event ui and hide some parts
ariunzayarin Aug 11, 2023
3fb1791
fix
ariunzayarin Aug 11, 2023
604235b
Merge branch 'perf-exm-feed' of github.com:erxes/erxes-community into…
Gerelsukh Aug 13, 2023
5da6096
loadMore button work
Gerelsukh Aug 14, 2023
8b915dd
add chat search
ariunzayarin Aug 14, 2023
da9ae9d
Merge branch 'perf-exm-feed' of github.com:erxes/erxes-community into…
ariunzayarin Aug 14, 2023
87ceb9b
fix modal close
ariunzayarin Aug 14, 2023
65ab369
little fix
ariunzayarin Aug 14, 2023
bea03be
add positions and fix some ui
ariunzayarin Aug 14, 2023
119a48e
little fix
ariunzayarin Aug 14, 2023
67c6b3d
add groupchat search
ariunzayarin Aug 15, 2023
3408846
remove deactive members and add tab to chat list
ariunzayarin Aug 15, 2023
e6ecb8b
fix positions
ariunzayarin Aug 15, 2023
e949a19
add pin to chat
ariunzayarin Aug 15, 2023
17d1c4e
fix chat pin
ariunzayarin Aug 15, 2023
da7e393
fix today's event
ariunzayarin Aug 15, 2023
b62740d
fix ui of post list images
ariunzayarin Aug 15, 2023
6ea727f
fix long images
ariunzayarin Aug 15, 2023
184cd68
add event info
ariunzayarin Aug 15, 2023
a4a4487
add like function
ariunzayarin Aug 16, 2023
dbc2ace
add comment
ariunzayarin Aug 16, 2023
bdb9355
fix event privacy
ariunzayarin Aug 17, 2023
93d6156
little fix
ariunzayarin Aug 17, 2023
5461124
little fix
ariunzayarin Aug 17, 2023
5fa1de0
fix like
ariunzayarin Aug 17, 2023
ddfc633
little fix
ariunzayarin Aug 17, 2023
2c84dc0
little fix
ariunzayarin Aug 17, 2023
5c3530a
change overlaytrigger to dropdown
ariunzayarin Aug 18, 2023
f37c1b2
little fix
ariunzayarin Aug 18, 2023
ada52b6
add chatForward
ariunzayarin Aug 30, 2023
5c76587
update(riskassessment):add filter on plans
Wlkr123 Sep 4, 2023
6838590
fix(riskAssessment):can't edit plan
Wlkr123 Sep 4, 2023
9075aff
Merge branch 'dev' of github.com:erxes/erxes-community into perf-exm-…
Gerelsukh Sep 5, 2023
050e1a2
infinite scroll add on exmfeed
Gerelsukh Sep 7, 2023
4fa1cbf
exmfeed update
Gerelsukh Sep 7, 2023
44ea6fd
welcome list update
Gerelsukh Sep 7, 2023
c2313f5
limit remove from exmfeed list
Gerelsukh Sep 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/exm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: exm feed CI

on:
push:
branches:
- dev
- staging
- perf-exm-feed
paths:
- "exm/**"
- ".github/workflows/exm.yaml"
pull_request:
branches:
- master
- develop
- apm
- staging
- perf-exm-feed
paths:
- "exm/**"

jobs:
exm:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Use Node.js 14.20.x
uses: actions/setup-node@v1
with:
node-version: 14.20.x

# https://github.com/actions/cache/blob/master/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-exm-${{ hashFiles('yarn.lock', 'exm/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-exm-
${{ runner.os }}-yarn-

- name: Build
run: |
cd exm
rm -rf node_modules
yarn install --frozen-lockfile
yarn build

- name: Build docker image
if: github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/perf-exm-feed' )
run: |
cd exm
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
docker build -t erxes/exm:${GITHUB_REF#refs/heads/} -f Dockerfile .
docker push erxes/exm:${GITHUB_REF#refs/heads/}
13 changes: 13 additions & 0 deletions exm/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": ["next/babel"],
"plugins": [["styled-components", { "ssr": true }],
[
"module-resolver",
{
"root": ["./"],
"alias": {
"modules": "./components"
}
}
]]
}
4 changes: 4 additions & 0 deletions exm/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
REACT_APP_DOMAIN=http://localhost:4000
REACT_APP_SUBSCRIPTION_URL=ws://localhost:4000/graphql

PORT=4200
7 changes: 7 additions & 0 deletions exm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:12.19-alpine
WORKDIR /exm/
RUN chown -R node:node /exm
COPY --chown=node:node . /exm
USER node
ENTRYPOINT [ "sh", "./docker-entrypoint.sh" ]
CMD [ "yarn", "start" ]
34 changes: 34 additions & 0 deletions exm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/import?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
13 changes: 13 additions & 0 deletions exm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

ENV="$(cat <<EOF
window.env = {
REACT_APP_DOMAIN: "$REACT_APP_DOMAIN",
REACT_APP_SUBSCRIPTION_URL: "$REACT_APP_SUBSCRIPTION_URL",
}
EOF
)"

echo $ENV > /exm/static/js/env.js

exec "$@"
26 changes: 26 additions & 0 deletions exm/modules/WebSocketLink.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { ApolloLink, FetchResult, Observable, Operation } from '@apollo/client';
import { Client, ClientOptions, createClient } from 'graphql-ws';

import { print } from 'graphql';

export default class WebSocketLink extends ApolloLink {
private client: Client;

constructor(options: ClientOptions) {
super();
this.client = createClient(options);
}

public request(operation: Operation): Observable<FetchResult> {
return new Observable((sink) => {
return this.client.subscribe<FetchResult>(
{ ...operation, query: print(operation.query) },
{
next: sink.next.bind(sink),
complete: sink.complete.bind(sink),
error: sink.error.bind(sink),
},
);
});
}
}
72 changes: 72 additions & 0 deletions exm/modules/apolloClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { ApolloClient, InMemoryCache, createHttpLink } from '@apollo/client';

import { getEnv } from "../utils/configs";
import { getMainDefinition } from '@apollo/client/utilities';
import { onError } from '@apollo/client/link/error';
import { setContext } from '@apollo/client/link/context';
import { split } from '@apollo/client/link/core';

const { REACT_APP_API_URL } = getEnv();

// Create an http link:
const httpLink = createHttpLink({
uri: `${REACT_APP_API_URL}/graphql`,
credentials: 'include'
});

// Error handler
const errorLink = onError(({ graphQLErrors }) => {
if (graphQLErrors && graphQLErrors.length > 0) {
const [error] = graphQLErrors;

if (error.message === 'Login required') {
window.location.reload();
}
}
});

const authLink = setContext((_, { headers }) => {
return {
headers: {
...headers,
sessioncode: sessionStorage.getItem('sessioncode') || ''
}
};
});

// Combining httpLink and warelinks altogether
const httpLinkWithMiddleware = errorLink.concat(authLink).concat(httpLink);

// Subscription config
// export const wsLink: any = new WebSocketLink({
// url: REACT_APP_API_SUBSCRIPTION_URL || 'ws://localhost:4000/graphql',
// retryAttempts: 1000,
// retryWait: async () => {
// await new Promise(resolve => setTimeout(resolve, 5000));
// }
// });

type Definintion = {
kind: string;
operation?: string;
};

// Setting up subscription with link
const link = split(
// split based on operation type
({ query }) => {
const { kind, operation }: Definintion = getMainDefinition(query);
return kind === 'OperationDefinition' && operation === 'subscription';
},
// wsLink,
httpLinkWithMiddleware
);

// Creating Apollo-client
const client = new ApolloClient({
cache: new InMemoryCache(),
queryDeduplication: false,
link
});

export default client;
41 changes: 41 additions & 0 deletions exm/modules/appContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React, { createContext } from "react";
import { gql, useQuery } from "@apollo/client";

import { CurrentUserQueryResponse } from "./auth/types";
import Spinner from "./common/Spinner";
import queries from "./auth/graphql/queries";

const AppContext = createContext({});

export const AppConsumer = AppContext.Consumer;

type Props = {
children: any;
};

function AppProvider({ children }: Props) {
const { data, loading } = useQuery<CurrentUserQueryResponse>(
gql(queries.currentUser),
{
fetchPolicy: "network-only",
}
);

if (loading) {
return <Spinner />;
}

const currentUser = data?.currentUser || null;

return (
<AppContext.Provider
value={{
currentUser,
}}
>
{children}
</AppContext.Provider>
);
}

export default AppProvider;
74 changes: 74 additions & 0 deletions exm/modules/auth/components/ForgotPassword.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { AuthBox } from "../styles";
import Button from "../../common/Button";
import FormControl from "../../common/form/Control";
import FormGroup from "../../common/form/Group";
import Link from "next/link";
import React from "react";
import { __ } from "../../../utils";
import { getThemeItem } from "../../utils";
import { readFile } from "../../common/utils";

type Props = {
forgotPassword: (
doc: { email: string },
callback: (e: Error) => void
) => void;
};

class ForgotPassword extends React.Component<Props, { email: string }> {
constructor(props) {
super(props);

this.state = { email: "" };
}

handleSubmit = (e) => {
e.preventDefault();

const { email } = this.state;

this.props.forgotPassword({ email }, (err) => {
if (!err) {
window.location.href = "/sign-in";
}
});
};

handleEmailChange = (e) => {
e.preventDefault();
this.setState({ email: e.target.value });
};

renderLogo() {
const logo = "/images/logo-dark.png";
const thLogo = getThemeItem("logo");
return thLogo ? readFile(thLogo) : `/images/${logo}`;
}

render() {
return (
<AuthBox>
<img src={this.renderLogo()} alt="erxes" />
<h2>{__("Reset your password")}</h2>
<p>{__("Please reset your password via email")}</p>
<form onSubmit={this.handleSubmit}>
<FormGroup>
<FormControl
type="email"
placeholder={__("Enter your email")}
value={this.state.email}
required={true}
onChange={this.handleEmailChange}
/>
</FormGroup>
<Button type="submit" block={true}>
Email me the instruction
</Button>
</form>
<Link href="/sign-in">{__("Sign in")}</Link>
</AuthBox>
);
}
}

export default ForgotPassword;
Loading