creativecommons / termination-of-transfer

Termination of Transfer tool
https://rightsback.org/questionnaire/
GNU Affero General Public License v3.0
24 stars 31 forks source link

Modernized plugin code-base #132

Open onyijne opened 2 years ago

onyijne commented 2 years ago

Fixes

Description

Technical details

During development to build JavaScript assets cd termination-of-transferthen npm run install to install development dependencies, and npm run build to build the assets

For development purposes a docker-compose.yml file was created with db and PhpMyadmin dbsetup services. I used 8701 as my outside port, you can use anyone that’s open and free on your host machine. After getting the files, cd to it cd termination-of-transfer/dev and run docker compose up -d —build This should start the wp, db and phpmyadmin dbsetup services. After building for the first time you should login to "phpmyadmin", and create a new database named "wordpress" then grant "dbUsername" access to the database. A dbsetup service has been added to automate db setup

Tests

To run Result test on your machine type chmod +x test/result-pdf.sh && test/result-pdf.sh 8701 where 8701 is the port number of your host machine.

Screenshots

alt  #screenshot

Checklist

- [x] My pull request has a descriptive title (not a vague title like `Update index.md`). - [x] My pull request targets the *default* branch of the repository (`main` or `master`). - [x] My commit messages follow [best practices][best_practices]. - [x] My code follows the established code style of the repository. - [x] I added or updated tests for the changes I made (if applicable). - [x] I added or updated documentation (if applicable). - [x] I tried running the project locally and verified that there are no visible errors. [best_practices]:https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53 ## Developer Certificate of Origin

For the purposes of this DCO, "license" is equivalent to "license or public domain dedication," and "open source license" is equivalent to "open content license or public domain dedication."

Developer Certificate of Origin ``` Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 1 Letterman Drive Suite D4700 San Francisco, CA, 94129 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ```
possumbilities commented 2 years ago

@onyijne I would likely suggest you ignore the suggested changes from Kingmax1981, since I'm not sure they weren't done by accident.

possumbilities commented 2 years ago

@onyijne Also, you've done A LOT of work here, which we're very grateful for, but I'm still reviewing, hoping to either approve this today, or provide constructive feedback on any changes still needed :)

onyijne commented 2 years ago

@onyijne Also, you've done A LOT of work here, which we're very grateful for, but I'm still reviewing, hoping to either approve this today, or provide constructive feedback on any changes still needed :)

Okay thanks, I’ll be anticipating.

possumbilities commented 2 years ago

Also, can you clarify the justification for making this into a node project? I feel that is likely outside the scope of this project. It needs to be a standard WordPress plugin, and standard enough that composer could be used to install it. There's no mention in the original requirements that it be installable via npm, so I'm confused on the reasoning?

onyijne commented 2 years ago

Also, can you clarify the justification for making this into a node project? I feel that is likely outside the scope of this project. It needs to be a standard WordPress plugin, and standard enough that composer could be used to install it. There's no mention in the original requirements that it be installable via npm, so I'm confused on the reasoning?

Hi @possumbilities thanks for your review, initially it was not so, I only refactored it to comply with the JavaScript guidelines in the recent RFC. As such the npm build is during development,, while composer remains the installable option when published.

onyijne commented 2 years ago

@onyijne first major roadblock when testing it in a build is that the docker-compose -f docker-compose.dev.yml up —build produces the following error: ERROR: Named volume "composer-fix.sh:/var/www/html/composer-fix.sh:rw" is used in service "wp" but no declaration was found in the volumes section.

I would strongly urge you to avoid utilzing a non-standard docker-compose.yml filename or setup. For reference it would be better to mirror the setup present in other WordPress plugins, such as the Creative Commons WordPress Plugin

That means, likely putting the docker-compose.yml file in a /dev directory along with any other associated scripts related to the docker build/container process.

Hi @possumbilities I have attended to this, thanks.

possumbilities commented 2 years ago

@onyijne When testing via docker compose -f dev/docker-compose.yml up the following error occurs when opening the site in the browser:

Screen Shot 2022-11-04 at 1 31 06 PM
onyijne commented 2 years ago

@onyijne When testing via docker compose -f dev/docker-compose.yml up the following error occurs when opening the site in the browser:

Screen Shot 2022-11-04 at 1 31 06 PM

Hi @possumbilities, yes

After building for the first time you should login to "phpmyadmin", and create a new database named "wordpress" then grant "dbUsername" access to the database.

possumbilities commented 2 years ago

@onyijne That makes sense, but I would add that the db creation and setup should be a part of the Docker process, not something that should have to be manually performed.

onyijne commented 2 years ago

@onyijne That makes sense, but I would add that the db creation and setup should be a part of the Docker process, not something that should have to be manually performed.

Okay @possumbilities I will add a script to dev/docker-compose.yml to automate the db setup for development.

onyijne commented 2 years ago

Hi @possumbilities the db setup is now automated. Thanks