Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Develop onto Main #1155

Merged
merged 12 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 0 additions & 16 deletions .github/workflows/community-first-pr-comment.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/community-issue-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
repo: context.repo.repo,
issue_number: context.payload.issue.number,
body: `Thank you @${context.payload.issue.assignee.login} you have been assigned this issue!
**Please follow the directions in our [Contributing Guide](https://github.com/chaynHQ/.github/blob/main/docs/CONTRIBUTING.md). We look forward to reviewing your pull request shortly ✨**
**Please follow the directions in our [Contributing Guide](https://github.com/chaynHQ/.github/blob/main/docs/CONTRIBUTING.md). We look forward to reviewing your pull request. ✨**

---

Support Chayn's mission? ⭐ Please star this repo to help us find more contributors like you!
Learn more about Chayn [here](https://linktr.ee/chayn) and [explore our projects](https://org.chayn.co/projects). 🌸`
Learn more about Chayn and our impact [here](https://github.com/chaynHQ/.github/blob/main/profile/README.md). 🌸`
})

# When issues are labeled as stale, a comment is posted.
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/community-pr-check-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check Linked Issue on PR
on:
pull_request:
types: [opened, edited]
branches:
- 'develop'

jobs:
Check-For-Linked-Issue:
runs-on: ubuntu-latest
if: ${{ github.event.action == 'opened' || github.event.action == 'edited' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check for keyword and issue number
id: check-for-keyword
uses: actions/github-script@v7
with:
script: |
const script = require('./scripts/github-actions/checkPRLinkedIssue.js')
script({g: github, c: context})
30 changes: 30 additions & 0 deletions .github/workflows/community-pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Auto-label PR from Linked Issue and Review Status

on:
pull_request:
types: [opened, edited, synchronize]
pull_request_review:
types: [submitted, edited, dismissed]

jobs:
auto-label:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm install @actions/github @actions/core

- name: Run PR labeling script
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const script = require('./scripts/github-actions/prLabeling.js')
await script({github, context, core})
8 changes: 4 additions & 4 deletions .github/workflows/community-stale-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
days-before-stale: 30
# disables closing issues
days-before-issue-close: -1
# close pr after 1 week no updates after stale warning
days-before-pr-close: 7
# only scan assigned issues
include-only-assigned: true
Expand All @@ -39,6 +38,7 @@ jobs:
exempt-pr-labels: dependencies
# disable counting irrelevant activity (branch updates) towards day counter on prs.
ignore-pr-updates: true
stale-pr-message: 'As per Chayn policy, after 30 days of inactivity, we will close this PR.'
close-pr-message: 'This PR has been closed due to inactivity.'
stale-issue-message: 'As per Chayn policy, after 30 days of inactivity, we will be unassigning this issue. Please comment to stay assigned.'
# messages skipped, instead handled by issue-comment.yml
stale-pr-message: ''
close-pr-message: ''
stale-issue-message: ''
2 changes: 1 addition & 1 deletion .github/workflows/cypress-release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Run cypress
uses: cypress-io/github-action@v6.7.2
uses: cypress-io/github-action@v6.7.6
with:
browser: chrome
config-file: cypress.config.ts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cypress-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Run cypress
uses: cypress-io/github-action@v6.7.2
uses: cypress-io/github-action@v6.7.6
with:
browser: chrome
spec: cypress/**/*.cy.tsx
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/dependabot-open-issues.yml

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,16 +288,16 @@ If it says your account it already registered and you can’t remember the passw

Our preview urls work almost exactly like our live website, except for:

- When you open chat, it will show a fake set of ‘chat team’ members available.
- When you send a chat, no-one will reply.
- We might have also set the chat text to be different on staging/preview, if we are testing options.
- When you open messaging, it will show a fake set of ‘chat team’ members available.
- When you send a message, no-one will reply.
- We might have also set the message text to be different on staging/preview, if we are testing options.
- When you go to book a therapy session, you will see fake therapists.
- When you book a therapy session, it won’t actually book a session with anyone.
- When you get the email confirmation of a therapy session, it won’t show the same email as we send to Bumble/Badoo users.

You might want to use the live site if:

- You want to test something about chat
- You want to test something about messaging
- You want to book a therapy session with one of the therapists as part of their onboarding
- A bug has been reported but you can’t see it on preview, so you want to see if it’s only affecting the live site
- To test features that only work on production e.g. Hotjar
Expand Down
37 changes: 0 additions & 37 deletions components/crisp/CrispButton.tsx

This file was deleted.

105 changes: 105 additions & 0 deletions components/crisp/CrispIframe.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import { Box } from '@mui/material';
import { CHAT_MESSAGE_COMPOSED, CHAT_MESSAGE_SENT, CHAT_VIEWED } from '../../constants/events';
import { useTypedSelector } from '../../hooks/store';
import logEvent, { getEventUserData } from '../../utils/logEvent';

const iframeContainerStyle = {
width: '100%',
height: '400px',
marginTop: { md: -2 },
marginBottom: 3,
maxHeight: '70vh',
borderTopLeftRadius: 16,
borderTopRightRadius: 16,
borderTop: '4px solid white',
overflow: 'hidden',
} as const;

const iframeStyle = {
marginTop: -158,
borderRadius: 16,
maxHeight: 'calc(70vh + 158px)',
} as const;

export const CrispIframe = () => {
const userEmail = useTypedSelector((state) => state.user.email);
const userSignUpLanguage = useTypedSelector((state) => state.user.signUpLanguage);
const userCrispTokenId = useTypedSelector((state) => state.user.crispTokenId);
const userCreatedAt = useTypedSelector((state) => state.user.createdAt);
const partnerAccesses = useTypedSelector((state) => state.partnerAccesses);
const partnerAdmin = useTypedSelector((state) => state.partnerAdmin);
const eventUserData = getEventUserData(userCreatedAt, partnerAccesses, partnerAdmin);

const iframeLoaded = async () => {
const iframeWindow: any = (document.getElementById('crispIframe') as HTMLIFrameElement)
?.contentWindow;
const crisp = iframeWindow?.$crisp;

if (!crisp) return;

// Set crisp settings on the iframe window - these will be used by the following crisp script
iframeWindow.CRISP_WEBSITE_ID = process.env.NEXT_PUBLIC_CRISP_WEBSITE_ID;
iframeWindow.CRISP_RUNTIME_CONFIG = {
lock_maximized: true,
lock_full_view: true,
cross_origin_cookies: true,
locale: userSignUpLanguage,
};

if (userCrispTokenId) {
iframeWindow.CRISP_TOKEN_ID = userCrispTokenId;
}

// Create the crisp script and insert it to the iframe
const iframeDocument = iframeWindow.document;
const iframeScript = iframeDocument.createElement('script');
iframeScript.src = 'https://client.crisp.chat/l.js';
iframeScript.async = 1;
iframeDocument.getElementsByTagName('head')[0].appendChild(iframeScript);

// Once the crisp script is loaded, setup event listeners
iframeScript.onload = () => {
let composeEventSent = false;

logEvent(CHAT_VIEWED, eventUserData);

if (process.env.NEXT_PUBLIC_ENV === 'production') {
crisp.push(['safe', true]); // Turns on safe mode = turns off errors in production
}
crisp.push(['set', 'user:email', [userEmail]]);

crisp.push([
'on',
'message:compose:sent',
() => {
if (!composeEventSent) {
logEvent(CHAT_MESSAGE_COMPOSED, eventUserData);
composeEventSent = true;
}
},
]);

crisp.push([
'on',
'message:sent',
() => {
logEvent(CHAT_MESSAGE_SENT, eventUserData);
composeEventSent = false;
},
]);
};
};

return (
<Box sx={iframeContainerStyle}>
<iframe
id="crispIframe"
height="550px"
width="100%"
style={iframeStyle}
src={'/crisp.html'} // Basic window object for iframe, crisp setup exists in onLoad function
onLoad={iframeLoaded}
/>
</Box>
);
};
Loading
Loading