Skip to content

Commit

Permalink
Merge branch 'release/6.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Oct 14, 2022
2 parents 2881da0 + 7c39c8b commit 2a2efba
Show file tree
Hide file tree
Showing 29 changed files with 550 additions and 415 deletions.
12 changes: 6 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ gem 'delayed_job_active_record', '~> 4.1.7'

# dashboard
gem 'delayed_job_web', '~>1.4.4'
gem 'sinatra', '~>2.2.2'

# pagination
gem 'will_paginate', '~>3.3.1'
Expand All @@ -71,9 +70,10 @@ gem 'devise', '~>4.8.1'
gem 'ruby-saml', '~> 1.14.0'

# omniauth
gem 'omniauth-google-oauth2', '~> 0.8.2'
gem 'omniauth-oauth2', '~> 1.7.2'
gem 'omniauth-google-oauth2', '~> 1.1.1'
gem 'omniauth-oauth2', '~> 1.8.0'
gem 'omniauth_openid_connect', '~> 0.4.0'
gem 'omniauth-rails_csrf_protection', '~> 1.0.1'

# Json webtokens
gem 'jwt', '~> 2.5.0'
Expand Down Expand Up @@ -135,14 +135,14 @@ gem 'memory_profiler', '~> 1.0.0'
gem 'rack-mini-profiler', '~> 3.0.0'
gem 'stackprof', '~> 0.2.21'

gem 'ddtrace', '~> 1.4.1'
gem 'ddtrace', '~> 1.5.0'

# Make sure filesystem changes only happen at the end of a transaction
gem 'after_commit_everywhere', '~> 1.2.2'

group :development, :test do
# Use mocha for stubbing and mocking
gem 'mocha', '~> 1.14.0'
gem 'mocha', '~> 1.15.0'
# Factory bot for factories
gem 'factory_bot_rails', '~> 6.2.0'

Expand All @@ -154,7 +154,7 @@ group :development, :test do

# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 3.37.1'
gem 'selenium-webdriver', '~> 4.4.0'
gem 'selenium-webdriver', '~> 4.5.0'
end

