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/add create tickets template gui #375

Closed
wants to merge 11 commits into from

Conversation

bkembreeBPS
Copy link
Contributor

There is one issue that definitely needs addressing but I wanted to discuss the best solution. When editing a template via Admin/Queues the Basics, Content, and Advanced menu options are not visible enough to the user. They need to know they are under the page menu Templates option.

The other question I had was whether we should split the Template.html into separate pages for Basics, Content, and Advanced instead of using the ContentTab/AdvancedTab url params.

Added a new function to process updates to a template object so that the
different template pages for global vs queue templates can share the
same code.
If loading a global template for modification add Basics, Content and
Advanced menu options to the page menu.
If loading a queue template for modification add Basics, Content, and
Advanced menu options to the Queue Templates menu.
Add a new element for modify a create tickets template.
Add logic to display different fields based on what view we are loading.
To ensure that the new Basics, Content, and Advanced menu options appear
the page needs to reload after creating a new template.
Copy link
Member

@cbrandtbuffalo cbrandtbuffalo left a comment

Choose a reason for hiding this comment

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

A few other notes from testing:

  • Change the tab type for sections to "pill" to be consistent with other places like System Configuration.

  • Add a titlebox section to the top where we can put some documentation. You can call the section "Create Ticket Templates". Take a shot at adding some basic docs. We can refine later.

  • It seems like Section Name is required. We should indicate that, show an error if it is not provided, and retain any form values so the user doesn't lose their work if they forget.

  • If you create a section, then click on Basics or Advanced, then click back, the Section Name field is not shown. This makes sense since it's already set and maybe we're not allowing it to be changed? But if you click on "Add New Section" tab, then back, Section Name is displayed, but it's blank. Maybe rather than hiding for existing sections, we populate it with the current value and allow it to be changed?

  • Maybe related, I was able to get in a state after creating a section that I couldn't see the Custom Fields inputs, so I couldn't add a custom field.

lib/RT/Interface/Web.pm Show resolved Hide resolved
lib/RT/Interface/Web.pm Show resolved Hide resolved
lib/RT/Interface/Web.pm Show resolved Hide resolved
lib/RT/Interface/Web.pm Show resolved Hide resolved
lib/RT/Interface/Web.pm Show resolved Hide resolved
share/html/Admin/Elements/ModifyTemplate Show resolved Hide resolved
share/html/Admin/Global/Template.html Show resolved Hide resolved
@@ -93,6 +93,16 @@

if ( $TemplateObj->Id() ) {
push @results, ProcessTemplateUpdate( TemplateObj => $TemplateObj, ARGSRef => \%ARGS );
Copy link
Member

Choose a reason for hiding this comment

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

There are a few areas where we're doing the same thing in global and queue level. Is it possible to factor some changes into a single mason template and avoid the duplication? If it's too much of a refactor, we don't need to do it now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While working on splitting Template.html into Basics.html, Content.html, and Advanced.html I got it working for page Global and Queue level templates. Could probably refactor some more to reduce duplicated code but I think it is better than it was.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactored it a bit more so the Basics, Content, and Advanced pages all use the same underlying element to reduce code more.

@cbrandtbuffalo
Copy link
Member

The other question I had was whether we should split the Template.html into separate pages for Basics, Content, and Advanced instead of using the ContentTab/AdvancedTab url params.

Yes, I think separate files for each page follows the same pattern for other objects in RT.

@bkembreeBPS
Copy link
Contributor Author

A few other notes from testing:

* Change the tab type for sections to "pill" to be consistent with other places like System Configuration.

Done.

* Add a titlebox section to the top where we can put some documentation. You can call the section "Create Ticket Templates". Take a shot at adding some basic docs. We can refine later.

Done.

* It seems like Section Name is required. We should indicate that, show an error if it is not provided, and retain any form values so the user doesn't lose their work if they forget.

* If you create a section, then click on Basics or Advanced, then click back, the Section Name field is not shown. This makes sense since it's already set and maybe we're not allowing it to be changed? But if you click on "Add New Section" tab, then back, Section Name is displayed, but it's blank. Maybe rather than hiding for existing sections, we populate it with the current value and allow it to be changed?

I made several changes for these issues:

  • The Section Name for add a new section can be left blank and the ProcessTemplateUpdate will auto assign a new unique section name, indicating so in the displayed message. This saves all work and they will just need to change the section name (but could leave it as is and it will work).
  • Show section name for existing sections and allow it to be changed. Add some validation and indicators that the section name for existing sections is required and do not allow the form to be submitted if empty.
* Maybe related, I was able to get in a state after creating a section that I couldn't see the Custom Fields inputs, so I couldn't add a custom field.

I could not replicate this. Thinking it is not an issue with the above changes.

@bestpractical-mirror bestpractical-mirror deleted the 5.0/add-create-tickets-template-gui branch December 20, 2023 23:43
@bkembreeBPS
Copy link
Contributor Author

The other question I had was whether we should split the Template.html into separate pages for Basics, Content, and Advanced instead of using the ContentTab/AdvancedTab url params.

Yes, I think separate files for each page follows the same pattern for other objects in RT.

Done.

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.

3 participants