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

[5.0] Tours alias language #41161

Merged
merged 163 commits into from
Sep 3, 2023
Merged

Conversation

GeraintEdwards
Copy link
Contributor

@GeraintEdwards GeraintEdwards commented Jul 14, 2023

Pull Request for Issue # .

Summary of Changes

  1. Adds uid column to #__guidedtour table
  2. Existing Joomla tours are identified as joomla-articles etc. based on the language key for the tour title. Suggests that user adds an identifier like author/company/siteurl-tour-name - automatically creates as siteurl-tour-name when blank and checks if it is unique.
  3. Language files match this identifier naming convention - for example: guidedtours.joomla_articles.ini and the steps in guidedtours.joomla_articles_steps.ini or extension.extension_tour_name.ini, mod_extension.module_tour_name.ini
  4. Language files can be loaded from administrator/com_extension administrator/modules/mod_extension etc.
  5. Parses buttons with data attributes of data-id="tour id" OR data-gt-uid="tour-uid" to allow buttons to be created that are independent of the tour id in the database

Testing Instructions

Apply this PR
Go to System -> Manage -> Guided Tours

Test 1 - Checking identifier creation

Create a tour. Do not enter data in the identifier field.
Save the tour and check the identifier.
If you are on a local server, the identifier should look something like localhost-the-tour-name.

Test 2 - Checking identifier uniqueness

Try creating a tour with an identifier that exists for another tour.
The identifier should have a -X number attached to its name if it has been in use already.

Test 3 - Duplicating a tour.

In the Tours view, select a tour and select 'duplicate' from the actions.
The tour language keys and step language keys should not be translated until a proper language file matches the identifier. If the tour identifier is localhost-articles then the language files must be guidedtours.localhost_articles.ini and guidedtours.localhost_articles_steps.ini (language files are located in administrator/language).
Note that in tours view, the language keys may be translated because identical to languages loaded from another tour.

Test 4 - Launching a tour from any location

Create a custom module in the cpanel dashboard and add this HTML to it
<button class="button-start-guidedtour btn btn-primary" type="button" data-gt-uid="joomla-articles"> How to create articles? </button> <button class="btn btn-secondary button-start-guidedtour" type="button" data-gt-uid="joomla-contacts">How to create contacts?</button>

Then view the tour by clicking the link in the module (which uses the identifier, not the id of the tour).

Test 5 - Making sure language files are properly used

Change the translation in the files

  • administrator/language/[language used in the console]/guidedtours.joomla_articles.ini
  • administrator/language/[language used in the console]/guidedtours.joomla_articles_steps.ini
    to see that these are indeed the language files that are being used.
    Make sure the site is multilingual.

Actual result BEFORE applying this Pull Request

No tour alias, no way to run a tour other than using the tour module that lists all tours.
Language strings are loaded in the dashboard for all tours, on every page where the tour module is present.

Expected result AFTER applying this Pull Request

Tours can be triggered in other places than from the tour module.
Only languages keys that are needed are loaded.

Warning:
Third-party multilingual tours will lose their translations through this PR (the language keys are moved out of extension's language files and new language files need to follow the new naming conventions). Plan is to alert third-party developers of the change once this PR is merged so they can update their tour's language files accordingly.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org: New or Edit a Tour - this needs updating to cover language file naming and locations

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Geraint2 and others added 30 commits June 16, 2023 11:47
Add required option for text and radio/checkbox target types to allow us to force the user to interact with the target field even if its not required in the DOM
Reduce duplicated code for enabling/disabling navigation buttons - more can be done!
When target element is specified in a step but it doesn't exist in the DOM we need to end the tour as we have probably navigated to another page
Add missing params field into postgres sql file
Add missing params field into postgres sql file
Add missing SQL update scripts
Add missing SQL update scripts
Change lanbguage file ordering for label
Make empty fieldsets and tabs disappear/appear based on showon behaviour of contained fields
# Conflicts:
#	administrator/language/en-GB/com_guidedtours.ini
config option to decide if we should focus on target element when the step is visible
allow custom focus target
Fire custom events guided-tour-show-step,  guided-tour-before-show-step on focus or main target element
Allow setting pre step display and on step display mouse/pointer events to simulate user performing actions prior to undertaking the step - useful for ensuring elements such as sub menu items are visible
New unique tour alias/identifier
Start of work on context specific tour triggers
Parameters tab when editing a step only shows if its relevant
Updates extensions column
Removed spaces
Removed tabs
obuisard and others added 2 commits September 2, 2023 11:03
Co-authored-by: Quy <quy@nomonkeybiz.com>
Removed spaces
obuisard and others added 10 commits September 2, 2023 11:06
Co-authored-by: Quy <quy@nomonkeybiz.com>
Fix deprecated urldecode(): Passing null to parameter #1, preventing tours to start
$this->lang changed into $this->language
Removed return value from setGuidedToursUid()
changed $tourItem->lang into $tourItem->language in setGuidedToursUid
Removed :bool from setGuidedToursUid
@obuisard
Copy link
Contributor

obuisard commented Sep 3, 2023

I have tested this item ✅ successfully on 0cd24e3


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41161.

@khu5h1
Copy link
Contributor

khu5h1 commented Sep 3, 2023

I have tested this item ✅ successfully on 0cd24e3


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/41161.

@sdwjoomla sdwjoomla merged commit bbea1c1 into joomla:5.0-dev Sep 3, 2023
4 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Sep 3, 2023
@sdwjoomla
Copy link
Contributor

sdwjoomla commented Sep 3, 2023

Thanks @GeraintEdwards. Thank you @Quy , @brianteeman ., @HLeithner , @richard67 , and @obuisard for feedback, consultation and input into improving this PR. Thanks to everyone else who help to test and document.

Copy link
Contributor

Choose a reason for hiding this comment

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

@HLeithner Core file?

Copy link
Member

Choose a reason for hiding this comment

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

@GeraintEdwards haha nice way to get yoursites into core but I think that was not expected ;-) please create a pr to remove this file again.

Copy link
Contributor

Choose a reason for hiding this comment

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

OMG my mistake for forgetting about the removal of the file, which had been spotted...

Copy link
Contributor

Choose a reason for hiding this comment

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

#41588 for fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Change This is for Translators PR-5.0-dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet