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

User system refacto #422

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ COMPOSE_PROJECT_NAME=resop

IMAGE_BUILD_TAG=dev

APP_NB_USERS=10
APP_NB_USERS=15
APP_NB_AVAILABILITIES=3
APP_SLOT_INTERVAL="+2 hours"

Expand All @@ -35,3 +35,7 @@ APP_SECRET=782bb8b0aeb47de4ea870794e79d82cd
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
DATABASE_URL=postgresql://resop:postgrespwd@postgres/resop?serverVersion=11&charset=utf8
###< doctrine/doctrine-bundle ###

###> symfony/mailer ###
MAILER_DSN=smtp://mailcatcher:25
###< symfony/mailer ###
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ SYMFONY_DEPRECATIONS_HELPER=disabled
DATABASE_URL=postgresql://resop:postgrespwd@postgres/resop-test?serverVersion=11&charset=utf8
PANTHER_CHROME_ARGUMENTS="--headless --no-sandbox"
PANTHER_APP_ENV=panther
APP_SLOT_INTERVAL="+2 hours"
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Get the version
id: vars
run: |
echo ::set-output name=BUILD_TAG::$(git describe --tags)
echo ::set-output name=BUILD_TAG::$(git describe --tags --always)
echo ::set-output name=CI_COMMIT_REF_SLUG::${GITHUB_REF#refs/*/}

- name: Pull existing Docker image
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
APP_DEBUG: 0
DATABASE_SERVER_VERSION: 11 # update service "postgresql" if this value change
PANTHER_CHROME_DRIVER_BINARY: /usr/bin/chromedriver
MAILER_DSN: smtp://localhost:25

jobs:
php:
Expand All @@ -32,6 +33,11 @@ jobs:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mailcatcher:
image: tophfr/mailcatcher:0.6.5
ports:
- 1080:80
- 25:25

steps:
- name: set DATABASE_URL environment variable
Expand Down Expand Up @@ -72,7 +78,7 @@ jobs:
if: always()

- name: Install composer dependencies
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Cache node_modules
uses: actions/cache@v1
Expand Down Expand Up @@ -133,6 +139,7 @@ jobs:
- name: Run Behat tests
run: |
bin/post-install-test.sh
sed -i 's#http://mailcatcher#http://localhost:1080#' behat.yml.dist
vendor/bin/behat --format=progress --out=std --format=junit --out=var/behat --tags '~@javascript'
if: always()

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ build-prod:
docker build -t resop:latest -f docker/php-flex/Dockerfile .

start-db:
$(DOCKER_COMPOSE_UP) traefik postgres adminer
$(DOCKER_COMPOSE_UP) traefik postgres adminer mailcatcher
docker-compose run --rm wait -c postgres:5432

start-php:
$(DOCKER_COMPOSE_UP_RECREATE) traefik nginx fpm
docker-compose run --rm wait -c fpm:9000,nginx:80
@echo -n "\nStack started with success:\nhttp://resop.vcap.me:7500/login => [email protected] : 01/01/1990"
@echo -n "\nhttp://resop.vcap.me:7500/organizations/login => DT75 : covid19\n"
@echo -n "\nStack started with success: http://resop.vcap.me:7500/\[email protected] : covid19\[email protected] : covid19\[email protected] : covid19\n"

start: init-db start-php

Expand Down Expand Up @@ -130,6 +129,7 @@ test-coverage:
bin/tools sh -c "COVERAGE=true vendor/bin/behat --format=progress"

move-test-profiler:
@echo "You must set 'profiler: { collect: true }' in config/packages/test/web_profiler.yaml in order to use this command"
bin/tools sh -c "rm -rf var/cache/dev/profiler && mkdir -p var/cache/dev && cp -R var/cache/test/profiler var/cache/dev/profiler"
@echo "Done : http://resop.vcap.me:7500/_profiler/search?limit=10"

Expand Down
10 changes: 0 additions & 10 deletions assets/css/login.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

$xs: 380px;

@media (min-width: 360px) and (max-width: map-get($grid-breakpoints, "sm")) {
.form-inline {
.form-control {
display: inline-block;
width: auto;
vertical-align: middle;
}
}
}

body.login {
.navbar-and-body {
background-image: url(../img/login-background.jpg);
Expand Down
4 changes: 2 additions & 2 deletions assets/js/_planning-missions.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ function setSlotMisssion(mission, $slot) {
missionsText += ' ';

// User part
let url = Routing.generate('app_user_availability_mission_modal', { id: mission.id });
let url = Routing.generate('app_user_availability_mission_modal', { mission: mission.id });

if (window.location.pathname.indexOf('organizations') >= 0 && !!mission?.organization?.id) {
// Organization part
url = Routing.generate('app_organization_mission_modal', { organization: mission.organization.id, id: mission.id });
url = Routing.generate('app_organization_mission_modal', { organization: mission.organization.id, mission: mission.id });
}

missionsText += $(`<button type="button" class="btn btn-link" data-toggle="ajax-modal" data-href="${url}">`).text(mission.name)[0].outerHTML;
Expand Down
2 changes: 1 addition & 1 deletion assets/js/fos_js_routes.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"base_url":"","routes":{"app_user_availability_mission_modal":{"tokens":[["text","\/modal"],["variable","\/","\\d+","id",true],["text","\/user\/availability\/missions"]],"defaults":[],"requirements":{"id":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"app_organization_mission_modal":{"tokens":[["text","\/modal"],["variable","\/","\\d+","id",true],["text","\/missions"],["variable","\/","\\d+","organization",true],["text","\/organizations"]],"defaults":[],"requirements":{"id":"\\d+","organization":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"app_organization_mission_find_by_filters":{"tokens":[["text","\/missions\/find"],["variable","\/","\\d+","organization",true],["text","\/organizations"]],"defaults":[],"requirements":{"organization":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]}},"prefix":"","host":"localhost","port":"","scheme":"http","locale":[]}
{"base_url":"","routes":{"app_user_availability_mission_modal":{"tokens":[["text","\/modal"],["variable","\/","\\d+","mission",true],["text","\/user\/availability\/missions"]],"defaults":[],"requirements":{"mission":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"app_organization_mission_modal":{"tokens":[["text","\/modal"],["variable","\/","\\d+","mission",true],["text","\/missions"],["variable","\/","\\d+","organization",true],["text","\/organizations"]],"defaults":[],"requirements":{"mission":"\\d+","organization":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"app_organization_mission_find_by_filters":{"tokens":[["text","\/missions\/find"],["variable","\/","\\d+","organization",true],["text","\/organizations"]],"defaults":[],"requirements":{"organization":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]}},"prefix":"","host":"localhost","port":"","scheme":"http","locale":[]}
9 changes: 7 additions & 2 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ default:
- App\Tests\Behat\DatabaseContext
- App\Tests\Behat\FixturesContext
- App\Tests\Behat\OrganizationPlanningContext
- App\Tests\Behat\ResetPasswordContext
- App\Tests\Behat\SecurityContext
- App\Tests\Behat\TraversingContext
- App\Tests\Behat\UserPlanningContext
- App\Tests\Behat\MailsContext
- Behat\MinkExtension\Context\MinkContext
- PantherExtension\Context\PantherContext
- PantherExtension\Context\WaitContext:
- PantherExtension\Context\WaitContext
extensions:
PantherExtension\Extension\PantherExtension: ~
Alex\MailCatcher\Behat\MailCatcherExtension\Extension:
url: http://mailcatcher
purge_before_scenario: true
Behat\MinkExtension:
browser_name: chrome
default_session: symfony
Expand All @@ -28,3 +32,4 @@ default:
kernel:
environment: test
debug: true
PantherExtension\Extension\PantherExtension: ~
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"symfony/form": "5.*",
"symfony/framework-bundle": "5.*",
"symfony/intl": "5.*",
"symfony/mailer": "5.*",
"symfony/monolog-bundle": "^3.5",
"symfony/security-bundle": "5.*",
"symfony/serializer-pack": "^1.0",
Expand All @@ -35,10 +36,12 @@
"symfony/validator": "5.*",
"symfony/webpack-encore-bundle": "^1.7",
"symfony/yaml": "5.*",
"symfonycasts/reset-password-bundle": "^1.1",
"twig/cache-extension": "^1.4",
"twig/intl-extra": "^3.0"
},
"require-dev": {
"alexandresalome/mailcatcher": "^1.3",
"behat/behat": "^3.6",
"dama/doctrine-test-bundle": "^6.3",
"escapestudios/symfony2-coding-standard": "^3.11",
Expand Down
Loading