System for showing and managing simple surveys.
Built with:
Extendings of existing functionality
This project adds some extra functionality based on roles when creating entities in the ui and listing entities in the ui. This means that when you set the role property on a field in config/packages/easy_admin.yaml it will affect the fields in the create and edit form and in the table when listing entities.
Example for list action:
# config/packages/easy_admin.config
# Here only users with the ROLE_ADMIN role will see the user field in the listing view.
Survey:
class: App\Entity\Survey
role: ROLE_USER
list:
fields:
- id
- title
- question
- { property: 'user', role: ROLE_ADMIN } Example for form:
# config/packages/easy_admin.config
# Here only users with the ROLE_ADMIN role will see the user field when creating and editing Surveys.
# NB! This overrides the EasyAdmin extension functionality that hides fields when setting the role property.
Survey:
class: App\Entity\Survey
role: ROLE_USER
form:
fields:
- title
- question
- positive_follow_up
- negative_follow_up
- follow_up_text_1
- follow_up_text_2
- follow_up_text_3
- follow_up_text_4
- follow_up_text_5
- { property: 'user', role: ROLE_ADMIN }You need Docker for running this project.
The itkdev-docker-compose helper scripts is nice to have, but not required. Although almost all following examples of interactions with the docker containers will use the helper scripts.
Create local copy of .env file in your project directory:
cp .env .env.localAnd fill out the database settings and mail settings in your .env.local:
# .env.local
DATABASE_URL=mysql://db:db@mariadb:3306/db
MAILER_URL=smtp://mailhog
Start docker containers:
docker-compose up -dMake composer install dependencies and create needed directories:
itkdev-docker-compose composer installRun the migrations:
itkdev-docker-compose bin/console doctrine:migrations:migrate --no-interactionCreate a super admin user:
itkdev-docker-compose bin/console fos:user:create --super-adminInstall front-end tools and run encore (webpack)
itkdev-docker-compose run yarn install
itkdev-docker-compose run yarn encore devOpen up the url for the nginx container:
# Outputs the url to the site
itkdev-docker-compose url
# Opens the site in the default browser
itkdev-docker-compose open