Skip to content

Feature/trick creation #15

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

Merged
merged 29 commits into from
Jul 2, 2020
Merged

Feature/trick creation #15

merged 29 commits into from
Jul 2, 2020

Conversation

sjeguedes
Copy link
Owner

@sjeguedes sjeguedes commented Jul 2, 2020

This branch creates trick creation form process (trick content and attached image and videos medias).
This merge aims at testing better workflow with development and features branches added to master. No issue is referenced for this pull request.

This branch treated expected changes and "fixed" issue: #14

  • Added trick creation action

  • Added custom constraints on collection subforms

  • Added sortable capability on collection boxes inside trick creation form

  • Added "main image" selection in form

  • Added advanced temporary image upload to save image permanently on each submit, and video availability check with cURL: tampered data are always checked

  • Improved stability for image crop process

  • Added a custom cli Symfony Command which is used manually or with CRON job to purge unused temporary images

  • Added moderation on trick creation for admin / By default simple member author can only create an unpublished trick

  • Added a custom Symfony Voter rule to precise trick author permissions to be able to view his unpublished tricks on front-end: an administrator can view all unpublished tricks

  • Added a custom Voter rule to precise trick author permissions to be able to edit/delete only his created tricks on front-end: an administrator can perform all actions on all tricks

  • Added Voter unit test which is a critical functionality

  • Fixed several bugs detected on previous functionalities (image transparency, user profile avatar, xss potential issues)

  • Improved domain and database schema to add more flexibility (e.g. media owner and media source) and better organization

  • Improved routing definition to be ready for i18n evolution

  • Improved UI for better experience on several pages

  • Saved JS and SCSS files sources

These pages or functionalities need to be tested to limit possible bugs, despite the use of xdebug on branch.

Message: please accept this merge and be conscious multiple changes will be made later.

