Add new option dynamically

Hi, this is a followup of the conversation in https://elixirforum.com/t/liveselect-dynamic-selection-input-component-for-liveview/49538/29?u=jaimeiniesta
The context is, I want to add a tagging editor, where the user can choose from previous tags but also add new ones, like here:
https://fullstackphoenix.com/tutorials/tagging-interface-with-phoenix-liveview-and-tailwind-tagging-part-2

As mentioned in the Elixir Forum thread:

It would be something like a “dynamic option mode”, where if you hit enter whatever you have typed will become a new selected option.

I have managed to make it more-or-less work, see video:
https://www.dropbox.com/s/a3ql5qs2zynggtj/live_select_2.mov?raw=1
But it won't work with the Enter key yet. What I did is:
<%= live_select f, :tag_search, mode: :tags, options: @live_select_options, placeholder: "Add tag" %>

and then listen to the ChangeMsg to replace the options:
  def handle_info(%LiveSelect.ChangeMsg{field: :tag_search, text: text}, socket) do
    new_live_select_options = [text | socket.assigns.user_tags]

    {:noreply, assign(socket, live_select_options: new_live_select_options)}
  end

Where user_tags is the original list of options from the existent user tags.
So for me what's left is being able to add new options with the "Enter" key, which should also clear the input field.

Bonus point: hitting the comma key , should also add the new option. Maybe even pasting in a comma-separated string. Maybe the tag separator should be configurable, other people may prefer to use spaces for example.
Example:
I want to add the new tags "improvement, changelog, pro". Just by typing that, the three tags "improvement", "changelog" and "pro" should appear as selected options in the tag list.

I implemented it. The option is called user_defined_options. If set to true, typing text and hitting enter will result in a new tag being added if there are no entries in the dropdown. You can try this out in the showcase app. To use it in your application, you'll have to point your hex dependency to the github repo. Let me know what you think
There's still at least one issue left to resolve: if the asynchronous update of the dropdown is slow, there could be a race condition where the user might hit enter before the content of the dropdown is rendered, resulting in a new tag being added when in reality an existing one should have been selected. I'll try to fix this tonight.

Ok I fixed the race condition. You can try the main branch and see if this new feature works for you :)

a new tag being added if there are no entries in the dropdown

I think this can lead to unexpected results, I would expect that as I type, the partial result appears live in the options, if I hit enter then it gets added.
Let's imagine there was a city called "Barce". I can't add it because it tries to autocomplete with "Barcelona":

Instead, I would expect to have both Barce and Barcelona options for me to choose.

I recorded a video explaining the above behavior, this is what I have working on now:
https://www.dropbox.com/s/xaj7qqj28p72395/live_select_3.mov?raw=1

I was expecting you to say that 😃
yes I also thought about it after implementing it and it makes more sense to always add the tag (unless it's already in the selection).
I updated, please give it another try

Cool, thanks!
I'm checking the demo, now it works when you press Enter, that's great.
I still think that it should be added to the list of available options, as in my video above. That would feel more complete to me, as it would behave like the other options that can be picked with the keyboard or mouse click.

I still think that it should be added to the list of available options, as in my video above. That would feel more complete to me, as it would behave like the other options that can be picked with the keyboard or mouse click.

Already selected options can't be selected again so they would be just unselectable options in the dropdown.
if you still want to see them, you can keep track of them by hooking on the form's change event:
def handle_event("change", %{"form" => %{"live_select_input" => selected_tags}}, socket) do
   # assuming you're keeping the list of options in the "options" assign
   # and the id of the live select input in the "live_select_id" assign
   socket = update(socket, :options, & Enum.uniq(&1 ++ selected_tags))

   send_update(LiveSelect.Component, id: socket.assigns.live_select_id, options: socket.assigns.options)

   {:noreply, socket}
end

def handle_info(%ChangeMsg{} = change_msg, socket) do

   update_options(change_msg, socket.assigns.options)

  {:noreply, socket}
end

You can now assign a custom id when you call live_select/3 so you can communicate with the component via send_update/3. This will become the main way to update the options, I'm planning to remove the old ChangeMsg, update_options update loop.
hope this helps

closed with 711ae3902b946be400846bd19e1d6ea652463850

@maxmarcon loving what you've started here! is there a known way to get the selected options to appear inside the search input, as shown in the gif above:
https://user-images.githubusercontent.com/2629/213181396-45cabcff-877f-422c-96d2-c47b009857b3.gif

Hi @rxndxm. This actually was the plan in the beginning but I wasn't able to find an easy way to implement it. If you can think of a way to implement it and making the input field expand vertically as it gets filled with tags, I'd be very interested. It would be a nice addition.

@maxmarcon Something like this:
If you add a width to the <multi-input> on that page, it works nicely.
The selected items are slotted just before the input element:
<multi-input>

JavaScript

Swift

Java

PHP

Objective-C

Ruby

Python

     <input list="languages">
     <datalist id="languages">
          <option value="C/C++"></option>
          <option value="SQL"></option>
     </datalist>
</multi-input>

I haven't looked at the live_select code yet, but would something like that work?

Looking more closely this one is a better example :)
https://codepen.io/emah/pen/MWyXqqM


