@@ -66,24 +66,24 @@ _**Linux users:** To get Elasticsearch 6 to run, you must make a settings change
When things aren't running smoothly in your Dockerized enviroment, sometimes it's best to start from scratch. Follow these steps to **completely delete your data** and start fresh:
```
#Remove your settings file
rm engine/settings.php
#Remove your settings file
rm engine/settings.php
#Stop your stack
docker-compose down
#Stop your stack
docker-compose down
#Delete your data cache
rm -rf .data
#Delete your data cache
rm -rf .data
#Purge all volumes
docker volume prune
#Purge all volumes
docker volume prune
```
After you've deleted your data, you can either rebuild the containers manually by using `docker-compose up --build` or delete them:
Sockets are for live interactions, such as comments, group gathering pulsators, notifications, messenger, and the jury.
Note: if you are using Docker, make sure your **JWT secret** maps to the **JWT secret** in `settings.php`. Kubernetes automatically maps it to the helm .yaml file.
See the [README.md](https://gitlab.com/minds/sockets/blob/master/README.md) of the [Minds Sockets Server](https://gitlab.com/minds/sockets) repository for build instructions.
@@ -9,22 +9,22 @@ Minds uses [Angular 8](https://angular.io) for the frontend. Work is currently u
The source code can be found in the [front repository](https://gitlab.com/minds/front).
# Building
## Building
## Development
### Development
From the front repository:
`npm run build-dev`
Keep this running while you are editing so your changes will automatically be reflected when you refresh your browser. Note that this doesn't apply to stylesheet changes - so when you're working with .scss files, you'll need to run `gulp build.sass` before you'll be able to see those changes.
## Production
### Production
_Production build can take up 30 minutes to complete_
`gulp build.sass && sh build/base-locale.sh dist`
# Structure
## Structure
```
front
...
...
@@ -37,19 +37,17 @@ front
└───modules
```
## Common
### Common
> TODO
In most cases, new code will be stored inside subject-specific module folders. However, if you are making something that will be used throughout the site, put it in `/common` so it can be easily accessed from other modules. Some examples of the kind of things that belong in `/common`:
In most cases, new code will be stored inside subject-specific module folders. However, if you are making something that will be used throughout the site, put it in `/common/` so it can be easily accessed from other modules. Some examples of the kind of things that belong in `/common/`:
-**Directives**: user profile hovercard, tooltips, things related to Material design lite (slider, switch, date time picker), etc.
-**Pipes**: ... examples ...
- What else is in here...
# Naming conventions
## Naming conventions
## Component files
### Component files
Components should have `.ts`, `.html` and `.scss` files with the same names.
...
...
@@ -62,7 +60,7 @@ my-cool-module
└───list.component.scss
```
## Elements and classes
### Elements and classes
Minds follows the [BEM](http://getbem.com/naming/) naming conventions for elements and class names, with the `m-` prefix. For example:
...
...
@@ -80,31 +78,31 @@ Minds follows the [BEM](http://getbem.com/naming/) naming conventions for elemen
If you need to add a new class to an older file that has not yet been updated to use BEM conventions, add the new class twice: once with BEM, and again with whatever legacy convention the file is currently using.
## Linting
### Linting
Minds uses [Prettier](https://prettier.io/) to enforce consistent formatting in frontend code.
Before you push your MR, run `prettier --write "src/**/*.{scss,ts,html}"` (or, if possible, download a Prettier plug-in for your code editor and tell it to automatically format the code on save). Defaults are configured in `.prettierrc`.
# Spec tests
## Spec tests
### Executing
#### Executing
`ng test`
### Cypress tests
#### Cypress tests
> TODO: Brian
# Styles
## Styles
## Themes
### Themes
A preset color palette and theme maps are defined in [themes.scss](https://gitlab.com/minds/front/blob/src/stylesheets/themes.scss). The palette contains a range of greys, blue-greys, accent colors, black, white, etc.
A preset color palette and theme maps are defined in [themes.scss](https://gitlab.com/minds/front/blob/master/src/stylesheets/themes.scss). The palette contains a range of greys, blue-greys, accent colors, black, white, etc.
When styling a new component, select colors that are for light theme only. Dark theme inversions will be automatically applied according to the theme map.
### Usage
#### Usage
_All_ colors should be defined using the `m-theme` mixin:
For the Minds development team, **branches** are preferred over forks, as they integrate with the **review/sandbox** environments. Community contributors should use forks.
### Branch names
Branch names should be no more that **20 characters** long and include the related issue/epic number. For example, **virtual-reality-chats-7049**.
If you are working on an epic with branches in both front and engine, give both branches identical names to associate them in the sandbox.
...
...
@@ -36,7 +38,7 @@ If the issue is part of an epic, associate them by going to the epic page and ad
## Merge requests
> If your merge request requires changes and isn't ready to be merged yet, add "WIP: " at the beginning of its title. Make sure it does not have the 'MR::Awaiting Merge' label applied.
> If your merge request requires changes and isn't ready to be merged yet, add **WIP:** to the beginning of its title. Make sure it does not have the **MR::Awaiting Merge** label applied.
In the description of your MR, ensure that you:
...
...
@@ -46,11 +48,11 @@ In the description of your MR, ensure that you:
**For example**:
_Allows users to chat in virtual reality. Users must select a checkbox in channel settings in order to opt-in. Users must be logged in and subscribed to one another in order to be eligible. Not enabled for group chats_.\_
_Allows users to chat in virtual reality. Users must select a checkbox in channel settings in order to opt-in. Users must be logged in and subscribed to one another in order to be eligible. Not enabled for group chats._
_To test, try to start a VR chat with/without a VR headset. Make sure you can't engage in a VR chat unless the settings checkbox is checked._
1. An event occurs (e.g. a new user joins Minds) and dispatches a message to the queue
2. The queue then dispatches an internal event
3. The internal event compiles and dispatches the email
4.[Mailer.php](https://gitlab.com/minds/engine/blob/Core/Email/Mailer.php) does the actual sending
4.[Mailer.php](https://gitlab.com/minds/engine/blob/master/Core/Email/Mailer.php) does the actual sending
# Email templates
### Email templates
The email itself inherits from [Template.php](https://gitlab.com/minds/engine/blob/Core/Email/Template.php), which builds and outputs the email. We use .tpl files that get wrapped in a general [default.tpl](https://gitlab.com/minds/engine/blob/Components/Email/default.tpl)(which has the headers and footers).
The email itself inherits from [Template.php](https://gitlab.com/minds/engine/blob/master/Core/Email/Template.php), which builds and outputs the email. We use .tpl files that get wrapped in a general [default.tpl](https://gitlab.com/minds/engine/blob/master/Components/Email/default.tpl)(which has the headers and footers).
You can also use/extend optional [EmailStyles.php](https://gitlab.com/minds/engine/blob/Core/Email/EmailStyles.php) and partials (reusable snippets that get built and injected into the email) for additional control over styles. See [SuggestedChannels.php](https://gitlab.com/minds/engine/blob/Core/Email/Partials/SuggestedChannels.php) and
[SuggestedChannels.tpl](https://gitlab.com/minds/engine/blob/Core/Email/Partials/Templates/SuggestedChannels.tpl) for partial usage examples.
You can also use/extend optional [EmailStyles.php](https://gitlab.com/minds/engine/blob/master/Core/Email/EmailStyles.php) and partials (reusable snippets that get built and injected into the email) for additional control over styles. See [SuggestedChannels.php](https://gitlab.com/minds/engine/blob/master/Core/Email/Partials/SuggestedChannels.php) and
[SuggestedChannels.tpl](https://gitlab.com/minds/engine/blob/master/Core/Email/Partials/Templates/SuggestedChannels.tpl) for partial usage examples.
# Testing
### Testing
See email-related [CLI controllers](https://gitlab.com/minds/engine/blob/Controllers/Cli/Email.php) for tools related to testing and building.
See email-related [CLI controllers](https://gitlab.com/minds/engine/blob/master/Controllers/Cli/Email.php) for tools related to testing and building.
To actually send and test, add your own SMTP server to `settings.php`:
...
...
@@ -27,8 +27,8 @@ To actually send and test, add your own SMTP server to `settings.php`:
Feature flags allow new features to be introduced to a subset of users (i.e. those in Canary mode) before they are available to all users. Do this by enabling a feature flag and then wrapping a gate around code that you want to be executed for applicable users.
Add your `notification_view` to [PushSettings.php](https://gitlab.com/minds/engine/blob/Core/Notification/Settings/PushSettings.php):
Add your `notification_view` to [PushSettings.php](https://gitlab.com/minds/engine/blob/master/Core/Notification/Settings/PushSettings.php):
```php
classPushSettings
{
protected$types=[
...
'videochat_complete'=>true,
];
...
...
@@ -35,14 +33,14 @@ protected $types = [
Also add your `notification_view` to:
-[Notification/Manager.php](https://gitlab.com/minds/engine/blob/Core/Notification/Manager.php) to determine which notification category it belongs to (e.g boosts, subscriptions, votes, etc.)
-[Notification/Manager.php](https://gitlab.com/minds/engine/blob/master/Core/Notification/Manager.php) to determine which notification category it belongs to (e.g boosts, subscriptions, votes, etc.)
> TODO: What is Push.php? and should referrals be in there?
# Frontend template
## Frontend template
Set up the template in [notification.component.html](https://gitlab.com/minds/front/blob/src/app/modules/notifications/notification.component.html):
Set up the template in [notification.component.html](https://gitlab.com/minds/front/blob/master/src/app/modules/notifications/notification.component.html):
```html
<ng-templatengSwitchCase="videochat_complete">
...
...
@@ -50,7 +48,7 @@ Set up the template in [notification.component.html](https://gitlab.com/minds/fr
</ng-template>
```
# Testing
## Testing
Make sure the notification dispatcher runner is running: