Skip to content

[6.0] Add community info module for admin dashboard #43753

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

Open
wants to merge 78 commits into
base: 6.0-dev
Choose a base branch
from

Conversation

Elfangor93
Copy link
Contributor

@Elfangor93 Elfangor93 commented Jul 8, 2024

This is a redo of PR #43748 since new features have to go into 5.2-dev.

The idea for this PR came from a workshop in which we analysed a survey in the joomla community of the D-A-CH region. The survey and the workshop was organized by Oliver Schuldt and @SniperSister. Thank you very much for your effort.

What is this module going to improve?

One of the points that was mentioned very frequently in the survey is that there is no good entry point for new, interested volunteers. It is difficult and confusing for newcomers to get the necessary information on how to participate in the Joomla! community. This is what we want to solve with the help of this backend dashboard module.
It provides the most important information and links to join and participate in the Joomla community at the most visible place; The dashboard/cpanel of the backend.
The links and information are retrieved from an API endpoint at joomla.org based on the user's current location. This ensures that the user sees the information that is most relevant to him and minimises the barrier to make it as easy as possible to get started in the community.

The module provides the following information:

  • Contact and links to your local Joomla community.
  • News about Joomla! and its community.
  • Upcoming events in your region.
  • Motivation to volunteer.

The current location of the user gets evaluated in the following order. If the location couldnt be found the next approach is used:

  1. Manually selected location
  2. Automatically detect the current position by the browser
  3. Fallback location: London (UK, lat: 51.5000, long: 0.0000)

Info about API endpoint

Main entry point
In order to fetch local community information, the module calls an endpoint (API). The endpoint used by the module is set in the module settings and gets set during installation. In this PR for testing reasons it is set to be https://test.joomla.spuur.ch/joomla-community-api/links.php.
This is just a proof-of-concept endpoint set up to test this PR. It will be exchanged when the PR is in a state ready to be merged. The final endpoint will be hosted at https://www.joomla.org/. It is thought that we could expand the already existing https://community.joomla.org/user-groups.html directory. Such that every Joomla user group or association can enter the information and links there which they want show to the users close to them in this directory. The API will then fetch the data from the directory and provide it as json response to the module.

