Skip to content

Commit

Permalink
Merge pull request #260 from HiEventsDev/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
daveearley authored Oct 18, 2024
2 parents 1c2188f + 8a98046 commit f465578
Show file tree
Hide file tree
Showing 62 changed files with 1,418 additions and 743 deletions.
13 changes: 10 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ assignees: ''

---

> [!NOTE]
> Please stick to the template and provide as much detail as possible to help us diagnose and fix the issue.
> Low effort bug reports will be closed.
**Describe the bug**
A clear and concise description of what the bug is.

Expand All @@ -23,11 +27,17 @@ A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.

**Logs**
Add any relevant error logs. If it's an error in the browser, please include the browser console logs as well
as what endpoints are being hit and what the response from the server is.

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

or

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
Expand All @@ -37,8 +47,5 @@ If applicable, add screenshots to help explain your problem.
**Hi.Events Version and platform**
Please state the version of Hi.Events you are using and what platform it is hosted on. Local, Docker etc.

**Logs**
Add any relevant error logs

**Additional context**
Add any other context about the problem here.
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ assignees: ''

---

ℹ️ Please check if the feature you're requesting already exists in the project's roadmap or issues.

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
124 changes: 93 additions & 31 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,38 @@
# Contribution Guidelines for Hi.Events

Thank you for your interest in contributing to Hi.Events! We welcome contributions from the community and are excited
to collaborate with you to improve our event management and ticket-selling platform. Before you start, please read through
these guidelines to ensure a smooth contribution process.
Thank you for your interest in contributing to Hi.Events! We welcome contributions from the community and are excited to collaborate with you to improve our event management and ticket-selling platform. Before you start, please read these guidelines to ensure a smooth contribution process.

## Table of Contents