…templates, root form and subform types for images/videos collection, DTOs/DTOCollection - TODO: need to end images collection and implement videos collection properly (PHP and JavaScript) - TODO: need to terminate Trick creation process in dedicated form handler (entire form validation, entities persistence, database data, images generation on server)
…h cURL instead of fopen() which had an issue and was blocking single trick videos iframes loading with 500 HTTP error - fixed access to single trick images on frontend which had a double slash in configured upload path parameters in service.yaml
…me value validation when cropJONData value is null - improved VideoURLProxyChecker verify() method when url value is null
… with event delegation for blocks listeners, fixed block image order, fixed freezing bug when the same file is selected twice in order to correctly show crop modal, fixed block removal - added MAIN IMAGE label by activating corresponding checkbox and unckecking others - added main image activation when the first block is generated - fixed also small bugs on avatar process with these kind of modifications: close correctly other notifications on ajax mode - added control on client side by stopping crop process due to invalid file - TODO: need to add main image validation to avoid all checkboxes to be set to false and continue Trick creation process
…raintValidator to avoid all checkboxes to be set to false (all unchecked)
…hecking if only one image is defined as main to avoid user tampered data in this case - reset values in image to crop box if the file is not validated on client side - disabled upload button and file input on front-end to limit as much as possible unnecessary uploads on server: these unattached images can be purged later from server with Symfony command and cron tab for instance
…database: this is only added to images collection at this time and aims at sorting images and videos collections on front-end with sortablejs JavaScript script - TODO: need to add this on video collection - implemented smart validation, by keeping coherent ranks data to maintain correct loop on view, and adding order control to avoid tampered data by malicious user on finishView() trick root form type method - added string to integer data transformer to handle integer for this new property
…t is made for images collection - created video prototype and editable templates - activated custom validator on VideoInfosDTO to check allowed URL and existing content with custom VideoURLProxyChecker service - reviewed and cleaned code on entities methods exceptions - strengthened VideoURLProxyChecker by adding cURL error string state in control to be sure to have an existing video content
… expect at least one item in DTOCollection instances and show error on front-end - fixed DTOCollection by implementing Countable interface
…e name - fixed StrinHelperTrait sanitizeString() method to format image name as expected with filtered punctuation based on its original name - fixed Media entity to accept a nulled show list rank during image direct upload when Trick creation form is not yet validated - cleaned a few concerned PHP classes
…eToCropType finishView() method - fixed crop box data behavior in JavaScript cropmove event to offer a coherent proportional area when user makes a crop in modal - prepared Trick update form valid savedImageName logic in ImageToCropConstraintValidator to accept a normal image path instead of image data URI - arranged collections entry types templates for a future removal confirmation modal which will call AJAX action - Refactored avatar update form handler to check crop data with AbstractUploadFormHandler - reviewed image identifier name for direct upload in ImageToCropType pre-submit form event
…te for all pages with CSS modifications - added trick default images
…n all actions to prepare possible translations - fixed a small bug in LoginHandler form handler to return correctly custom authentication error - fixed transparency for gif and png images to make a correct image generation in ImageUploader and adapted avatar creation with this fix
…ng user avatar or trick image - refactored a huge code in ImageUploader and ImageManager to adapt process for trick resized images to generate, which are based on existing image (big) without upload - TODO: need to check code to find possible regressions in upload process
…entities (Message/Comment entity is not created yet) and updated database schema with new migration - changed Image/Video and Media relationship from ManyToOne to OneToOne to make more sens
…ns server side: JavaScript: fixed crop process to enforce minimum crop area to preserve image quality - improved scripts by cleaning useless parts - PHP: refactored a lot of code to prepare Trick update process correctly - secured upload process and Trick creation management in corresponding service layers - reviewed corresponding Database queries (DQL, Doctrine extension to order medias as expected with FIELD SQL function) - BOTH JavaScript and PHP: improved UI to implement new features (medias order, show list rank, trick single page medias presentation) and fixed embarrassing bugs (mobile navigation, mobile single trick page medias slider show/hide function)
…e.js file to make current slider media video stop when a media video modal is opened to start and view it in bigger format
…d position on screen resize - added Symfony Command to remove (manually or automatically with cron job) unused uploaded images on server - Improved image existance check by modifying method and fixing bugs - modified a few extra things (constraints messages, templates, ...)
… by using double escaping dirty tip - fixed AJAX request (by unescaping in JS) to check video availability due to data-... HTML5 attributes Twig XSS escaping 'html_attr' strategy - updated fixtures yaml files to prepare next database changes on Trick, Media, Image, Video entities - saved CSS and JavaScript files sources with versioning
…tities to manage a kind of polymorphic relationships between medias and tricks/users - improved VideoURLProxyChecker by using a particular case for Youtube and checking 200 HTTP status code for all videos - improved Trick creation process by fixing bugs
…wner and MediaSource entities - updated database schema
… (portrait, landscape, square) - improved reliability by reviewing script and customised crop box colors - added also a link to create a trick from user profile page
…and database schema changes - improved profil avatar update process to strengthen it - cleaned files in src folder not to have HTML like br or strong tags in strings anymore
… image completely (entity and file) with AJAX request and a single form in modal - this can be used for during trick creation or update process
…ess permissions with a TrickVoter, by adapting trick list database query, controller and Twig templates - added unit test for this voter with TrickVoterTest - added moderation capability on trick creation for administrator to publish/unpublish a trick, by adding a select choice type input
…hich caused a bug with response notification with also a performance issue - improved stability for JS image cropper - saved JS and CSS files sources - need to create the same deletion process for video (with a modal form) by adding trick update form process to be implemented
@sjeguedes sjeguedes merged commit 2b5a35d into develop Jul 2, 2020
@sjeguedes
Copy link
Owner Author

sjeguedes commented Jul 2, 2020

Merge accepted!

Please note that:

Adding more unit tests would be a good choice to strengthen application!
Caution: composer.json file has to be updated to upgrade Symfony from 4.2.12 to version 4.3/4.4 to reach a LTS one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant