Skip to content

Commit

Permalink
Merge pull request #205 from ably/addsearch-fixes
Browse files Browse the repository at this point in the history
Search panel fixes
  • Loading branch information
Dominik authored Aug 5, 2022
2 parents 9c99c78 + 6da8a16 commit ed5faa5
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 100 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
ably-ui (8.0.0.dev.1715d4e)
ably-ui (8.0.0.dev.467d57d)
view_component (>= 2.33, < 2.50)

GEM
Expand Down
20 changes: 19 additions & 1 deletion cypress/integration/core/meganav/behaviour.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ describe("Notice", () => {
});
});

describe("Search", () => {
describe.only("Search", () => {
describe("mobile", () => {
const sharedSpecs = () => {
it("shows suggestions dropdown", () => {
Expand All @@ -350,6 +350,15 @@ describe("Search", () => {
.its("length")
.should("be.gte", 0);
});

it("sets the correct url for the search form", () => {
cy.get(MOBILE_DROPDOWN_CONTROL).trigger("click");
cy.get(SEARCH_PANEL_MOBILE_INPUT)
.parent()
.parent() // form
.invoke("attr", "action")
.should("eq", "/search");
});
};

beforeEach("set viewport", () => {
Expand Down Expand Up @@ -383,6 +392,15 @@ describe("Search", () => {
.its("length")
.should("be.gte", 0);
});

it("sets the correct url for the search form", () => {
cy.get(SEARCH_PANEL_OPEN_CONTROL).trigger("click");
cy.get(SEARCH_PANEL_INPUT)
.parent()
.parent() // form
.invoke("attr", "action")
.should("eq", "/search");
});
};

beforeEach("set viewport", () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/ably_ui/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module AblyUi
VERSION = '8.0.0.dev.1715d4e'
VERSION = '8.0.0.dev.467d57d'
end
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ably/ui",
"version": "8.0.0-dev.1715d4e",
"version": "8.0.0-dev.467d57d",
"description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -65,7 +65,7 @@
"release": "./scripts/release.sh"
},
"dependencies": {
"addsearch-js-client": "^0.6.7",
"addsearch-js-client": "^0.7.0",
"array-flat-polyfill": "^1.0.1",
"deepmerge": "^4.2.2",
"dompurify": "^2.2.9",
Expand Down
2 changes: 1 addition & 1 deletion preview/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ gem 'view_component', '~> 2.33.0', require: 'view_component/engine'

gem 'responders'

gem 'ably-ui', '8.0.0.dev.1715d4e', require: 'ably_ui'
gem 'ably-ui', '8.0.0.dev.467d57d', require: 'ably_ui'

# https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias
gem 'psych', '< 4'
Expand Down
4 changes: 2 additions & 2 deletions preview/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
ably-ui (8.0.0.dev.1715d4e)
ably-ui (8.0.0.dev.467d57d)
view_component (>= 2.33, < 2.50)
actioncable (6.0.5.1)
actionpack (= 6.0.5.1)
Expand Down Expand Up @@ -171,7 +171,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
ably-ui (= 8.0.0.dev.1715d4e)
ably-ui (= 8.0.0.dev.467d57d)
bootsnap (>= 1.4.2)
byebug
dotenv-rails
Expand Down
2 changes: 1 addition & 1 deletion preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "preview",
"private": true,
"dependencies": {
"@ably/ui": "8.0.0-dev.1715d4e",
"@ably/ui": "8.0.0-dev.467d57d",
"@babel/preset-react": "^7.12.5",
"@rails/ujs": "^6.0.0",
"@rails/webpacker": "4.3.0",
Expand Down
82 changes: 33 additions & 49 deletions preview/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# yarn lockfile v1


"@ably/[email protected].1715d4e":
version "8.0.0-dev.1715d4e"
resolved "https://registry.yarnpkg.com/@ably/ui/-/ui-8.0.0-dev.1715d4e.tgz#53100feaed4d0d4aba43b384a3b45412e4ccf932"
integrity sha512-M/n1WvT+0l/487edYSyDtE2wyLBgSyBMO6UbD/ysME0/rQJvK2PbGE+DULH1bwFZT8tyV7iEHb0Lit/c352m4g==
"@ably/[email protected].467d57d":
version "8.0.0-dev.467d57d"
resolved "https://registry.yarnpkg.com/@ably/ui/-/ui-8.0.0-dev.467d57d.tgz#e237f3aee3ad3e7345296530fdc28a5f5a45588b"
integrity sha512-+sqh1g3Q8/s9UpPhG7mzs0OdfsjqYZ8bfRdAeCaUelJGpoewBoQY5fHL1KtTJX6AGIaTSnPotqOf9EyGwDJqPw==
dependencies:
addsearch-js-client "^0.6.7"
addsearch-js-client "^0.7.0"
array-flat-polyfill "^1.0.1"
deepmerge "^4.2.2"
dompurify "^2.2.9"
Expand Down Expand Up @@ -1319,13 +1319,13 @@ acorn@^7.0.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa"
integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==

addsearch-js-client@^0.6.7:
version "0.6.7"
resolved "https://registry.yarnpkg.com/addsearch-js-client/-/addsearch-js-client-0.6.7.tgz#9710704fbe85aa17885793ba1b6a972734a373b1"
integrity sha512-n3WcpcvUH1bIkWuLsyzc3xy+icA29RcFt0rl8+nHvh+eNubjwgRzSZ8CTfx+35lnE1wsgoFQ/GpuNnGfWMBXTQ==
addsearch-js-client@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/addsearch-js-client/-/addsearch-js-client-0.7.0.tgz#d5540ea174f847264349639619a03e56d9b14237"
integrity sha512-wptQbXBnO/8hE7sbi4EeooWXAyqFAND2K+3tByhKHcISYRtNHWNEhcbpQ3HfMpojM0vJ057630fT0dZkzMtvsA==
dependencies:
axios "^0.27.2"
es6-promise "^4.2.8"
isomorphic-fetch "^3.0.0"
js-base64 "^3.6.0"

aggregate-error@^3.0.0:
Expand Down Expand Up @@ -1611,6 +1611,14 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59"
integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==

axios@^0.27.2:
version "0.27.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972"
integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==
dependencies:
follow-redirects "^1.14.9"
form-data "^4.0.0"

babel-loader@^8.0.6:
version "8.2.2"
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81"
Expand Down Expand Up @@ -2267,7 +2275,7 @@ colorette@^1.2.1, colorette@^1.2.2:
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==

combined-stream@^1.0.6, combined-stream@~1.0.6:
combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
Expand Down Expand Up @@ -3430,6 +3438,11 @@ follow-redirects@^1.0.0:
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc"
integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA==

follow-redirects@^1.14.9:
version "1.15.1"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5"
integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==

for-in@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
Expand All @@ -3440,6 +3453,15 @@ forever-agent@~0.6.1:
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=

form-data@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.8"
mime-types "^2.1.12"

form-data@~2.3.2:
version "2.3.3"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6"
Expand Down Expand Up @@ -4442,14 +4464,6 @@ isobject@^3.0.0, isobject@^3.0.1:
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8=

isomorphic-fetch@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4"
integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==
dependencies:
node-fetch "^2.6.1"
whatwg-fetch "^3.4.1"

isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
Expand Down Expand Up @@ -5114,13 +5128,6 @@ node-emoji@^1.8.1:
dependencies:
lodash.toarray "^4.4.0"

node-fetch@^2.6.1:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
dependencies:
whatwg-url "^5.0.0"

node-forge@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3"
Expand Down Expand Up @@ -7771,11 +7778,6 @@ tough-cookie@~2.5.0:
psl "^1.1.28"
punycode "^2.1.1"

tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==

trim-newlines@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144"
Expand Down Expand Up @@ -8067,11 +8069,6 @@ wbuf@^1.1.0, wbuf@^1.7.3:
dependencies:
minimalistic-assert "^1.0.0"

webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==

webpack-assets-manifest@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/webpack-assets-manifest/-/webpack-assets-manifest-3.1.1.tgz#39bbc3bf2ee57fcd8ba07cda51c9ba4a3c6ae1de"
Expand Down Expand Up @@ -8211,19 +8208,6 @@ websocket-extensions@>=0.1.1:
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==

whatwg-fetch@^3.4.1:
version "3.6.2"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz#dced24f37f2624ed0281725d51d0e2e3fe677f8c"
integrity sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==

whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==
dependencies:
tr46 "~0.0.3"
webidl-conversions "^3.0.0"

which-boxed-primitive@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6"
Expand Down
4 changes: 2 additions & 2 deletions src/core/MeganavSearchPanel/component.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<section class="ui-meganav-content grid-cols-12">
<div class="col-span-8">
<div class="mb-32">
<form class="flex items-start" action={absUrl("/search")} method="get">
<%= tag.form class: "flex items-start", action: abs_url("/search"), method: "get" do %>
<div class="relative w-full">
<%= render(AblyUi::Core::Icon.new(name: "icon-gui-search", size: "1.5rem", color: "text-cool-black", additional_css:"absolute top-12 left-16")) %>
<input type="search" name="q" class="ui-input pl-48 h-48" placeholder="Search" autocomplete="off" data-id="meganav-search-input" />
Expand All @@ -12,7 +12,7 @@
<button type="submit" class="ui-btn-secondary ml-8 sm:ml-16 md:ml-24 xl:ml-32">
Search
</button>
</form>
<% end %>
</div>
</div>

Expand Down
Loading

0 comments on commit ed5faa5

Please sign in to comment.