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

Clean up caldav credentials #54

Merged
merged 5 commits into from
Dec 7, 2020
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
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
19 changes: 10 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
## Pull Request template

Please, go through these steps before you submit a PR.

1. Make sure that:

a. You have done your changes in a separate branch. Branches MUST have descriptive names that start with either the `fix/` or `feature/` prefixes. Good examples are: `fix/signin-issue` or `feature/issue-templates`.
a. You have done your changes in a separate branch. Branches MUST have descriptive names that start with either the `fix/` or `feature/` prefixes. Good examples are: `fix/signin-issue` or `feature/issue-templates`.

b. You have a descriptive commit message with a short title (first line).
b. You have a descriptive commit message with a short title (first line).

c. You have only one commit (if not, squash them into one commit).
c. You have only one commit (if not, squash them into one commit).

d. Running tests doesn't throw any error. If it does, fix them first and amend your commit (`git commit --amend`).
d. Running tests doesn't throw any error. If it does, fix them first and amend your commit (`git commit --amend`).

3. **After** these steps, you're ready to open a pull request.
2. **After** these steps, you're ready to open a pull request.

a. Your pull request MUST NOT target the `master` branch on this repository. You probably want to target `develop` instead.
a. Your pull request MUST NOT target the `master` branch on this repository. You probably want to target `develop` instead.

b. Give a descriptive title to your PR.
b. Give a descriptive title to your PR.

c. Provide a description of your changes.
c. Provide a description of your changes.

d. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).
d. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).

IMPORTANT: Please review the [CONTRIBUTING.md](../CONTRIBUTING.md) file for detailed contributing guidelines.

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

Expand Down
29 changes: 15 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@

The main repository will always hold two evergreen branches:

* `master`
* `develop`
- `master`
- `develop`

The main branch should be considered `origin/develop` and will be the main branch where the source code of `HEAD` always reflects a state with the latest delivered development changes for the next release. As a developer, you will be branching and merging from `develop`.

Consider `origin/master` to always represent the latest code deployed to production. During day to day development, the `master` branch will not be interacted with.

When the source code in the `develop` branch is stable and has been deployed, all of the changes will be merged into `master` and tagged with a release number. *How this is done in detail will be discussed later.*
When the source code in the `develop` branch is stable and has been deployed, all of the changes will be merged into `master` and tagged with a release number. _How this is done in detail will be discussed later._

## Supporting Branches

Supporting branches are used to aid parallel development between team members, ease tracking of features, and to assist in quickly fixing live production problems. Unlike the main branches, these branches always have a limited life time, since they will be removed eventually.

The different types of branches we may use are:

* Feature branches
* fix branches
- Feature branches
- fix branches

Each of these branches have a specific purpose and are bound to strict rules as to which branches may be their originating branch and which branches must be their merge targets. Each branch and its usage is explained below.

Expand All @@ -61,9 +61,9 @@ During the lifespan of the feature development, the lead should watch the `devel

`<tbd number>` represents the project to which Project Management will be tracked.

* Must branch from: `develop`
* Must merge back into: `develop`
* Branch naming convention: `feature/GH-<tbd number>`
- Must branch from: `develop`
- Must merge back into: `develop`
- Branch naming convention: `feature/GH-<tbd number>`

#### Working with a feature branch

Expand All @@ -83,7 +83,7 @@ $ git merge develop // merges changes from mast
When development on the feature is complete, reviewers should merge changes into `develop` and then make sure the remote branch is deleted.

```
$ git checkout develop // change to the develop branch
$ git checkout develop // change to the develop branch
$ git merge --no-ff feature/GH-id // makes sure to create a commit object during merge
$ git push origin develop // push merge changes
$ git push origin :feature/GH-id // deletes the remote branch
Expand All @@ -97,11 +97,11 @@ Fix branches differ from feature branches only semantically. Fix branches will b