1. [How Can I Contribute?](#how-can-i-contribute)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)
- [Pull Requests](#pull-requests)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)
- [Pull Requests](#pull-requests)
2. [Development Setup](#development-setup)
3. [Style Guides](#style-guides)
- [Coding Standards](#coding-standards)
- [Commit Messages](#commit-messages)
4. [License](#license)
- [Style Guides](#style-guides)
- [Coding Standards](#coding-standards)
- [Commit Messages](#commit-messages)
- [Translations](#translations)
- [Backend](#backend)
- [Frontend](#frontend)
- [Database Changes](#database-changes)
3. [License](#license)

## How Can I Contribute?

### Reporting Bugs

If you find a bug, please report it by opening an issue in our [GitHub repository](https://github.com/HiEventsDev/hi.events/issues).
Include as much detail as possible to help us diagnose and fix the issue.
If you find a bug, please report it by opening an issue in our [GitHub repository](https://github.com/HiEventsDev/hi.events/issues). Include as much detail as possible to help us diagnose and fix the issue.

### Suggesting Enhancements

We welcome suggestions for new features or improvements to existing functionality. To suggest an enhancement,
please open an issue in our [GitHub repository](https://github.com/HiEventsDev/hi.events/issues) and provide a detailed description of the proposed
enhancement and its benefits.
We welcome suggestions for new features or improvements to existing functionality. To suggest an enhancement, please open an issue in our [GitHub repository](https://github.com/HiEventsDev/hi.events/issues) and provide a detailed description of the proposed enhancement and its benefits.

### Pull Requests

We accept pull requests for bug fixes, new features, and improvements.
We accept pull requests for bug fixes, new features, and improvements.

Please open an issue or discussion before
starting any significant work to ensure that your contribution aligns with the project's goals.
⚠️ Please open an issue or discussion before starting any significant work to ensure that your contribution aligns with the project's goals.

To submit a pull request:

Expand All @@ -43,7 +41,7 @@ To submit a pull request:
3. Make your changes, ensuring that your code adheres to our coding standards.
4. Commit your changes with a descriptive commit message.
5. Push your changes to your forked repository.
6. Open a pull request to our `develop` branch in the original repository.
6. Open a pull request to the `develop` branch in the original repository.

Please ensure that your pull request includes:

Expand All @@ -53,32 +51,96 @@ Please ensure that your pull request includes:
- Tests for new functionality or bug fixes, if applicable.
- A demo or screenshots, if the changes are visual.

Once you create a pull request, a CLA bot will automatically check if you have signed the Contributor License Agreement (CLA).
Signing is as simple as leaving a comment on the pull request with the message `I have read the CLA Document and I hereby sign the CLA`.
We require all contributors to sign the CLA to ensure that we have the necessary permissions to use and distribute your contributions.
Once you create a pull request, a CLA bot will automatically check if you have signed the Contributor License Agreement (CLA). Signing is as simple as leaving a comment on the pull request with the message: `I have read the CLA Document and I hereby sign the CLA`. We require all contributors to sign the CLA to ensure that we have the necessary permissions to use and distribute your contributions.

## Development Setup

To set up the development environment for Hi.Events, follow the detailed instructions in our [Getting Started with Local Development guide](https://hi.events/docs/getting-started/local-development).

## Style Guides
### Style Guides

### Coding Standards
#### Coding Standards

Please ensure that your code is well formatted and does not contain commented out code or unnecessary whitespace. Make
sure your variable names are descriptive and follow the conventions used in the existing codebase.
Please ensure that your code is well-formatted and does not contain commented-out code or unnecessary whitespace. Use descriptive variable names that follow the conventions used in the existing codebase.

- Follow [PSR-12](https://www.php-fig.org/psr/psr-12/) coding standards for PHP.
- Use ES6+ features for JavaScript and adhere to the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript).
- For React components, follow the [React/JSX Style Guide](https://github.com/airbnb/javascript/tree/master/react).

### Commit Messages
#### Commit Messages

- We don't adhere to any strict commit message format, but please ensure that your messages are clear and descriptive.
- For guidelines, refer to [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/).
We don't adhere to any strict commit message format, but please ensure that your messages are clear and descriptive. For guidelines, refer to [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/).

### Translations

#### Backend

Please wrap all translatable strings in the `__()` helper function. For example:

```php
return [
'welcome' => __('Welcome to Hi.Events!'),
];
```

#### Translation Commands

To extract messages from the codebase, use the following command:

```bash
php artisan langscanner
```

This will update the translation files in the `backend/lang` directory.

#### Frontend

[Lingui](https://lingui.dev/) is used for frontend translations. Please wrap all translatable strings in either the `t` function or `Trans` component. For example:

```jsx
import { t } from '@lingui/macro';

const MyComponent = () => {
return <div>{t`Welcome to Hi.Events!`}</div>;
};
```

#### Translation Commands

To extract messages from the codebase and compile translations, use the following commands:

```bash
yarn messages:extract && yarn messages:compile
```

To list all untranslated messages, run:

```bash
cd frontend/scripts && ./list_untranslated_strings.sh
```

### Database Changes

If you are making changes to the database schema, please update the migration files accordingly.

We use [Laravel Migrations](https://laravel.com/docs/master/migrations) to manage schema changes. Migration files should only contain schema changes and no logic.

To generate a new migration file, use:

```bash
php artisan make:migration create_XXX_table
```

After running the migration, update the Domain Objects with:

```bash
php artisan generate-domain-objects
```

This will update the Domain Objects in `backend/app/DomainObjects` based on the schema changes.

## License

By contributing to Hi.Events, you agree that your contributions will be licensed under the [AGPL-3.0 License](LICENSE).
By contributing to Hi.Events, you agree that your contributions will be licensed under the [AGPL-3.0 License with additional terms](LICENSE).

Thank you for contributing to Hi.Events! If you have any questions, feel free to reach out to us.
Thank you for contributing to Hi.Events! If you have any questions, feel free to reach out to us.
4 changes: 2 additions & 2 deletions Dockerfile.all-in-one
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FROM node:alpine AS node-frontend

WORKDIR /app/frontend

ENV PHP_OPCACHE_ENABLE=1

RUN apk add --no-cache yarn

COPY ./frontend/package.json ./frontend/yarn.lock ./
Expand All @@ -14,6 +12,8 @@ RUN yarn install && yarn build

FROM serversideup/php:beta-8.3.2-fpm-alpine

ENV PHP_OPCACHE_ENABLE=1

RUN install-php-extensions intl

RUN apk add --no-cache nodejs yarn nginx supervisor
Expand Down
2 changes: 1 addition & 1 deletion INSTALL_WITHOUT_DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This guide provides instructions for setting up Hi.Events locally without using Docker, including the necessary prerequisites,
setup steps, and configuration details.

**For a faster and more reliable setup, we strongly recommend using the official [Docker setup](https://hi.events/docs/getting-started/quick-start).**
**ℹ️ For a faster and more reliable setup, we strongly recommend using the official [Docker setup](https://hi.events/docs/getting-started/quick-start).**

## Prerequisites

Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,23 @@ a quick start, follow these steps:
ℹ️ Please refer to the [getting started guide](https://hi.events/docs/getting-started) for other installation methods, and
for setting up a production or local development environment.

## 💜 Support Hi.Events
## 💜 Sponsors
<a href="https://stinkingbadges.app/?utm_source=hi.events-readme">
Stinking Badges
</a>

### Making a Donation

If you find Hi.Events useful, it would be massively appreciated if you made a small donation to help support the project.

We'll use your donation to fund ongoing development and maintenance of Hi.Events.

<a href="https://www.buymeacoffee.com/hi.events" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
<br/>
or
<a href="https://github.com/sponsors/HiEventsDev" target="_blank"> Sponsor on GitHub</a>
or
<a href="https://opencollective.com/hievents" target="_blank"> Sponsor on Open Collective</a>

## 📝 Change Log

Expand All @@ -162,8 +171,8 @@ our [GitHub releases page](https://github.com/HiEventsDev/hi.events/releases).

## 🤝 Contributing

We welcome contributions, suggestions, and bug reports! Before proposing a new feature or extension,
please open an issue to discuss it.
We welcome contributions, suggestions, and bug reports! Please see our [contributing guidelines](CONTRIBUTING.md) for more
information.

## ❓ FAQ

Expand Down
5 changes: 3 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM serversideup/php:beta-8.3-fpm-nginx-alpine
FROM serversideup/php:8.3-fpm-nginx-alpine

ENV PHP_OPCACHE_ENABLE=1

USER root

# Set `www-data` as the user to start FPM
RUN echo "user = www-data" >> /usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf && \
RUN echo "" >> /usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf && \
echo "user = www-data" >> /usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf && \
echo "group = www-data" >> /usr/local/etc/php-fpm.d/docker-php-serversideup-pool.conf

RUN install-php-extensions intl
Expand Down
14 changes: 14 additions & 0 deletions backend/app/DomainObjects/Generated/TicketDomainObjectAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ abstract class TicketDomainObjectAbstract extends \HiEvents\DomainObjects\Abstra
final public const DELETED_AT = 'deleted_at';
final public const TYPE = 'type';
final public const IS_HIDDEN = 'is_hidden';
final public const START_COLLAPSED = 'start_collapsed';

protected int $id;
protected int $event_id;
Expand All @@ -53,6 +54,7 @@ abstract class TicketDomainObjectAbstract extends \HiEvents\DomainObjects\Abstra
protected ?string $deleted_at = null;
protected string $type = 'PAID';
protected ?bool $is_hidden = false;
protected bool $start_collapsed = false;

public function toArray(): array
{
Expand All @@ -78,6 +80,7 @@ public function toArray(): array
'deleted_at' => $this->deleted_at ?? null,
'type' => $this->type ?? null,
'is_hidden' => $this->is_hidden ?? null,
'start_collapsed' => $this->start_collapsed ?? null,
];
}

Expand Down Expand Up @@ -311,4 +314,15 @@ public function getIsHidden(): ?bool
{
return $this->is_hidden;
}

public function setStartCollapsed(bool $start_collapsed): self
{
$this->start_collapsed = $start_collapsed;
return $this;
}

public function getStartCollapsed(): bool
{
return $this->start_collapsed;
}
}
1 change: 1 addition & 0 deletions backend/app/Http/Request/Ticket/UpsertTicketRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function rules(): array
'hide_before_sale_start_date' => 'boolean',
'hide_after_sale_end_date' => 'boolean',
'hide_when_sold_out' => 'boolean',
'start_collapsed' => 'boolean',
'show_quantity_remaining' => 'boolean',
'is_hidden_without_promo_code' => 'boolean',
'type' => ['required', Rule::in(TicketType::valuesArray())],
Expand Down
1 change: 1 addition & 0 deletions backend/app/Resources/Ticket/TicketResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function toArray(Request $request): array
'initial_quantity_available' => $this->getInitialQuantityAvailable(),
'hide_before_sale_start_date' => $this->getHideBeforeSaleStartDate(),
'hide_after_sale_end_date' => $this->getHideAfterSaleEndDate(),
'start_collapsed' => $this->getStartCollapsed(),
'show_quantity_remaining' => $this->getShowQuantityRemaining(),
'hide_when_sold_out' => $this->getHideWhenSoldOut(),
'is_hidden_without_promo_code' => $this->getIsHiddenWithoutPromoCode(),
Expand Down
1 change: 1 addition & 0 deletions backend/app/Resources/Ticket/TicketResourcePublic.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function toArray(Request $request): array
'event_id' => $this->getEventId(),
'is_before_sale_start_date' => $this->isBeforeSaleStartDate(),
'is_after_sale_end_date' => $this->isAfterSaleEndDate(),
'start_collapsed' => $this->getStartCollapsed(),
$this->mergeWhen($this->getShowQuantityRemaining(), fn() => [
'quantity_available' => $this->getQuantityAvailable(),
]),
Expand Down
1 change: 1 addition & 0 deletions backend/app/Services/Domain/Ticket/CreateTicketService.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ private function persistTicket(TicketDomainObject $ticketsData): TicketDomainObj
'hide_before_sale_start_date' => $ticketsData->getHideBeforeSaleStartDate(),
'hide_after_sale_end_date' => $ticketsData->getHideAfterSaleEndDate(),
'hide_when_sold_out' => $ticketsData->getHideWhenSoldOut(),
'start_collapsed' => $ticketsData->getStartCollapsed(),
'show_quantity_remaining' => $ticketsData->getShowQuantityRemaining(),
'is_hidden_without_promo_code' => $ticketsData->getIsHiddenWithoutPromoCode(),
'event_id' => $ticketsData->getEventId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function handle(UpsertTicketDTO $ticketsData): TicketDomainObject
->setHideBeforeSaleStartDate($ticketsData->hide_before_sale_start_date)
->setHideAfterSaleEndDate($ticketsData->hide_after_sale_end_date)
->setHideWhenSoldOut($ticketsData->hide_when_sold_out)
->setStartCollapsed($ticketsData->start_collapsed)
->setShowQuantityRemaining($ticketsData->show_quantity_remaining)
->setIsHiddenWithoutPromoCode($ticketsData->is_hidden_without_promo_code)
->setTicketPrices($ticketPrices)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function __construct(
public readonly ?bool $hide_before_sale_start_date = false,
public readonly ?bool $hide_after_sale_end_date = false,
public readonly ?bool $hide_when_sold_out = false,
public readonly ?bool $start_collapsed = false,
public readonly ?bool $show_quantity_remaining = false,
public readonly ?bool $is_hidden_without_promo_code = false,
public readonly ?array $tax_and_fee_ids = [],
Expand Down
Loading

0 comments on commit f465578

Please sign in to comment.