Jesse: Watch ennessglobal.com

Jesse requests the watch of the watch_keyword ennessglobal\.com. See the MS search here and the Stack Exchange search in text, in URLs, and in code.

ennessglobal\.com has been seen in 1 true positive, 0 false positives, and 0 NAAs.

Approved by Jeff Schaller in Charcoal HQ


Set default value for GitIsDirty

Could you set a default value for the property GitIsDirty in GitInfo.targets?
All other properties have default values, e.g. master for the branch, 0.1.0 for default version.
My problem is: If I build my project in a non-git setting (e.g. an exported version), the generated ThisAssembly.g.cs says
public const bool IsDirty = $GitIsDirty$;
and the build fails.
(Fot the time being, I set <GitIsDirty>1</GitIsDirty> in my project file. I'm not sure if this is the preferred solution).

Good point.
On Fri, Jan 20, 2017, 3:01 AM Andreas Duering<EMAIL_ADDRESS>wrote:

Could you set a default value for the property GitIsDirty in
GitInfo.targets?
All other properties have default values, e.g. master for the branch,
0.1.0 for default version.
My problem is: If I build my project in a non-git setting (e.g. an
exported version), the generated ThisAssembly.g.cs says
public const bool IsDirty = $GitIsDirty$;
and the build fails.
(Fot the time being, I set 1 in my project file.
I'm not sure if this is the preferred solution).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/kzu/GitInfo/issues/23, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAKW64LVnv1hw4jp4ixgH-I6PAE13HwUks5rUGnYgaJpZM4LpCSs
.

--
--
/kzu from mobile

Issue is fixed by this.


Unable to Run a program

Hello, first of all thank you for this amazing job.
I installed and configured myrtille 1.5.0 on a Windows7 machine.
Everything works fine except of the "run a program" option.
Either by the form or passing the arguments (encoded) by URL I receive always the plain desktop as a result.
This is an example that gives me the desktop and not the notepad
http://<IP_ADDRESS>/myrtille/?__EVENTTARGET=&__EVENTARGUMENT=?server=<IP_ADDRESS>&domain=&user=user&password=password&program=notepad.exe&width=500&height=500&connect=Connect!
And putting "notepad.exe" as value in the input form gives me the same result.
Am I missing anything?

Hi, you're welcome :)
First at all, you should install the version 1.6.0, which brings some security fixes, performance improvements and a little refactoring of the auto-connect / start program from url feature.
For more safety if you distribute the link, you can also hash the password as described here.
Also, if the server IP is the same as the gateway, you can use "localhost" for the server param.
Regarding your issue, there is a typo in you url, you must have a & before the server param and not a ?
That said, it should work (tested it successully with your url, just changing IP and credentials). You should double check your credentials encoding into the url (http://www.url-encode-decode.com/)

But if it also doesn't work with the input form, it must be something else.
Is your server a Windows 2008 server ? sadly, neither the FreeRDP /shell nor /app feature work with that OS :/ (see notes and limitations).

Thank you for the reply.
I'm running Myrtille for testing on a Windows7 machine, maybe I should try on a more recent Windows distribution.
I fixed the typo in the URL but the result is the same.
Did you ever notice issues like this related to Windows7?
Anyway, I will let you know deploying everything on another Windows ;)

Is Windows 7 the machine on which you installed myrtille (the http gateway) or the machine you are trying to connect (the rdp server)?
I only noticed that with Windows server 2008, and lately tested it with success with a Windows server 2012 R2 and Windows 10. I have to re-check with Windows 7.

Is Windows 7 the machine on which you installed myrtille (the http gateway) or the machine you are trying to connect (the rdp server)?
It acts both as gateway and server

Actually I have the same problem with Windows 10 (using it as gateway and server). I'm wondering whether this functionality works only on Windows Server editions or I'm missing something else.
It is strange because I'm able to connect to the entire desktop, but not to a single application, and I'm trying both with the default form and the URL

Indeed I (re)tested it  on Windows 10 and it doesn't work :/ This can either be a regression or something that escaped the tests. I will investigate, thanks for reporting the issue!

If you have the same problem with Windows 7, Microsoft may have disabled that functionality for non Windows Server editions :/

If you have the same problem with Windows 7, Microsoft may have disabled that functionality (on a recent patch?) for non Windows Server editions :/

Probably yes.
Anyway I moved on a Windows Server edition and everything works perfectly.

Hello
I installed and configured myrtille 1.6.0 on a Windows Server 2012 R2 machine.
I receive error ...
The system can not find the file specified
Unable to start this initial program:notepad.exe
or Unable to start this initial program:C:\Windows\system32\notepad.exe
How can check this problem?

Hi, this is strange indeed.
Did you tried to run C:\Windows\system32\notepad.exe (Windows is installed on C:\, isn't it?), manually from a command line, within the rdp session? Does the connected user have the rights to run notepad (maybe some GPOs misconfiguration, even if you don't seem to use a domain)?
Remoteapp only allows listed programs to be run through rdp. It shouldn't be related (myrtille use an alternate shell instead of remoteapp), but could you try to run (import registry keys) RDPSetup.reg (located into the myrtille bin folder) on your rdp server (<IP_ADDRESS>)? what I'm interested in is this key.
Do you have the same issue with mstsc.exe?

Hello
sorry, i didn't run the RDPSetup.reg.
It works fine after run the RDPSetup.reg.
thanks your help.


App update is not clear in app

When starting the app, service worker look for an updated version of source code and may suggest a reload using a popup to use the latest version. However such popup disappear after 5 sec and there is no way to update the app without it which might be really frustrating.

[ ] Popup event should also display an update message on dashboard with a link to update

An other issue is the fact that service worker search for en update on first load only, but app can be cached on some browser and never reload. It would be better to search for an update once a day.

[x] App should look for update once a day and not only on load.

UI will be updated with new branding, now display a success alert on dashboard with an update button 🙌


Range validation not working

I am setting a range validation in myRow but it is not working. I would like to limit it between 0 and 1000.
How and where to do it.
thanks

Range validation in what field? Is an integer? In your form set
[IntegerEditor(MinValue = 0, MaxValue = 1000)]
over the field

Thanks. @Estrusco  that is what I needed.


dialogTitle does not work in MaterialEditTextPreference

I face the problem that dialogTitle does not work in MaterialEditTextPreference

A fix for this is in pull request #263 , just waiting for it to go in


Converting raylib compilation to unity build

Is it possible to convert raylib to a single compilation unit to reduce build times. Which means build one .c file and #include the rest.

Not sure if I understand, do you mean converting all raylib modules to header-only with implementation?
raylib is already a very small library, only about 10 files, compilation time is not a problem. Embedding those 10 files in headers and compiling a single file will take same time or even longer.

I meant that only one .obj file shows up during compilation.

It's better to organize it in multiple object files, at the end they are compiled into a single .lib library.


Remove pins to pyarrow.

context: required to solve cloud conda env. TileDB-VCF was requiring pyarrow >=15, which wouldn't solve. This PR makes the recipe match the pattern in tiledbsoma-feedstock
xref: https://github.com/TileDB-Inc/tiledb-vcf-feedstock/pull/111#issuecomment-1979177838, https://github.com/TileDB-Inc/tiledb-vcf-feedstock/pull/113#issuecomment-1985857675
to-do: if we are going to leave the recipe with no minimum required version of pyarrow, we should add pyarrow-hotfix to the requirements


Fixes ready handshake naming for bp_be_dcache

Summary
bp_be_dcache ready_o operates via a ready_and handshake, and therefore this PR updates the signal to ready_and as per the style guide and modifies all instantiations of bp_be_dcache to use the updated naming convention.
Issue Fixed
None
Area
BE, Top
Reasoning
Clarification of interface usage, more in line with existing style guide.
Analysis
None
Verification
Verilator lint passed, no functional differences

Hi thanks for the PR. Please change the target to the branch 'be_dev' and rebase as necessary

Reopening PR with issues addressed and new base branch.


fix import playbook failures when json is invalid

Summary
Catch calls to importPlaybook to adopt a more defensive approach against errors like invalid JSON files.
Add a toast to inform about the issue and possible fixes.

Ticket Link
Fixes https://mattermost.atlassian.net/browse/MM-46072
Checklist

[ ] Telemetry updated
[ ] Gated by experimental feature flag
[ ] Unit tests updated

Review requested again after @gbochora feedback implementation.
ImportPlaybook extracted to a hook (not generic enough to go to src/hooks tho):

covers ref/event/hidden input
fix an already existing bug that made subsequent imports silently fail


Fix 3 player view

Should place the default camera somewhere sensible so the area isn't just grey or shows an odd view of the map

Was fixed at some point during Spillexpo


Implement lift initializr new command

Downloads and extracts a zip from https://start.spring.io
Takes a groupId, artifactId, an single dependency name and path to put files
command and 'service' tests added
Added logrus logging library for use of debug logging level
Added internal/testutils package to indicate those classees should not be used outside this project

Fixes #5

Missing license header files and also comments on exported functions.

will issue new PR


Add test that confirms the outdated packages are deleted

Task linked: QF-2432 Deleting obsolete packages is impossible due to too strict regex

@olivierdalang It is a real issue (not breaking) that was attached in the second comment from clickup and sentry, regarding the packages regex. The other two regex fixes were something I found after second inspection of the regexes, didn't cause any harm or logs.


Fix Kconfig dependency for ETHERNET NXP S32 NETC drivers

This PR does two things:

Removing unnecessary dependency on NET_TEST in ETHERNET NXP S32 NETC drivers. Fix https://github.com/zephyrproject-rtos/zephyr/issues/64944

west twister -p s32z270dc2_rtu0_r52 --disable-warnings-as-errors -v --runtime-artifact-cleanup all  -T tests/drivers/build_all/

INFO    - Adding tasks to the queue...
INFO    - Added initial list of jobs to queue
INFO    - 81/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/modem/drivers.modem.esp_at.async.build SKIPPED (runtime filter)
INFO    - 82/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/modem/drivers.modem.quectel_bg9x.build PASSED (build)
INFO    - 83/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/modem/drivers.modem.simcom_sim7080.build PASSED (build)
INFO    - 84/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/modem/drivers.modem.gsm.build PASSED (build)
INFO    - 85/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/modem/drivers.modem.gsm_mux.build PASSED (build)
INFO    - 86/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/modem/drivers.modem.ublox_sara.build PASSED (build)
INFO    - 87/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/modem/drivers.modem.esp_at.build PASSED (build)
INFO    - 88/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/display/drivers.display.ili9342c.build PASSED (build)
INFO    - 89/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/led_strip/drivers.led_strip.build PASSED (build)
INFO    - 90/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/led/drivers.led.build      PASSED (build)
INFO    - 91/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/modem/drivers.modem.build  PASSED (build)
INFO    - 92/92 s32z270dc2_rtu0_r52       tests/drivers/build_all/ethernet/net.ethernet.build PASSED (build)

INFO    - 92 test scenarios (92 test instances) selected, 81 configurations skipped (80 by static filter, 1 at runtime).
INFO    - 11 of 92 test configurations passed (100.00%), 0 failed, 0 errored, 81 skipped with 0 warnings in 120.45 seconds

Don't try to build MDIO NXP S32 NETC driver if ETHERNET NXP S32 NETC driver is not built because MDIO is currently initialized in the Ethernet driver

BTW, the "Fixes" mention in the NET_TEST commit seems to be wrong as the issue does not seem to be related to the NET_TEST config option but to the MDIO one. Perhaps the fixes should be placed to the other commit.

The test enables both CONFIG_NET_L2_ETHERNET and CONFIG_NET_TEST https://github.com/zephyrproject-rtos/zephyr/blob/main/tests/drivers/build_all/ethernet/prj.conf#L2-L4. When NET_L2_ETHERNET is set, we expect the CONFIG_ETH_NXP_S32_NETC also be set, but currently is not because of depends on !NET_TEST


🚀 [Feature] Username validation rules

🚀 Feature

The only requirement in code for an username is a minimum length of 2
    const MIN_CHARACTERS_USERNAME = 2
    if (username.length < MIN_CHARACTERS_USERNAME) { ... }

This is hardly sufficient. Especially when choosing two spaces for a username the problem becomes obvious.

Decition in Meeting 28.12.2021 16:00:
Definition Pattern for new "username":
"communityname/useralias"

communityname

URL allowed signs

A-Z, a-z, 0-9
'-', '.', '_', '~'

useralias:

min 5 signs

alphanumerisch
keine Umlaute
'-' und '' sind nur zwischen sonst gültigen Zeichen erlaubt ([a-zA-Z0-9]-|[a-zA-Z0-9])

blacklist of keywords, which have to be defined
reserved system relevant names must have max 4 signs

dependency to #1069 only set to hightlight the same topic in both tickets

will be solved with alias-concept, see also #2849
ticket will be closed


Chain Name
Sanko
RPC URL
https://mainnet.sanko.xyz
The chain must be added to https://chainlist.org/

[X] I confirm that the chain is added to chainlist

After creating the issue, a bot will estimate the required pre-fund and post it in the comments. Please check this checkbox after you send the pre-fund.

[x] I sent the pre-fund in accordance with Github Action's comment

Relevant information
Chain ID: 1996
Explorer: https://explorer.sanko.xyz

Thanks for pointing this out @nlordell. Sent additional funds.

Deployed!