Skip to content

Commit

Permalink
Merge pull request #278 from mlibrary/LIBSEARCH-903-account-swap-404-…
Browse files Browse the repository at this point in the history
…image-for-the-airplane-and-searchlight-one-from-website-and-blogs

[LIBSEARCH-903] ACCOUNT: Swap 404 image for the "airplane and searchlight" one from website and blogs
  • Loading branch information
niquerio authored Nov 3, 2023
2 parents 4f36939 + e2b6cb5 commit d7c286b
Show file tree
Hide file tree
Showing 9 changed files with 287 additions and 234 deletions.
6 changes: 3 additions & 3 deletions .github/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
#!/bin/sh

set -e
rubyfiles=$(git diff --cached --name-only --diff-filter=ACM "*.rb" "Gemfile" | tr '\n' ' ')
rubyfiles=$(git diff --cached --name-only --diff-filter=ACM "*.rb" "Gemfile" "*.erb" | tr '\n' ' ')
[ -z "$rubyfiles" ] && exit 0

# Standardize all ruby files
echo "🧹 Formatting staged Ruby files using standardrb ($(echo $rubyfiles | wc -w | awk '{print $1}') total)"
echo "$rubyfiles" | xargs docker-compose run --rm web bundle exec standardrb --fix
echo "$rubyfiles" | xargs docker compose run -T --rm web bundle exec standardrb --fix

# Add back the modified/prettified files to staging
echo "$rubyfiles" | xargs git add

echo "📋 Running tests with rspec"
docker-compose run --rm web bundle exec rspec --format progress
docker compose run -T --rm web bundle exec rspec --format progress

exit 0
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ edit .env with the appropriate environment variables
start containers

```bash
docker-compose up -d
docker compose up -d
```

watch then build styles or scripts (optional)

```bash
# styles
docker-compose run --rm web npm run watch-css
docker compose run --rm web npm run watch-css
# scripts
docker-compose run --rm web npm run watch-js
docker compose run --rm web npm run watch-js
```

In a browser, go to http://localhost:4567 to see the website.
Expand Down
3 changes: 2 additions & 1 deletion config/navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@
"sidebar": "false",
"slug": "none",
"empty_state": {
"heading": "The page you were looking for could not be found"
"heading": "The page you were looking for could not be found",
"image": "<img src=\"/not-found-v2.png\" alt=\"Three airplanes searching with spotlights\" />"
}
}
]
8 changes: 4 additions & 4 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ else
fi

echo "🚢 Build docker images"
docker-compose build
docker compose build

echo "📦 Installing Gems"
docker-compose run --rm web bundle
docker compose run --rm web bundle

echo "📦 Installing Node modules"
docker-compose run --rm web npm install
docker compose run --rm web npm install

echo "📦 Building js and css"
docker-compose run --rm web npm run build
docker compose run --rm web npm run build
10 changes: 10 additions & 0 deletions lib/entities/empty_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,14 @@ def heading_tag
"h3"
end
end

def image
if @empty_state&.key?("image")
@empty_state["image"]
elsif @parent_empty_state&.image
@parent_empty_state.image
else
"<img src=\"/not-found.png\" alt=\"Pile of books\" />"
end
end
end
Loading

0 comments on commit d7c286b

Please sign in to comment.