Skip to content

Commit

Permalink
Merge branch 'main' into feat/random-avatar-background
Browse files Browse the repository at this point in the history
  • Loading branch information
estd20xx authored Oct 8, 2023
2 parents c0b8a02 + 8a7eb4a commit 93d5d08
Show file tree
Hide file tree
Showing 23 changed files with 362 additions and 105 deletions.
39 changes: 0 additions & 39 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Bug Report
description: File a bug report
title: '[Bug]: '
labels: ['bug']

body:
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce the behavior
value: "1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n"
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
attributes:
label: Screenshots/Videos
description: Drag n Drop Screenshots or videos which would help us to view the bug visually
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add any other context about the problem here.
validations:
required: false
- type: checkboxes
attributes:
label: Please checkmark the following checklist
options:
- label: I make sure that similar issue is not opened
required: true
74 changes: 74 additions & 0 deletions .github/workflows/apply-issue-labels-to-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: 'Apply issue labels to PR'

on:
pull_request_target:
types:
- opened

jobs:
label_on_pr:
runs-on: ubuntu-latest

permissions:
contents: none
issues: read
pull-requests: write

steps:
- name: Apply labels from linked issue to PR
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
async function getLinkedIssues(owner, repo, prNumber) {
const query = `query GetLinkedIssues($owner: String!, $repo: String!, $prNumber: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $prNumber) {
closingIssuesReferences(first: 10) {
nodes {
number
labels(first: 10) {
nodes {
name
}
}
}
}
}
}
}`;
const variables = {
owner: owner,
repo: repo,
prNumber: prNumber,
};
const result = await github.graphql(query, variables);
return result.repository.pullRequest.closingIssuesReferences.nodes;
}
const pr = context.payload.pull_request;
const linkedIssues = await getLinkedIssues(
context.repo.owner,
context.repo.repo,
pr.number
);
const labelsToAdd = new Set();
for (const issue of linkedIssues) {
if (issue.labels && issue.labels.nodes) {
for (const label of issue.labels.nodes) {
labelsToAdd.add(label.name);
}
}
}
if (labelsToAdd.size) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
labels: Array.from(labelsToAdd),
});
}
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Thank you for your interest in contributing to Review App! We welcome contributi
- [Contributing Guidelines](#contributing-guidelines)
- [Setting Up the Development Environment](#setting-up-the-development-environment)
- [Submitting a Pull Request (PR)](#submitting-a-pull-request-pr)
- [Backend Reference Link](#backend-reference-link)
- [Code of Conduct](#code-of-conduct)

## Getting Started
Expand Down Expand Up @@ -99,6 +100,10 @@ To set up the development environment locally, follow these steps:

When you're ready to submit your changes, create a pull request (PR) following our guidelines. Be sure to provide a clear description of your changes in the PR, and one of our maintainers will review it.

## Backend Reference Link
You can find the reference link to the backend of the reivew-app here:
`https://github.com/piyushgarg-dev/review-app-api`

## Code of Conduct

Please note that we have a [Code of Conduct](CODE_OF_CONDUCT.md) that we expect all contributors to follow. Ensure you read and adhere to it throughout your contribution journey.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ We welcome contributions from the community to enhance Review App further. If yo

## License

This project is licensed under the [MIT License](LICENSE).
This project is licensed under the [GNU General Public Licence v3.0](https://github.com/piyushgarg-dev/review-app/blob/main/LICENCE).
9 changes: 6 additions & 3 deletions components/Dashboard/DashboardSidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ const DashboardSidebar: React.FC = () => {
/>
</div>
) : (
<Avatar name={user ? user?.firstName + " " + user?.lastName : ""} size='40' round="50%" className=' flex h-10 w-10 items-center justify-center rounded-full font-semibold text-white' />
<p className="relative flex h-10 w-10 items-center justify-center rounded-full bg-violet-700 font-semibold text-white">
{user?.firstName.charAt(0)}
{user?.lastName?.charAt(0)}
</p>
)}
<p className="truncate">
<p className="max-w-[107px] truncate">
{user?.firstName} {user?.lastName}
</p>
</div>
Expand All @@ -125,7 +128,7 @@ const DashboardSidebar: React.FC = () => {
{route.links.map((link) => (
<li key={link.href}>
<Link
href={`/dashboard/${project?.slug}/${link.href}`}
href={`/dashboard/${project?.subdomain}/${link.href}`}
className={cn(
'offset_ring group my-0.5 flex w-full cursor-pointer justify-start rounded-lg p-2 text-sm font-medium hover:bg-accent',
{
Expand Down
4 changes: 2 additions & 2 deletions components/Dashboard/FormPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const FormPane: React.FC = () => {
/>

<Link
href={`/dashboard/${project?.slug}/forms/edit/${form?.id}`}
href={`/dashboard/${project?.subdomain}/forms/edit/${form?.id}`}
className="offset_ring flex flex-grow items-center gap-4 overflow-x-hidden rounded-lg"
>
<Image
Expand Down Expand Up @@ -106,7 +106,7 @@ const FormPane: React.FC = () => {
onClick={() =>
label.toLowerCase() === 'edit'
? router.push(
`/dashboard/${project?.slug}/forms/edit/${form?.id}`
`/dashboard/${project?.subdomain}/forms/edit/${form?.id}`
)
: null
}
Expand Down
6 changes: 3 additions & 3 deletions components/Dashboard/ProjectSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const ProjectSwitch: React.FC = () => {
const { project: selectedProject } = useSelectedProject()

const handleSelectProject = useCallback(
(slug: string) => {
router.replace(`/dashboard/${slug}`)
(domain: string) => {
router.replace(`/dashboard/${domain}`)
},
[router]
)
Expand Down Expand Up @@ -60,7 +60,7 @@ const ProjectSwitch: React.FC = () => {
<CommandItem
key={project?.id}
onSelect={() =>
project ? handleSelectProject(project?.slug) : null
project ? handleSelectProject(project?.subdomain) : null
}
className="cursor-pointer text-sm"
>
Expand Down
5 changes: 4 additions & 1 deletion components/Modals/CreateFormModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export const CreateFormModal: React.FC = () => {
toast.success('Project created successfully', {
id: 'create-form',
})
router.push(`/dashboard/${selectedProject.slug}/forms/edit/${formId}`)
router.push(
`/dashboard/${selectedProject.subdomain}/forms/edit/${formId}`
)
}
} catch (error) {
toast.error('Something went wrong', { id: 'create-form' })
Expand Down Expand Up @@ -130,6 +132,7 @@ export const CreateFormModal: React.FC = () => {
<Button
disabled={loading}
variant="outline"
type="button"
onClick={createFormModal.closeCreateFormModal}
>
Cancel
Expand Down
Loading

0 comments on commit 93d5d08

Please sign in to comment.