how to translate api-platform fieldGuesser values - react-admin

I have a <FieldGuesser /> from api-platform/admin and want to translate it's values, something like <SelectInput /> has an option called translateChoice. Is there something similar?

Related

Conditional lazy-loading with Nuxt.js

Nuxt.js comes with support for component lazy-loading, by prefixing the component name with lazy-. But is there anyway to conditionally lazy-load, short of duplicating the code with v-if/else?
E.g. something like this?
<list :lazy="shouldBeLazyLoaded">
...some complex markup
</list>
Currently I do it like this:
<lazy-list v-if="shouldBeLazyLoaded">
...some complex markup
</lazy-list>
<list v-else>
...some complex markup
<list>
Maybe your could use Vue's dynamic components for this:
<component v-bind:is="shouldBeLazyLoaded ? 'lazy-list' : 'list'">
...some complex markup
</component>

Intellij IDEA - DB Navigator - reveal password

I use "DB navigator" plugin(https://plugins.jetbrains.com/plugin/1800-database-navigator/) for my Intellij IDEA Community version quite some time and am very satisfied.
I want to know the password of my DB connection saved in the plugin. They are saved, they are there, but I cannot share it with my teammates.
Even all the IDEA passwords are set to be stored in the system keyring, I don't find them in seahorse, i.e., "Passwords and Keyrings" application in my Ubuntu.
Where are they?
At last, I found it in
<project_root>/.idea/dbnavigator.xml
search your connection name, and you will see sth like this:
<connection id="e208f307-8c08-45d5-93fd-958c1d68d049" active="true">
<database>
<name value="UAT" />
<description value="" />
<database-type value="ORACLE" />
<config-type value="BASIC" />
<database-version value="11.2" />
<driver-source value="BUILTIN" />
<driver-library value="" />
<driver value="" />
<url-type value="SERVICE" />
<host value="some-host" />
<port value="1523" />
<database value="APP_DB" />
<type value="USER_PASSWORD" />
<user value="admin" />
<deprecated-pwd value="<base64-encoded-password>" />
</database>
...
</connection>
So, I tried to base64 decoded them... and it works...
Please, if the author sees this, please don't encrypt it in the future versions; I need them to be in my local so that I don't have to ask my teammates again; too shy am I. Please take into consideration that I created the tag db-navigator for the first time while asking this question, so that ppl around the world could gather together with love of this plugin.
And, any coder reading this: please ignore this file in Git, as it contains sensitive data.

ZK - concatenate a variable with a constant string in a map key in ZUL EL

A have a custom translator object implementing java.util.Map in the page scope un I use it like
<checkbox id="cbCopy" label='${translator.copy}' />
It works fine also for hierarchical keys using the more complex map syntax of EL:
<checkbox id="cbCopy" label='${translator['hierarchical.key.copy']}' />
It also works when I have the key in a variable:
<zscript>
desktopScope.put("someKey",sessionScope.get("customerCompany")+".copy");
</zscript>
<checkbox id="cbCopy" label='${translator[someKey]}' />
My problem is to compose the hierarchical key in the EL expression concetanating a variable and a constant string:
<zscript>
desktopScope.put("customerCompany",sessionScope.get("customerCompany")+".");
</zscript>
<checkbox id="cbCopy" label='${translator[customerCompany+'copy']}' /> <!-- DOES NOT WORK!!! -->
Ist it somehow possible?
The reason is that several (but not all) ZUL GUI component on the page needs this kind of composite i18n keys.
Since ZK 8, you can concatenate a string with +=:
${translator[customerCompany+='copy']}
Ref: https://github.com/zkoss/zkbooks/blob/master/developersreference/developersreference/src/main/webapp/uiComposing/elExpression.zul
In previous version, you can use tag library, cat.

MS SQL, Grouping, For XML, and more... need some help with this query

I need your help. Sadly I don't know SQL as well as I do C# (or most other languages) and I've hit my limits with this query. This post may be a bit verbose, so I apologize for that in advance, but I want to make sure I include all the necessary info.
My goal is to create a query that selects data from SQL, groups it by a substring value of one of the columns, and outputs in XML. I'm pretty close, but I've hit a wall.
Here's an example of what it should look like:
<EXAMPLE_DATA>
<headEnd nam="AAAA">
<hardware fromDevice="ExampleDeviceAAAA" />
<hardware fromDevice="ExampleDeviceAAAA" />
<hardware fromDevice="ExampleDeviceAAAA" />
</headEnd>
<headEnd nam="BBBB">
<hardware fromDevice="ExampleDeviceBBBB" />
<hardware fromDevice="ExampleDeviceBBBB" />
<hardware fromDevice="ExampleDeviceBBBB" />
</EXAMPLE_DATA>
As you can see, the last four characters of the fromDevice are what define my headEnd groupings... here's what I'm able to return right now:
<EXAMPLE_DATA>
<headEnd nam="[headendId]">
<hardware fromDevice="ExampleDeviceAAAA" headendId="AAAA" />
<hardware fromDevice="ExampleDeviceAAAA" headendId="AAAA" />
<hardware fromDevice="ExampleDeviceAAAA" headendId="AAAA" />
<hardware fromDevice="ExampleDeviceBBBB" headendId="BBBB" />
<hardware fromDevice="ExampleDeviceBBBB" headendId="BBBB" />
<hardware fromDevice="ExampleDeviceBBBB" headendId="BBBB" />
</EXAMPLE_DATA>
And finally, here's the code I have that returns the XML above:
SELECT
'[headendID]' as "#nam"
, (
SELECT hardware.Name as "#fromDevice", RIGHT(hardware.Name, 4) as "#headendId"
FROM tblHardware AS hardware
GROUP BY RIGHT(hardware.Name, 4), hardware.Name
for xml path ('hardware') , type
)
for xml path ('headEnd'), root ('EXAMPLE_DATA')
I've removed a lot of non-essential columns to try and make this post a bit easier to read.
So, looking at what I need the XML to look like, is it even possible? I guess anything's possible... but in this case I'm completely stumped.
Thanks for reading!
EDIT: To make sure my question is clear, what I need is for the SQL code to output XML data grouped by the substring query of hardware.Name. I'm trying to make the output look like the first XML block above.
Here you go:
SELECT
RIGHT(categ.Name, 4) as "#nam" ,
(
SELECT hardware.Name as "#fromDevice"
FROM tblHardware AS hardware
WHERE RIGHT(categ.Name, 4) = RIGHT(hardware.Name, 4)
for xml path ('hardware') , type
)
FROM tblHardware as categ
GROUP BY RIGHT(categ.Name, 4)
for xml path ('headEnd'), root ('EXAMPLE_DATA')

XUL: Printing value from SQL query without using value attribute

I want to print the results of an SQL query in XUL with word-wrapping using the description tag. I have the following code:
<grid>
<columns>
<column flex="2" />
<column flex="1" />
</columns>
<rows datasources="chrome://glossary/content/db/development.sqlite3" ref="?" querytype="storage" >
<template>
<query>select distinct * from Terms</query>
<action>
<row uri="?">
<description value="?name" />
<description value="?desc" />
</row>
</action>
</template>
</rows>
This works for printing the data, but since I'm using the value attribute of description, there's no word-wrapping. I don't understand entirely what I'm doing with the value attribute, but I don't seem to be able to get the values of my SQL query in any other way. So, how could I get those values without the value tag?
Thanks.
So, if anyone's ever looking, I found this out on IRC:
You can use a textnode element to do this.
<description><textnode value="?name" /></description>
This will give you line-wrapping.