Although likelihood will be less, during the lifespan of the bug development, the lead should watch the `develop` branch (network tool or branch tool in GitHub) to see if there have been commits since the bug was branched. Any and all changes to `develop` should be merged into the bug before merging back to `develop`; this can be done at various times during the project or at the end, but time to handle merge conflicts should be accounted for.

`<tbd number>` represents the Basecamp project to which Project Management will be tracked.
`<tbd number>` represents the Basecamp project to which Project Management will be tracked.

* Must branch from: `develop`
* Must merge back into: `develop`
* Branch naming convention: `bugfix/GH-<GH number>`
- Must branch from: `develop`
- Must merge back into: `develop`
- Branch naming convention: `bugfix/GH-<GH number>`

#### Working with a fix branch

Expand All @@ -121,7 +121,8 @@ $ git merge develop // merges changes from deve
When development on the bug is complete, [the Lead] should merge changes into `develop` and then make sure the remote branch is deleted.

```
$ git checkout develop // change to the develop branch
$ git checkout develop // change to the develop branch
$ git merge --no-ff bugfix/GH-id // makes sure to create a commit object during merge
$ git push origin develop // push merge changes
$ git push origin :bugfix/GH-id // deletes the remote branch
```
1 change: 1 addition & 0 deletions app/components/buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { forwardRef } from "react"

function makeCustomAnchorComponent(className: string) {
return forwardRef<HTMLAnchorElement, React.HTMLProps<HTMLAnchorElement>>((props, ref) => {
// eslint-disable-next-line jsx-a11y/anchor-has-content
return <a {...props} className={className + " " + props.className} ref={ref} />
})
}
Expand Down
69 changes: 30 additions & 39 deletions app/components/createEmail/helper/emailHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,48 @@ import nodemailer from "nodemailer"
import Email from "email-templates"
import { checkEnvVariable } from "../../../../utils/checkEnvVariables"

export class EmailProvider
{
export class EmailProvider {
private static _connection: Email

private constructor() {}

getMailService(): Email {
this.checkIfSMTPEnvVariablesExist()
this.checkIfSMTPEnvVariablesExist()

const transporter = this.createSMTPConnection()
const transporter = this.createSMTPConnection()
return new Email({
message: {
from: process.env.EMAIL_FROM,
},
transport: transporter,
send: process.env.MODE !== "development",
views: {
options: {
extension: "hbs",
message: {
from: process.env.EMAIL_FROM,
},
},
})
}
transport: transporter,
send: process.env.MODE !== "development",
views: {
options: {
extension: "hbs",
},
},
})
}

createSMTPConnection(): nodemailer.Transporter {
return nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: parseInt(process.env.SMTP_PORT!, 10),
secure: false,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASSWORD,
},
})
}
return nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: parseInt(process.env.SMTP_PORT!, 10),
secure: false,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASSWORD,
},
})
}

checkIfSMTPEnvVariablesExist(): void {
["SMTP_HOST", "SMTP_PORT", "SMTP_USER", "SMTP_PASSWORD", "EMAIL_FROM", "MODE"].forEach((env) =>
checkEnvVariable(env)
)
}
;["SMTP_HOST", "SMTP_PORT", "SMTP_USER", "SMTP_PASSWORD", "EMAIL_FROM", "MODE"].forEach((env) =>
checkEnvVariable(env)
)
}

public static get Connection()
{
return this._connection || (this._connection = new this().getMailService());
public static get Connection() {
return this._connection || (this._connection = new this().getMailService())
}
}







6 changes: 3 additions & 3 deletions app/components/createEmail/queries/sendConfirmationMail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { createCalendarEvent } from "../helper/createCalendarEvent"
import Email from "email-templates"
import { Appointment } from "../types"

