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

Assigned a class to each landing page #949

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Assigned a class to each landing page #949

merged 1 commit into from
Mar 5, 2024

Conversation

kordan
Copy link
Owner

@kordan kordan commented Feb 27, 2024

In the frame of this PR I also tried to provide a better name to managers. The rationale of this PR is to assign to each section of each area of surveypro a specific class. Once each section will use its specific class it will be simple to:

  • better debug the code;
  • make code improvements;
  • create unit tests.

As far as I know, this PR along with #932 and #931, accomplishes this goal.

What was in my mind (and I hope I reached this target) was to assign a specific class to each landing page of sPro. In other words...
sPro is divided into 6 areas and each area is divided into sections. The structure of sPro, is:

[Spro area] surveypro (managed in view.php)
- [section] cover
- [section] submissionslist
- [section] submissionform
- [section] searchsubmissions
[Spro area] layout (managed in layout.php)
- [section] itemslist
- [section] itemsetup
- [section] branchingvalidation
- [section] preview
[Spro area] reports (managed in reports.php)
- [report] attachement overview
- [report] frequency distribution
- [report] late users
- [report] responses per user
- [report] users per count of responses
[Spro area] tools (managed in tools.php)
- [section] export
- [section] import
[Spro area] user templates (managed in utemplates.php)
- [section] manage
- [section] save
- [section] import
- [section] apply
[Spro area] master templates (managed in mtemplates.php)
- [section] save
- [section] apply

Well, if I am not wrong, now each section uses a specific class. (reports are an exception)

Names of classes always start with the name of the area and ends with the name of the section. They are:

[Spro area] surveypro (managed in view.php)
- [section] cover -----------------------------------> view_cover
- [section] submissionslist -------------------------> view_submissionlist
- [section] submissionform --------------------------> view_submissionform
- [section] searchsubmissions -----------------------> view_submissionsearch
[Spro area] layout (managed in layout.php)
- [section] itemslist -------------------------------> layout_itemlist
- [section] itemsetup -------------------------------> layout_itemsetup
- [section] branchingvalidation ---------------------> layout_branchingvalidation
- [section] preview ---------------------------------> layout_preview
[Spro area] reports (managed in reports.php)
- [report] attachement overview ---------------------> report from its own specific plugin classes
- [report] frequency distribution -------------------> report from its own specific plugin classes
- [report] late users -------------------------------> report from its own specific plugin classes
- [report] responses per user -----------------------> report from its own specific plugin classes
- [report] users per count of responses -------------> report from its own specific plugin classes
[Spro area] tools (managed in tools.php)
- [section] export -----------------------------------> tools_export
- [section] import -----------------------------------> tools_import
[Spro area] user templates (managed in utemplates.php)
- [section] manage -----------------------------------> utemplate_manage
- [section] save -------------------------------------> utemplate_save
- [section] import -----------------------------------> utemplate_import
- [section] apply ------------------------------------> utemplate_apply
[Spro area] master templates (managed in mtemplates.php)
- [section] save -------------------------------------> mtemplate_save
- [section] apply ------------------------------------> mtemplate_apply

The corresponding manager (still, if I am not wrong) is named with the name of the section and finishes with 'man'. So, for instance: corverman, itemlistman, exportman, manageman and so forth.

@stronk7
Copy link
Collaborator

stronk7 commented Mar 4, 2024

Uh, ok. this is conflicting now...

@kordan
Copy link
Owner Author

kordan commented Mar 5, 2024

As usual I can not understand.

Once I issue:
git co master
git fetch origin --prune
git pull
git co all_classes
git rebase master

I supposed to get a message updating me about the conflict.
What I received, instead, was: Successfully rebased and updated refs/heads/all_classes.

With additional:
git co master
git co all_classes

I get:
Switched to branch 'all_classes'
Your branch and 'origin/all_classes' have diverged,
and have 5 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)

that, as usual, is incorrect because if I:
git pull
I get:
fatal: Not possible to fast-forward, aborting.

GRRRRRRRRRR

In the frame of this PR I also tried to provide a better name to managers.
The rationale of this PR is to assign to each section of each area of surveypro a specific class.
Once each section will use its specific class it will be simple to:
- better debug the code;
- make code improvements;
- create unit tests.

As far as I know, this PR along with #932 and #931, accomplishes this goal.

What was in my mind (and I hope I reached this target) was to assign a specific class to each landing page of sPro.
In other words...
sPro is divided into 6 areas and each area is divided into sections.
The structure of sPro, is:

[Spro area] surveypro (managed in view.php)
- [Area section] cover
- [Area section] submissionslist
- [Area section] submissionform
- [Area section] searchsubmissions
[Spro area] layout (managed in layout.php)
- [Area section] itemslist
- [Area section] itemsetup
- [Area section] branchingvalidation
- [Area section] preview
[Spro area] reports (managed in reports.php)
- [report] attachement overview
- [report] frequency distribution
- [report] late users
- [report] responses per user
- [report] users per count of responses
[Spro area] tools (managed in tools.php)
- [Area section] export
- [Area section] import
[Spro area] user templates (managed in utemplates.php)
- [Area section] manage
- [Area section] save
- [Area section] import
- [Area section] apply
[Spro area] master templates (managed in mtemplates.php)
- [Area section] save
- [Area section] apply

