feat: resolve conflicts

This commit is contained in:
Nevo David 2024-05-14 14:34:22 +07:00
commit f97dd52b12
12 changed files with 204 additions and 55 deletions

View File

@ -1,5 +1,5 @@
DATABASE_URL=""
REDIS_URL=""
DATABASE_URL="postgres://<user>:<password>@<host>:<port>/<database_name>"
REDIS_URL="redis://<host>:<port>"
UPLOAD_DIRECTORY=""
NEXT_PUBLIC_UPLOAD_STATIC_DIRECTORY=""
STRIPE_PUBLISHABLE_KEY=""

128
CODE_OF_CONDUCT.md Normal file
View File

@ -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
nevo@gitroom.com.
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.

View File

@ -16,9 +16,10 @@
<div align="center">
<strong>
<h2>Your open-source launch week.</h2>
<h2>Maximize your launch.</h2><br />
An alternative to: Buffer.com, Hypefury, Twitter Hunter, Etc...<br /><br />
</strong>
Schedule social media and articles.<br />Exchange or buy posts from other members.<br /> Monitor your GitHub trending, and so much more.
Schedule social media and articles.<br />Exchange or buy posts from other members.<br /> Monitor your GitHub trending, and so much more.<br />
</div>
<p align="center">
@ -41,7 +42,7 @@
<br />
<p align="center">
<a href="" target="_blank">
<a href="https://www.youtube.com/watch?v=vLpi6NPOXwU" target="_blank">
<img src=".github/assets/gitroom-main-youtube.png">
</a>
</p>
@ -64,45 +65,21 @@
<img width="99%" src=".github/assets/screen-004.png"/>
</p>
## Intro
# Intro
<strong>Become a content machine</strong> - you might have heard it before; if you want to promote your stuff, you must release content.
- Schedule all your social media posts and articles beforehand.
To become consistent with your content, you have to set up everything before and take 1-2 weeks of a buffer (at least) so you can launch your stuff.
- Plan your launch around GitHub trending changes
You want to be relaxed about the following content and not to make split-second mistakes.
- Collaborate with other team members to exchange or buy posts
Today, for open-source tools, that's impossible.<br /><br />
- Invite your team members to collaborate, comment, and schedule posts
<h3>Why?</h3>
- Post to uncommon platforms such as Reddit, DEV.to, and Hashnode.
Because you must do everything manually, even existing scheduling tools let you schedule only Social Media posts (and ignore essential platforms such as Reddit).
- Offer your open-source deals to the entire community
But how can you make your social media post if you still need to release your article?
How do you release all your articles at the same time - without copy-pasting them between platforms?
How do you know when is the best time to post?
That's where Gitroom shines; you can do all of it beforehand.
---
## Problem - Solution ✅
🚀 Schedule all your social media posts and articles beforehand.
🔥 Plan your launch around GitHub trending changes
🎉 Collaborate with other team members to exchange or buy posts
✨ Invite your team members to collaborate, comment and schedule posts
🥇 Post to uncommon platforms such as Reddit, DEV.to, and Hashnode.
💥 Offer your open-source deals to the entire community
🎈 Be a part of the Gitroom friends - APIs to exchange content between members
- Be a part of the Gitroom friends - APIs to exchange content between members
## Tech Stack

View File

@ -65,7 +65,15 @@ export class PermissionsService {
requestedPermission.length === 0 ||
!process.env.STRIPE_PUBLISHABLE_KEY
) {
return build();
for (const [action, section] of requestedPermission) {
can(action, section);
}
return build({
detectSubjectType: (item) =>
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
item.constructor,
});
}
const { subscription, options } = await this.getPackageOptions(orgId);

View File

@ -87,6 +87,12 @@ npm run prisma-db-push
```
</Step>
<Step title="Setup postgres & redis via docker compose">
```bash Terminal
docker compose -f "docker-compose.dev.yaml" up
```
</Step>
<Step title="Run the project">
```bash Terminal
npm run dev

View File