group :test do
Expand Down
73 changes: 40 additions & 33 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ GEM
after_commit_everywhere (1.2.2)
activerecord (>= 4.2)
activesupport
airbrussh (1.4.1)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
annotate (3.2.0)
activerecord (>= 3.2, < 8.0)
Expand All @@ -91,7 +91,7 @@ GEM
bootstrap_tokenfield_rails (0.12.1)
builder (3.2.4)
byebug (11.1.3)
capistrano (3.17.1)
capistrano (3.17.0)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
Expand Down Expand Up @@ -133,12 +133,12 @@ GEM
railties (>= 6.0.0)
daemons (1.4.1)
dalli (3.2.2)
ddtrace (1.4.1)
debase-ruby_core_source (= 0.10.16)
ddtrace (1.5.0)
debase-ruby_core_source (>= 0.10.16, <= 0.10.17)
libdatadog (~> 0.7.0.1.1)
libddwaf (~> 1.3.0.2.0)
msgpack
debase-ruby_core_source (0.10.16)
debase-ruby_core_source (0.10.17)
delayed_job (4.1.10)
activesupport (>= 3.0, < 8.0)
delayed_job_active_record (4.1.7)
Expand Down Expand Up @@ -166,7 +166,7 @@ GEM
exception_notification (4.5.0)
actionmailer (>= 5.2, < 8)
activesupport (>= 5.2, < 8)
excon (0.92.4)
excon (0.92.3)
execjs (2.8.1)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
Expand All @@ -181,7 +181,7 @@ GEM
faraday-net_http (3.0.0)
ffi (1.15.5)
flamegraph (0.9.5)
glob (0.3.1)
glob (0.3.0)
globalid (1.0.0)
activesupport (>= 5.0)
has_scope (0.8.0)
Expand Down Expand Up @@ -213,11 +213,10 @@ GEM
jsbundling-rails (1.0.3)
railties (>= 6.0.0)
json (2.6.2)
json-jwt (1.15.3)
json-jwt (1.14.0)
activesupport (>= 4.2)
aes_key_wrap
bindata
httpclient
json-schema (3.0.0)
addressable (>= 2.8)
jwt (2.5.0)
Expand Down Expand Up @@ -257,7 +256,7 @@ GEM
minitest (>= 5.0.6)
minitest-utils (0.4.8)
minitest
mocha (1.14.0)
mocha (1.15.0)
msgpack (1.5.6)
multi_json (1.15.0)
multi_xml (0.6.0)
Expand All @@ -284,32 +283,36 @@ GEM
nio4r (2.5.8)
nokogiri (1.13.8-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.10)
oauth2 (2.0.8)
faraday (>= 0.17.3, < 3.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.9.2)
snaky_hash (~> 2.0)
version_gem (~> 1.1)
omniauth (2.1.0)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
omniauth-google-oauth2 (0.8.2)
rack (>= 2.2.3)
rack-protection
omniauth-google-oauth2 (1.1.1)
jwt (>= 2.0)
oauth2 (~> 1.1)
omniauth (~> 1.1)
omniauth-oauth2 (>= 1.6)
omniauth-oauth2 (1.7.3)
oauth2 (~> 2.0.6)
omniauth (~> 2.0)
omniauth-oauth2 (~> 1.8.0)
omniauth-oauth2 (1.8.0)
oauth2 (>= 1.4, < 3)
omniauth (>= 1.9, < 3)
omniauth (~> 2.0)
omniauth-rails_csrf_protection (1.0.1)
actionpack (>= 4.2)
omniauth (~> 2.0)
omniauth_openid_connect (0.4.0)
addressable (~> 2.5)
omniauth (>= 1.9, < 3)
openid_connect (~> 1.1)
openid_connect (1.3.1)
openid_connect (1.3.0)
activemodel
attr_required (>= 1.0.0)
json-jwt (>= 1.5.0)
net-smtp
rack-oauth2 (>= 1.6.1)
swd (>= 1.0.0)
tzinfo
Expand Down Expand Up @@ -338,7 +341,7 @@ GEM
rack (2.2.4)
rack-mini-profiler (3.0.0)
rack (>= 1.2.0)
rack-oauth2 (1.21.2)
rack-oauth2 (1.19.0)
activesupport
attr_required
httpclient
Expand Down Expand Up @@ -383,7 +386,7 @@ GEM
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
rb-readline (0.5.5)
Expand Down Expand Up @@ -417,7 +420,7 @@ GEM
ffi (~> 1.12)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
selenium-webdriver (4.4.0)
selenium-webdriver (4.5.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
Expand All @@ -434,14 +437,17 @@ GEM
rack-protection (= 2.2.2)
tilt (~> 2.0)
slack-notifier (2.4.0)
sprockets (4.1.1)
snaky_hash (2.0.0)
hashie
version_gem (~> 1.1)
sprockets (4.1.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sshkit (1.21.3)
sshkit (1.21.2)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stackprof (0.2.21)
Expand All @@ -465,6 +471,7 @@ GEM
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
version_gem (1.1.0)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.0)
Expand Down Expand Up @@ -510,7 +517,7 @@ DEPENDENCIES
codecov (~> 0.6.0)
cssbundling-rails (~> 1.1.1)
dalli (~> 3.2.2)
ddtrace (~> 1.4.1)
ddtrace (~> 1.5.0)
delayed_job_active_record (~> 4.1.7)
delayed_job_web (~> 1.4.4)
devise (~> 4.8.1)
Expand Down Expand Up @@ -539,11 +546,12 @@ DEPENDENCIES
memory_profiler (~> 1.0.0)
minitest-ci (~> 3.4.0)
minitest-utils (~> 0.4.8)
mocha (~> 1.14.0)
mocha (~> 1.15.0)
mysql2 (~> 0.5.4)
nokogiri (~> 1.13.8)
omniauth-google-oauth2 (~> 0.8.2)
omniauth-oauth2 (~> 1.7.2)
omniauth-google-oauth2 (~> 1.1.1)
omniauth-oauth2 (~> 1.8.0)
omniauth-rails_csrf_protection (~> 1.0.1)
omniauth_openid_connect (~> 0.4.0)
premailer-rails (~> 1.11.1)
pretender (~> 0.4.0)
Expand All @@ -558,9 +566,8 @@ DEPENDENCIES
rubocop-rails (~> 2.16.1)
ruby-saml (~> 1.14.0)
rubyzip (~> 2.3.2)
selenium-webdriver (~> 4.4.0)
selenium-webdriver (~> 4.5.0)
simplecov (~> 0.21.2)
sinatra (~> 2.2.2)
slack-notifier (~> 2.4.0)
sprockets-rails (~> 3.4.2)
stackprof (~> 0.2.21)
Expand Down
42 changes: 28 additions & 14 deletions app/assets/javascripts/components/datalist_input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import { html, TemplateResult } from "lit";
import { ShadowlessLitElement } from "components/shadowless_lit_element";
import { ref, Ref, createRef } from "lit/directives/ref.js";
import { watchMixin } from "components/watch_mixin";
import { unsafeHTML } from "lit/directives/unsafe-html.js";
import { htmlEncode } from "util.js";

type Option = {label: string, value: string, extra?: string};
export type Option = {label: string, value: string, extra?: string};

/**
* This component represents an input field with a datalist with possible options for the input.
Expand All @@ -16,6 +18,7 @@ type Option = {label: string, value: string, extra?: string};
* If the user input does not match any label, the value sent to the server wil be ""
* The extra string is added in the options and also used to match the input
* @prop {String} value - the initial value for this field
* @prop {String} filter - the initial filter value for this field
* @prop {String} placeholder - placeholder text shown in input
*
* @fires input - on value change, event details contain {label: string, value: string}
Expand All @@ -29,13 +32,12 @@ export class DatalistInput extends watchMixin(ShadowlessLitElement) {
@property({ type: String })
value: string;
@property({ type: String })
filter: string = this.label;
@property({ type: String })
placeholder: string;

inputRef: Ref<HTMLInputElement> = createRef();

@property({ state: true })
filter: string = this.label;

watch = {
filter: () => {
if (!this.value) {
Expand All @@ -60,14 +62,12 @@ export class DatalistInput extends watchMixin(ShadowlessLitElement) {
};

fireEvent(): void {
if (this.value) {
const event = new CustomEvent("input", {
detail: { value: this.value, label: this.filter },
bubbles: true,
composed: true
});
this.dispatchEvent(event);
}
const event = new CustomEvent("input", {
detail: { value: this.value, label: this.filter },
bubbles: true,
composed: true
});
this.dispatchEvent(event);
}

get label(): string {
Expand Down Expand Up @@ -116,6 +116,19 @@ export class DatalistInput extends watchMixin(ShadowlessLitElement) {
e.stopPropagation();
}

keydown(e: KeyboardEvent): void {
if (e.key === "Tab" && this.filtered_options.length > 0) {
this.value = this.filtered_options[0].value;
this.filter = this.filtered_options[0].label;
}
}

mark(s: string): TemplateResult {
return this.filter ?
html`${unsafeHTML(htmlEncode(s).replace(new RegExp(this.filter, "gi"), m => `<b>${m}</b>`))}` :
html`${s}`;
}

render(): TemplateResult {
return html`
<div class="dropdown">
Expand All @@ -125,14 +138,15 @@ export class DatalistInput extends watchMixin(ShadowlessLitElement) {
@input=${e => this.processInput(e)}
.value="${this.filter}"
placeholder="${this.placeholder}"
@keydown=${e => this.keydown(e)}
>
<ul class="dropdown-menu ${this.filter && this.filtered_options.length > 0 ? "show-search-dropdown" : ""}"
style="position: fixed; top: ${this.dropdown_top}px; left: ${this.dropdown_left}px; max-width: ${this.dropdown_width}px; overflow-x: hidden;">
${this.filtered_options.map(option => html`
<li><a class="dropdown-item ${this.value === option.value ? "active" :""} " @click=${ e => this.select(option, e)} style="cursor: pointer;">
${option.label}
${this.mark(option.label)}
${option.extra ? html`
<br/><span class="small">${option.extra}</span>
<br/><span class="small">${this.mark(option.extra)}</span>
`:""}
</a></li>
`)}
Expand Down
Loading

0 comments on commit 2a2efba

Please sign in to comment.