Well, if I am not wrong, now each section uses a specific class. (reports are an exception)

Names of classes always start with the name of the area and ends with the name of the section.
They are:

[Spro area] surveypro (managed in view.php)
- [Area section] cover -----------------------------------> view_cover
- [Area section] submissionslist -------------------------> view_submissionlist
- [Area section] submissionform --------------------------> view_submissionform
- [Area section] searchsubmissions -----------------------> view_submissionsearch
[Spro area] layout (managed in layout.php)
- [Area section] itemslist -------------------------------> layout_itemlist
- [Area section] itemsetup -------------------------------> layout_itemsetup
- [Area section] branchingvalidation ---------------------> layout_branchingvalidation
- [Area section] preview ---------------------------------> layout_preview
[Spro area] reports (managed in reports.php)
- [report] attachement overview --------------------------> report from its own specific plugin classes
- [report] frequency distribution ------------------------> report from its own specific plugin classes
- [report] late users ------------------------------------> report from its own specific plugin classes
- [report] responses per user ----------------------------> report from its own specific plugin classes
- [report] users per count of responses ------------------> report from its own specific plugin classes
[Spro area] tools (managed in tools.php)
- [Area section] export -----------------------------------> tools_export
- [Area section] import -----------------------------------> tools_import
[Spro area] user templates (managed in utemplates.php)
- [Area section] manage -----------------------------------> utemplate_manage
- [Area section] save -------------------------------------> utemplate_save
- [Area section] import -----------------------------------> utemplate_import
- [Area section] apply ------------------------------------> utemplate_apply
[Spro area] master templates (managed in mtemplates.php)
- [Area section] save -------------------------------------> mtemplate_save
- [Area section] apply ------------------------------------> mtemplate_apply

The corresponding manager (still, if I am not wrong) is named with the name of the section and finishes with 'man'.
So, for instance: corverman, itemlistman, exportman, manageman and so forth.
@stronk7
Copy link
Collaborator

stronk7 commented Mar 5, 2024

As usual I can not understand.

Once I issue: git co master git fetch origin --prune git pull git co all_classes git rebase master

I supposed to get a message updating me about the conflict. What I received, instead, was: Successfully rebased and updated refs/heads/all_classes.

With additional: git co master git co all_classes

I get: Switched to branch 'all_classes' Your branch and 'origin/all_classes' have diverged, and have 5 and 1 different commits each, respectively. (use "git pull" to merge the remote branch into yours)

that, as usual, is incorrect because if I: git pull I get: fatal: Not possible to fast-forward, aborting.

GRRRRRRRRRR

That's correct, it's telling you that the contents of origin/all_classes (in GitHub) are different from what you've CORRECTLY rebased locally in you local/all_classes branch.

So, all you've to do is to send your local/all_classes branch to GitHub, aka:

git push origin all_classes --force

That's all, you don't need to "pull" anything.

Ciao :-)

@stronk7
Copy link
Collaborator

stronk7 commented Mar 5, 2024

PS: I've done the push to GitHub (origin) already, you don't need to do it. Instead, ensure that your local/all_classes is the same I've sent to origin by doing:

git fetch --all --prune
git co all_classes
git reset --hard origin/all_classes

And done, now both your local and github all_classes branches will have the very same commits.

Ciao :-)

@kordan
Copy link
Owner Author

kordan commented Mar 5, 2024

How can I be sure that by push --force I am not deleting some important change I did on github?
My copy is FOR SURE different from the one on github but I have no evidence of the difference.
I even know github has 5 commit more than my copy. So my question is: am I going to make a mess?
This is the usual step freezing me.

@stronk7
Copy link
Collaborator

stronk7 commented Mar 5, 2024

Well, you can check what's different. Just do:

git co all_classes
git diff origin/all_classes

to see which changes, since last time you pushed that branch, have happened.

Or, also, you can make:

git co all_classes
git show HEAD

to see how your top local commit in the branch is looking.

Once you're 100% sure that what is ready to be pushed is correct, just do it.

Ciao :-)

@stronk7
Copy link
Collaborator

stronk7 commented Mar 5, 2024

BTW, question, this one is for master only, correct?

@kordan
Copy link
Owner Author

kordan commented Mar 5, 2024

Yes, sure. Master only.

@stronk7 stronk7 merged commit f52bcd5 into master Mar 5, 2024
4 checks passed
@stronk7
Copy link
Collaborator

stronk7 commented Mar 5, 2024

Buff, this was huge! As far as everything is passing and I've not seen anything strange to report... merged!

@kordan kordan deleted the all_classes branch March 5, 2024 14:30
@kordan
Copy link
Owner Author

kordan commented Mar 5, 2024

SUPERRRRRR. PR list is empty and this, finally, open to unit test!
THANK YOU!

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.

2 participants