Is it possible to reload the deskStructure.js within Sanity CMS via code instead of refreshing the entire page? - sanity

Within the deskStructure.js of the Sanity CMS Studio I'd like to power some of the filtering using a variable that will be updated by a custom plugin. Is there a nice way of reloading the deskStructure without having to do a window.location.reload()? As that isn't particularly nice approach as it takes a while to reload the page.

Related

Should I place a script partial on EVERY page, or in the Layout.cshtml partial file?

My organization is currently working on a new ASP.Net Core web app. We have a couple of common Javascript functions that are used on all pages. At first we put the scripts in a partial file and started adding the following to the Scripts section on every page.
#{await Html.RenderPartialAsync("_CompanyScriptsPartial"); }
At this point we have only added it to a small handful of pages, but have around or so left to add it to.
Is it better to add that on every single page, or can I just put the same code in the layout.cshtml (it works when I do it, I just don't know if I should do it)? What is the 'best practice' method for this scenario?
If the scripts are used on all of your pages, or even if they are used on most of the application pages, then it is better to add the script link to the layout.
This way you avoid duplicating code by not adding RenderPartialAsync to every page.
Best practice is not copy and paste code and to have a single location for common code.

Forcing a refresh on vuejs router from an outer app

This is as messy as it sounds...as it doesnt seem to be answered by other questions related to forcing a refresh in a vue app (but happy to be proven wrong).
I have a simple page utilizing some jquery which is loading a 3rd party vuejs app. The 3rd party app is loading correctly and working well.
The problem is if a link is clicked in the 3rd party app which is working through the vue-router. Although I see the url changing as per normal vue-router functionality but the view/template itself is not updating/changing.
If at that point I call a location.reload() then the page will reload and the correct template will display. However this is very slow and am trying to find out why the view is not refreshing under these conditions.
It obviously has something to do with the fact that I am generating the vueapp via external scripts but cant pin down what the issue is.
Is there some way I can force the view to refresh without reloading the whole page?
Thanks
Turns out that there was something else going on here.
After the external vue app was loaded, some innerhtml content was being modified by my external script. Nothing directly related to the app but this seemingly broke the underlying app.
Stopping to do the replacements has the underlying app working as expected.

how to add autocomplete function to a column in oracle apex tabular form report

i want to add an autocomplete function to work in one of my column suppose name.It is easy to do using items.but how can i do it in the report.
Since a report doesn't contain Apex items, you can't do this with the built in features. Ignoring any possible plugins that may already be available, you can do this with jQuery UI, specifically the Autocomplete widget. Apex already includes some of the jQuery UI suite, but you may need to download the Autocomplete widget from the jQuery website.
This will need some custom work on your end. This really isn't that hard if you know how to use jQuery.
Download the jQuery UI Autocomplete widget and include it on your page. You can put just the .js file for that in your Application Shared Items. I have the whole jQuery UI library in a separate place on the webserver because I use different parts for different projects.
Source in that widget in the page properties.
You'll need to create text items with apex_item.text in your report.
You'll need an On Page Load dynamic action to attach the Autocomplete widget to your text items.
For the autocomplete source, if it's short, you can just use a Javascript variable that you put on the Apex page. If it's longer or you need to find the list at run time, you can use a function that calls apex.server.process.
If your report has Partial Page Refresh turned on, make sure the DA in step 4 has Dynamic scope, not Static.

How to track when a user views a JIRA issue

In my plugin I need to track when a user views an issue using UI. Ideally I'd like to know if it was opened directly, or was viewed in Issue Navigator Detail View. I need to track who and when viewed an issue.
What's the best way to do this?
Cheers,
Oles
The most straightforward way would be to use a Servlet Filter plugin module and scan the requested URL for those corresponding to issue views. You can generally distinguish between viewing the issue directly and a view from within the Issue Navigator by examining the query parameters.
Alternatively, you could also build a Web Panel plugin module that renders no significant UI, but which would always be invoked when an issue is viewed. You'd probably want to position the web-panel on the right side of the issue view with atl.jira.view.issue.right.context.
In either scenario above, you can fetch the current user from an injected JiraAuthenticationContext.

How do I switch the theme used on a Sitefinity based website?

We have a Sitefinity 3.2 site in production and the users want a whole new look and feel. Upgrading is not an option.
I have created new templates for them but they will need to go into the site and create all new pages using the new templates. This is a problem because they want the current site to remain unchanged until they are done - then they want to instantly switch over.
One problem that I see already is that pages will not show up in the menu control until they are published.
I am very new to Sitefinity. Is there a standard practice for doing this?
You don't need to re-create all of the pages to change the look and feel; simply change the template assigned.
This video shows how to work with themes and templates.
I'd think that changing the theme of all the templates late at night should be "instantly" enough for most people. :)