FAQs on Changing UI Text

General discussion of Mantis.

Moderators: Contributor, Developer

Post Reply
Starbuck
Posts: 138
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

FAQs on Changing UI Text

Post by Starbuck » Apr 12, 2018 12:19 pm

It seems to me that the top FAQs in this forum relate to:
1) How to change the text of a default fieldname
2) How to remove default fields.
3) How to add custom fields.

That's sort of basic CRUD for the UI.

I'd be happy to create a FAQ section to aggregate all notes on this general topic but I don't have access outside of the plugins area.

Now that I think about it, while unconventional, it seems like we could use a single plugin that helps to manage all of these common customizations.

@Atrol, thoughts?
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!

atrol
Site Admin
Posts: 7052
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: FAQs on Changing UI Text

Post by atrol » Apr 16, 2018 1:18 am

A plugin or enhancing the Mantis core for typical admin tasks would be fine.
Such kind of plugin could become part of the Mantis core after some time of user feedback and stabilization.
Please use Search before posting and read the Manual

Starbuck
Posts: 138
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: FAQs on Changing UI Text

Post by Starbuck » Apr 18, 2018 2:39 pm

OK, I'll look into this as a learning project. I might even document the process in a blog and then link to that from the wiki.

The v2 UI is significantly different from v1. I'm surprised the UI was implemented in such a rigid fashion. Is there any documentation, maybe a set of discussions/exchanges that I can reference about decisions made for v2, plans for the future, some paradigm of how the UI was implemented and expected to be used? ... Or is this all in someone's head? :)

Thanks.
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!

atrol
Site Admin
Posts: 7052
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: FAQs on Changing UI Text

Post by atrol » Apr 18, 2018 3:18 pm

Starbuck wrote:
Apr 18, 2018 2:39 pm
I'm surprised the UI was implemented in such a rigid fashion.
I don't understand what you mean with this, especially the word "rigid" is not clear to me, maybe because there is a similar word in German and I am translating it in a wrong way. Can you reword please?

Have a look at https://github.com/mantisbt/mantisbt/pull/272 to get an impression how the new UI got introduced.
Scroll down the page until you see "148 hidden Items", Click on "Load more ..."
Please use Search before posting and read the Manual

Starbuck
Posts: 138
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: FAQs on Changing UI Text

Post by Starbuck » Apr 20, 2018 2:18 pm

What I mean is starr gekoppelt. So much of the UI seems to be in the core that site-specific customizations seem to be difficult without changing core code. Just look at the cited PR 272 to see all of the hard-coded UI details. That's not unusual, but it leads to lots of forum questions about how to change the UI, with the answer being "you can't do that without changing the core ... and you shouldn't do that".

To create plugins that modify the UI, I think hooks will need to be added into the core (ref adding notes for places where hooks will be helpful). In other words, for common and reasonable UI changes, UI code can be abstracted out to handlers which can be replaced as easily language-specific text.

Right now, the UI is abstracted with layout calls for header and footer. I'm suggesting we should have more of those abstractions so that specific elements can be substituted - at least elements that are commonly requested in this forum. The kind of functionality I'm suggesting could be coded like this:

Code: Select all

//comment out hardcoded UI for THIS_LOCATION, then ...
ui_has_alternate(THIS_LOCATION) ? ui_default(THIS_LOCATION) : ui_alternate(THIS_LOCATION);
or like this:

Code: Select all

echo ui(THIS_LOCATION, "default text and <tag> ... </tag>");
// ui() function returns default when there is no alternate implementation for that specific block
The scope of details required to render the UI for THIS_LOCATION needs to be available to handlers.

If this is still too abstract or confusing, I guess I will need to implement a few specific examples, but again, one should just need to look at the code in PR 272. Here is one completely random code segment as an example.
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!

atrol
Site Admin
Posts: 7052
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: FAQs on Changing UI Text

Post by atrol » Apr 22, 2018 4:06 am

Starbuck wrote:
Apr 20, 2018 2:18 pm
questions about how to change the UI, with the answer being "you can't do that without changing the core
It's sometimes not elegant, but even without introducing new events and changing core, quite a lot of UI related changes can be done by using Javascript.
Starbuck wrote:
Apr 20, 2018 2:18 pm
If this is still too abstract or confusing,
I think I understand what you mean.
Isn't this the concept of Mantis custom functions? https://www.mantisbt.org/docs/master/en ... ustomfuncs
Please use Search before posting and read the Manual

Starbuck
Posts: 138
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: FAQs on Changing UI Text

Post by Starbuck » Apr 23, 2018 2:03 pm

Isn't this the concept of Mantis custom functions?
Yes it is but I'm suggesting more extensive usage of that concept with a focus on the UI. As per the example in my last note, custom functions are not currently used in the core for the UI - the UI is hard-coded in-line. That's certainly not a problem in itself, except that now we see enough requests for customization are affected by that coding practice to perhaps warrant a new initiative to add some extensibility.

While similar in nature, I'm thinking the custom_function_default_* feature isn't ideal for this. Personally I'd prefer to see a new file core/ui_api.php with ui_default_SomeNameHere, and ui_override_SomeNameHere in a new user-maintained ui_inc.php.