News feed
The news feed is fetched from a source which provides an XML/RSS feed. The source is declared in the response of the main entry point API. This could e.g be a website with a category blog of Joomla articles from which the view format RSS is requested.
(e.g. https://community.joomla.org/blogs?format=feed&type=rss)

Events feed
The upcoming events are fetched from a middle ware API endpoint hosted at the same location as the main entry point API for the links. It will parse a calendar from https://community.joomla.org/events.html based on the current location.
(e.g. https://test.joomla.spuur.ch/joomla-community-api/events.php)

The module can also be found in this repository. Here is an installable version of the module if you dont want to build Joomla from source to test this PR:
https://github.com/Elfangor93/mod_community_info

Summary of Changes

  • Added the module "mod_community_info" to the administrator dashboard on the first possible position on the module position "cpanel".

Testing Instructions

  1. Install Joomla from source (or use the installable module)
  2. Activate debug in the Joomla global configuration.
  3. Visit the administrator dashboard.
  4. Allow your browser to get your current location or click on "Choose location" to manually choose your location.
  5. Look at the browser console to see the activities of the module when evaluating your location and fetch content.
  6. Exchange endpoint in the module parameters to simulate different locations

Actual result BEFORE applying this Pull Request

No community module in the administrator dashboard.

Expected result AFTER applying this Pull Request

New module called "Joomla! Community and News" (mod_community_info) community module in the administrator dashboard.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.2-dev labels Jul 8, 2024
@brianteeman
Copy link
Contributor

the list of countries is a non-standard list that has been modified from a questionable source. We should not be reinventing the wheel for a list of countries that we will need to maintain ourselves. There are ISO standards for this which are actively maintained and do not contain the modifications you have made to satisfy one single country. This is wrong.

@Elfangor93
Copy link
Contributor Author

There are ISO standards for this which are actively maintained and do not contain the modifications you have made to satisfy one single country.

Can you point me to the ISO standard you are looking for? Then I can update the list accordingly.
I see that the current langages supported by Joomla are the following: https://update.joomla.org/language/translationlist_5.xml

So I guess it would make sense to create a list with countires based on the ISO standard and map to each a language tag available at https://update.joomla.org/language/translationlist_5.xml, right?

@brianteeman
Copy link
Contributor

There are ISO standards for this which are actively maintained and do not contain the modifications you have made to satisfy one single country.

Can you point me to the ISO standard you are looking for? Then I can update the list accordingly. I see that the current langages supported by Joomla are the following: https://update.joomla.org/language/translationlist_5.xml

So I guess it would make sense to create a list with countires based on the ISO standard and map to each a language tag available at https://update.joomla.org/language/translationlist_5.xml, right?

No. You should not be creating your own list. That is a maintenance nightmare.

@dgrammatiko

This comment was marked as outdated.

@brianteeman
Copy link
Contributor

Please change this to draft until it actually works. That way testers like myself wont waste time on this until you think it is ready.

@Elfangor93

This comment was marked as resolved.

@dgrammatiko
Copy link
Contributor

@dgrammatiko How do I make the no-unused-vars disappear?

I'm guessing those functions/variables are not used inside the script but rather in the inline script thus the tools assume not used anywhere? Move all the JS code in the file that would allow the tools to be more accurate on the code sniffing

@Elfangor93
Copy link
Contributor Author

I guess now its ready for testing again...

@brianteeman
Copy link
Contributor

I guess now its ready for testing again...

previous reported xml errors still present

image

No link to set the location
No indication of the location

image

@brianteeman
Copy link
Contributor

previous reported issues still present but now with additional issue

image

@Elfangor93
Copy link
Contributor Author

Elfangor93 commented Jul 11, 2024

previous reported issues still present but now with additional issue

Seems like there is a problem in the installation script. Can you try to add https://test.joomla.spuur.ch/joomla-community-api/links.php to the module configurations by hand?

grafik

@HLeithner
Copy link
Member

This pull request has been automatically rebased to 5.3-dev.

@HLeithner HLeithner changed the title [5.2] Add community info module for admin dashboard [5.3] Add community info module for admin dashboard Sep 2, 2024
@Elfangor93
Copy link
Contributor Author

The thing is that in Joomla we don't do any of that. The JS code is expected to be production grade (tested, debugged, etc) and personally I don't like the idea that there are code dumps in the client side.

The module if fetching data asynchronous from openstreetmap to provide the manual location selection. If something fails during this fetch I would like to log something about the error.
External API: https://nominatim.openstreetmap.org/search.php

For all the rest I guess I can remove any reporting in the JS and add logging in the module helper instead.

@dgrammatiko
Copy link
Contributor

@Elfangor93 all I'm saying is that we don't do such things with production code in this project...

@Hackwar Hackwar removed the PR-5.2-dev label Sep 3, 2024
@Elfangor93
Copy link
Contributor Author

I've also had again a quick look on the base.sql files and have noticed that some lft and rgt values where not increased where they should have been increased.

@richard67 I hope, I catched now all of them and the insert statement is now correct. Thanks for helping me with this!


MOD_COMMUNITY_INFO="Joomla! Community and News"
MOD_COMMUNITY_INFO_FIELD_ENDPOINT_LABEL="Endpoint URL"
MOD_COMMUNITY_INFO_FIELD_ENDPOINT_DESC="Enter an URL providing you with an endpoint to fetch the different community info and links."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MOD_COMMUNITY_INFO_FIELD_ENDPOINT_DESC="Enter an URL providing you with an endpoint to fetch the different community info and links."
MOD_COMMUNITY_INFO_FIELD_ENDPOINT_DESC="Enter a URL providing you with an endpoint to fetch the different community info and links."

@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this entire file needs reformatting. xml files are indented with tabs not spaces etc and check that everything is indented correctly

@brianteeman
Copy link
Contributor

There are still a lot of code issues with this PR but I think its really unfair to keep asking for changes if this has no chance of being accepted.

@HLeithner HLeithner changed the base branch from 5.3-dev to 6.0-dev March 4, 2025 17:20
@HLeithner
Copy link
Member

This pull request has been automatically rebased to 6.0-dev.

@HLeithner HLeithner changed the title [5.3] Add community info module for admin dashboard [6.0] Add community info module for admin dashboard Mar 4, 2025
@rdeutz rdeutz removed the PR-5.3-dev label Mar 5, 2025
@brianteeman
Copy link
Contributor

There are still a lot of code issues with this PR but I think its really unfair to keep asking for changes if this has no chance of being accepted.

Maintainers please make a decision

@SniperSister
Copy link
Contributor

Update regarding the required API on community.joomla.org: I've been working on it in the last couple of weeks, 80% completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Language Change This is for Translators NPM Resource Changed This Pull Request can't be tested by Patchtester PR-6.0-dev Unit/System Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.