@ -10,7 +10,8 @@
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@next/next/no-html-link-for-pages": ["error", "apps/frontend/pages"]
"@next/next/no-html-link-for-pages": ["error", "apps/frontend/pages"],
"no-extra-boolean-cast": "off"
}
},
{

View File

@ -12,6 +12,9 @@ const nextConfig = {
// See: https://github.com/gregberge/svgr
svgr: false,
},
env: {
isBillingEnabled: String(!!process.env.STRIPE_PUBLISHABLE_KEY),
}
};
const plugins = [

View File

@ -252,9 +252,9 @@ html {
background-color: #ffdd00;
}
#renderEditor:not(:has(:first-child)) {
display: none;
}
/*#renderEditor:not(:has(:first-child)) {*/
/* display: none;*/
/*}*/
.w-md-editor {
background-color: #131B2C !important;
border: 0 !important;

View File

@ -346,7 +346,7 @@ export const AddEditModal: FC<{
onChange={setSelectedIntegrations}
/>
)}
<div id="renderEditor" />
<div id="renderEditor" className={clsx(!showHide.hideTopEditor && 'hidden')} />
{!existingData.integration && !showHide.hideTopEditor ? (
<>
<div>You are in global editing mode</div>

View File

@ -13,7 +13,7 @@ import { useFetch } from '@gitroom/helpers/utils/custom.fetch';
import { ExistingDataContextProvider } from '@gitroom/frontend/components/launches/helpers/use.existing.data';
import { useDrag, useDrop } from 'react-dnd';
import { DNDProvider } from '@gitroom/frontend/components/launches/helpers/dnd.provider';
import { Integration, Post } from '@prisma/client';
import { Integration, Post, State } from '@prisma/client';
import { useAddProvider } from '@gitroom/frontend/components/launches/add.provider.component';
import { CommentComponent } from '@gitroom/frontend/components/launches/comments/comment.component';
import { useSWRConfig } from 'swr';
@ -301,15 +301,9 @@ const CalendarColumnRender: FC<{ day: number; hour: string }> = (props) => {
closeOnEscape: false,
withCloseButton: false,
classNames: {
modal: 'bg-transparent text-white',
modal: 'w-[100%] max-w-[1400px] bg-transparent text-white',
},
children: (
<AddEditModal
reopenModal={() => ({})}
integrations={integrations}
date={getDate}
/>
),
children: <AddEditModal integrations={integrations} date={getDate} reopenModal={() => ({})} />,
size: '80%',
// title: `Adding posts for ${getDate.format('DD/MM/YYYY HH:mm')}`,
});
@ -346,6 +340,7 @@ const CalendarColumnRender: FC<{ day: number; hour: string }> = (props) => {
<div className="relative flex gap-[5px] items-center">
<CalendarItem
date={getDate}
state={post.state}
editPost={editPost(post.id)}
post={post}
integrations={integrations}
@ -384,9 +379,10 @@ const CalendarItem: FC<{
date: dayjs.Dayjs;
editPost: () => void;
integrations: Integrations[];
state: State;
post: Post & { integration: Integration };
}> = (props) => {
const { editPost, post, date, integrations } = props;
const { editPost, post, date, integrations, state } = props;
const [{ opacity }, dragRef] = useDrag(
() => ({
type: 'post',
@ -401,10 +397,10 @@ const CalendarItem: FC<{
<div
ref={dragRef}
onClick={editPost}
className="relative"
className={clsx("relative", state === 'DRAFT' && '!grayscale')}
data-tooltip-id="tooltip"
style={{ opacity }}
data-tooltip-content={`${
data-tooltip-content={`${state === 'DRAFT' ? 'Draft: ' : ''}${
integrations.find(
(p) => p.identifier === post.integration?.providerIdentifier
)?.name

View File

@ -38,6 +38,7 @@ export const menuItems = [
icon: 'billing',
path: '/billing',
role: ['ADMIN', 'SUPERADMIN'],
requireBilling: true,
},
];
@ -50,6 +51,9 @@ export const TopMenu: FC = () => {
<ul className="gap-5 flex flex-1 items-center text-[18px]">
{menuItems
.filter((f) => {
if (f.requireBilling && process.env.isBillingEnabled === 'false') {
return false;
}
if (f.role) {
return f.role.includes(user?.role!);
}

26
docker-compose.dev.yaml Normal file
View File

@ -0,0 +1,26 @@
version: '3.9'
services:
gitroom-postgres:
image: postgres:14.5
container_name: gitroom-postgres
restart: always
environment:
POSTGRES_PASSWORD: gitroom-local-pwd
POSTGRES_USER: gitroom-local
POSTGRES_DB: gitroom-db-local
volumes:
- postgres-volume:/var/lib/postgresql/data
ports:
- 5432:5432
gitroom-redis:
image: redis:7.2
container_name: gitroom-redis
restart: always
ports:
- 6379:6379
volumes:
postgres-volume:
external: false