This could also be implemented with a template system, where users can override HTML templates rather than PHP code. On the plus side, that would eliminate the need for passing around state data. The core code just needs to read the template and then do substitutions with live data. On the minus side that would still make some more complex UI changes difficult, as templates like this would lack code required to implement more extensive UI changes. I'm only offering this as another way to solve the problem. I'm inclined toward the function override method.
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!

atrol
Site Admin
Posts: 7052
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: FAQs on Changing UI Text

Post by atrol » Apr 23, 2018 2:31 pm

Starbuck wrote:
Apr 23, 2018 2:03 pm
This could also be implemented with a template system, where users can override HTML templates rather than PHP code.
Want to talk about templates? Check https://www.mantisbt.org/bugs/view.php?id=4227 and related issues.
Please use Search before posting and read the Manual

Starbuck
Posts: 138
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: FAQs on Changing UI Text

Post by Starbuck » Apr 23, 2018 4:03 pm

Wow. I think a plugin might be too ambitious for this one. I'll come back to the idea that it might be best if we have a FAQ for updating the UI as it is. I'd hate to have to wait another 14 years for the discussion in that ticket to progress about changing the existing mechanisms. ;) Unfortunately I still don't have access to anything in the wiki outside of plugins. :(

I've added my own notes to that ticket.
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!

atrol
Site Admin
Posts: 7052
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: FAQs on Changing UI Text

Post by atrol » Apr 23, 2018 4:28 pm

Starbuck wrote:
Apr 23, 2018 4:03 pm
I'd hate to have to wait another 14 years for the discussion in that ticket to progress
There is no lack of users writing what should be done by other users.
Of course, there is a lack of users contributing to the project.
Starbuck wrote:
Apr 23, 2018 4:03 pm
Unfortunately I still don't have access to anything in the wiki outside of plugins. :(
I think it's better to add this information to the Git repository as the information will be versioned.
There will be less confusion if an answer to a FAQ changes depending on the Mantis version.
Furthermore it will be much easier to keep the FAQ up to date if an option is deprecated or changed (a simple grep at a single place is enough for it)
Please use Search before posting and read the Manual

Starbuck
Posts: 138
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: FAQs on Changing UI Text

Post by Starbuck » Apr 25, 2018 2:36 pm

On one hand, I agree with the approach of versioning this info into the installation.
On the other hand, wikis and other documentation repositories exist for many reasons, where using the software repository is not desirable.

The kind of content I'm talking about is more like a tutorial to respond to specific requests, with updates as details become available that seem to help. That's not the same format as a common FAQ which consists of basic Q & A, which is what I believe you're thinking.

As seen in Gitter, I'm getting frustrated with this process of trying to contribute information to this project.
I don't want to go through a PR request every time I want to help someone to understand this software.
I don't want to wait, perhaps months, for someone to approve a PR, or maybe reject it after I've already written something that I believe is helpful.
I have a business to run and I don't have the time for long exchanges about content. I just want to contribute and move on. If we can't get to that point then I'll have to move on without contributing. I hope we can resolve this soon. Thanks.
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!

atrol
Site Admin
Posts: 7052
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: FAQs on Changing UI Text

Post by atrol » Apr 25, 2018 3:33 pm

Starbuck wrote:
Apr 25, 2018 2:36 pm
I don't want to wait, perhaps months, for someone to approve a PR
Why so negative?
You did not try to send a PR until now.
I am not aware there is any open documentation related PR, or that it ever took a long time until such a PR was approved.
Starbuck wrote:
Apr 25, 2018 2:36 pm
or maybe reject it after I've already written something that I believe is helpful.
Again, why so negative?
I am not aware that someone rejected a PR with helpful changes.
So why should this happen if you submit a PR?
Please use Search before posting and read the Manual

Starbuck
Posts: 138
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

Re: FAQs on Changing UI Text

Post by Starbuck » May 09, 2018 2:06 pm

My intent wasn't to be negative.

I look at the MantisBT tracker and see that there are items that were opened years ago that are still "new", not even acknowledged. That's extremely discouraging.

I've been involved with other projects where contributions were welcome, but then PRs were rejected for having too much content or too much reformatting of existing material. That's not reorganization, as in re-numbering or shifting paragraphs. The complaint was that the source markdown was corrected to avoid breaks in the source lines, where the resulting output was fine but the source was difficult to change - and similar cosmetic objections to how the changes were made. The result was a lot of effort that was rejected, not for the content, but for the authors' tolerances for reading through changes. Again, this is very discouraging after so much time was spent on the effort. Rather than attempting to retrofit new code into existing, poorly formatted source docs, or trying to submit comprehensive information on topic in small pieces (which undoubtedly get rejected as being incomplete), I simply gave up on those projects.

But as discussed off-list, I'm happy to make small PRs over time with supporting tracker items, to avoid those issues above. I understand that you're saying documentation might get shorter-term reviews than code PRs or issue items without code. On-topic with this thread, I'll submit small contributions for FAQs in the hope that they will find a home in the wiki, and will continue to do so based on our success with that process.

Thanks for your thoughts.
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!

Post Reply