export default async function sendConfirmationMail(properties: { appointment: Appointment; }) {
const mail = EmailProvider.Connection;
sendMail(mail, properties.appointment);
export default async function sendConfirmationMail(properties: { appointment: Appointment }) {
const mail = EmailProvider.Connection
sendMail(mail, properties.appointment)
}

function sendMail(mail: Email, appointment: Appointment): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { faAngleDoubleLeft } from "@fortawesome/free-solid-svg-icons"
type AdvancedProps = {
stepBack: () => void
onEdit: (key: string, value: any) => void
onSubmit: (e: any) => void
onSubmit: () => void
}

const Advanced = (props: AdvancedProps) => {
Expand All @@ -22,7 +22,7 @@ const Advanced = (props: AdvancedProps) => {
<div className="border-t border-gray-200">
<div className="grid grid-cols-8 gap-6 bg-white px-4 py-5 sm:px-6">
<div className="col-span-1">
<Button action={() => props.stepBack()}>
<Button onClick={props.stepBack} type="submit">
<FontAwesomeIcon icon={faAngleDoubleLeft} />
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ const Availability = (props: AvailabilityProps) => {
<div className="border-t border-gray-200">
<div className="grid grid-cols-8 gap-6 bg-white px-4 py-5 sm:px-6">
<div className="col-span-1">
<Button action={() => props.stepBack()}>
<Button onClick={props.stepBack} type="submit">
<FontAwesomeIcon icon={faAngleDoubleLeft} />
</Button>
</div>

<div className="col-span-6"></div>

<div className="col-span-1">
<Button action={() => props.toNext()}>
<Button onClick={props.toNext} type="submit">
<FontAwesomeIcon icon={faAngleDoubleRight} />
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const General = (props: GeneralProps) => {
</div>
</div>
<div className="col-span-1">
<Button action={() => props.toNext()}>
<Button onClick={props.toNext} type="submit">
<FontAwesomeIcon icon={faAngleDoubleRight} />
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Schedule = (props: ScheduleProps) => {
<div className="border-t border-gray-200">
<div className="grid grid-cols-8 gap-6 bg-white px-4 py-5 sm:px-6">
<div className="col-span-1">
<Button action={() => props.stepBack()}>
<Button onClick={props.stepBack} type="submit">
<FontAwesomeIcon icon={faAngleDoubleLeft} />
</Button>
</div>
Expand Down Expand Up @@ -293,7 +293,7 @@ const Schedule = (props: ScheduleProps) => {
/>
</div>
<div className="col-span-2">
<Button action={() => {}}>
<Button onClick={() => {}} type="submit">
<FontAwesomeIcon icon={faPlus} />
</Button>
</div>
Expand All @@ -304,7 +304,7 @@ const Schedule = (props: ScheduleProps) => {
</div>
</div>
<div className="col-span-1">
<Button action={() => props.toNext()}>
<Button onClick={() => props.toNext()} type="submit">
<FontAwesomeIcon icon={faAngleDoubleRight} />
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/meetings/pages/meetings/all.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BlitzPage, useQuery } from "blitz"
import React, { Suspense } from "react"
import getMeetings from "../../../meetings/queries/getMeetings"
import MyMeetings from "../../components/myMeetings"
import MyMeetings from "../../components/MyMeetings"

const MyMeetingsContent = () => {
const [meetings] = useQuery(getMeetings, null)
Expand Down
10 changes: 5 additions & 5 deletions app/meetings/pages/meetings/create.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { BlitzPage, useMutation } from "blitz"
import React, { Suspense, useState } from "react"
import Advanced from "../../components/creationSteps/advanced"
import Availability from "../../components/creationSteps/availability"
import General from "../../components/creationSteps/general"
import Schedule from "../../components/creationSteps/schedule"
import Advanced from "../../components/creationSteps/Advanced"
import Availability from "../../components/creationSteps/Availability"
import General from "../../components/creationSteps/General"
import Schedule from "../../components/creationSteps/Schedule"
import { Meeting } from "app/meetings/types"
import addMeeting from "../../mutations/addMeeting"

Expand Down Expand Up @@ -62,7 +62,7 @@ const InviteCreationContent = () => {
}
}

const submitMeeting = (e: any) => {
const submitMeeting = () => {
createMeetingMutation(meeting)
.then((data) => {
// Redirect to All Meetings
Expand Down
Loading