Skip to content

Commit

Permalink
Merge pull request #2596 from geeksforsocialchange/main
Browse files Browse the repository at this point in the history
v0.23.3
  • Loading branch information
kimadactyl authored Sep 3, 2024
2 parents a34409c + 478de8f commit 88a5e8d
Show file tree
Hide file tree
Showing 83 changed files with 1,790 additions and 1,081 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ EVENTBRITE_TOKEN=
# You can get one by following the documentation here: https://docs.mapbox.com/api/accounts/tokens/
MAPBOX_TOKEN=

# Appsignal provides performance monitoring
# Instructions on how to generate this here: https://docs.appsignal.com/ruby/installation.html
APPSIGNAL_PUSH_API_KEY=

# If you set up postgres via Docker as per the README, you should set these
# POSTGRES_HOST=localhost
# POSTGRES_USER=postgres
Expand Down
20 changes: 10 additions & 10 deletions .github/ISSUE_TEMPLATE/new_site.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ labels:
- impacts client
---

# New site request
# New site request (for requester to complete)

- Name of person: person_name
- Region covered: region_name
- Site name: site_name
- Desired colour scheme (pick one): orange blue green pink custom
- [Optional] Interest covered: partnership_name
- Domain: site_name_slug.placecal.org
- Name of person:
- Region covered:
- Site name:
- Desired colour scheme (pick one): orange blue green pink
- PlaceCal domain: your_desired_subdomain.placecal.org
- [Optional] Partnership name:
- [Optional] Your domain (if you have one): yourdomain.com
- [Optional] Images: _Attach logos and hero image to this ticket if you have them!_

## Acceptance criteria
## Acceptance criteria (for PlaceCal devs)

- [ ] site_name_slug.placecal.org exists!
- [ ] site_name_slug.placecal.org is not set to public
- [ ] site_name_slug.placecal.org has an SSL certificate added (see [handbook](https://gfsc.notion.site/Creating-a-new-PlaceCal-Site-bd90494c88e74bfe94c306f714ede8dc))
- [ ] Header and footer logos are created (preferably as svg), with transparent background
- [ ] Site has logos uploaded in correct places
- [ ] person_name is set as site admin
- [ ] person_name is set as neighbourhood admin for region_name
- [ ] If it's an partership-based site, person_name is set as partnership admin for partnership_name
- [ ] The [handbook](https://gfsc.notion.site/Creating-a-new-PlaceCal-Site-bd90494c88e74bfe94c306f714ede8dc) is accurate (make edits if not clear)
- [ ] person_name is informed their site has been created
6 changes: 3 additions & 3 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ jobs:
- run: bin/test --lint --no-fix
- if: failure()
name: Upload test screenshots
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3
with:
name: test-screenshots
path: tmp/screenshots/
if-no-files-found: ignore

- if: github.ref == 'refs/heads/main'
name: Deploy to placecal-staging.org
uses: dokku/github-action@06286975346ec9a8d3827e6c5329d0d159d4635d # v1.4.0
uses: dokku/github-action@0c02c44f990eac0ed2b3ee90a9b3ca0a38d15349 # v1.5.0
with:
branch: main
ci_branch_name: main
Expand All @@ -70,7 +70,7 @@ jobs:

- if: github.ref == 'refs/heads/production'
name: Deploy to placecal.org
uses: dokku/github-action@06286975346ec9a8d3827e6c5329d0d159d4635d # v1.4.0
uses: dokku/github-action@0c02c44f990eac0ed2b3ee90a9b3ca0a38d15349 # v1.5.0
with:
branch: main
ci_branch_name: production
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.20.2
20.16.0
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.6
3.3.4
12 changes: 7 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

ruby '3.1.6'
ruby '3.3.4'
source 'https://rubygems.org'

git_source(:github) do |repo_name|
Expand Down Expand Up @@ -73,16 +73,18 @@ gem 'graphql'
gem 'rack-cors', require: 'rack/cors'

# Utilities
gem 'appsignal'
gem 'auto_strip_attributes'
gem 'bootsnap', require: false
gem 'csv'
gem 'enumerize'
gem 'friendly_id'
# gem 'listen' # needed?
gem 'invisible_captcha'
gem 'net-imap', require: false
gem 'net-pop', require: false
gem 'net-smtp', require: false

gem 'invisible_captcha'
gem 'observer'
gem 'paper_trail'
gem 'rollbar'
gem 'uk_postcode'
Expand All @@ -103,8 +105,8 @@ group :development do
gem 'rails-erd'
gem 'rdoc'
gem 'rubocop', '1.62.0', require: false
gem 'rubocop-graphql', '1.5.2', require: false
gem 'rubocop-minitest', '0.35.0', require: false
gem 'rubocop-graphql', '1.5.4', require: false
gem 'rubocop-minitest', '0.35.1', require: false
gem 'rubocop-performance', '1.21.1', require: false
gem 'rubocop-rails', '2.24.1', require: false
gem 'rubocop-rake', require: false
Expand Down
21 changes: 14 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ GEM
ancestry (4.1.0)
activerecord (>= 5.2.6)
ansi (1.5.0)
appsignal (3.13.0)
rack
ast (2.4.2)
auto_strip_attributes (2.6.0)
activerecord (>= 4.0)
Expand Down Expand Up @@ -138,6 +140,7 @@ GEM
crack (0.4.5)
rexml
crass (1.0.6)
csv (3.3.0)
database_cleaner-active_record (2.1.0)
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
Expand Down Expand Up @@ -295,12 +298,13 @@ GEM
racc (~> 1.4)
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
observer (0.1.2)
orm_adapter (0.5.0)
paper_trail (15.1.0)
activerecord (>= 6.1)
request_store (~> 1.4)
parallel (1.24.0)
parser (3.3.3.0)
parser (3.3.4.1)
ast (~> 2.4.1)
racc
pg (1.4.3)
Expand Down Expand Up @@ -396,9 +400,9 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
rubocop-graphql (1.5.2)
rubocop (>= 0.90, < 2)
rubocop-minitest (0.35.0)
rubocop-graphql (1.5.4)
rubocop (>= 1.50, < 2)
rubocop-minitest (0.35.1)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-performance (1.21.1)
Expand Down Expand Up @@ -497,6 +501,7 @@ PLATFORMS
DEPENDENCIES
ajax-datatables-rails
ancestry
appsignal
auto_strip_attributes
better_errors
binding_of_caller
Expand All @@ -507,6 +512,7 @@ DEPENDENCIES
carrierwave
cocoon
coffee-rails
csv
database_cleaner-active_record
delayed_job_active_record
devise
Expand Down Expand Up @@ -542,6 +548,7 @@ DEPENDENCIES
net-imap
net-pop
net-smtp
observer
paper_trail
pg
puma
Expand All @@ -553,8 +560,8 @@ DEPENDENCIES
rdoc
rollbar
rubocop (= 1.62.0)
rubocop-graphql (= 1.5.2)
rubocop-minitest (= 0.35.0)
rubocop-graphql (= 1.5.4)
rubocop-minitest (= 0.35.1)
rubocop-performance (= 1.21.1)
rubocop-rails (= 2.24.1)
rubocop-rake
Expand All @@ -574,7 +581,7 @@ DEPENDENCIES
yard

RUBY VERSION
ruby 3.1.6p260
ruby 3.3.4p94

BUNDLED WITH
2.5.4
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ To get an idea of the project and what we're about, check out [the handbook](htt
To run PlaceCal locally you will need to install the following dependencies:

- [Docker](https://docs.docker.com/get-docker/)
- [Ruby 3.1.6](https://www.ruby-lang.org/)
- [Node.js](https://nodejs.org/en/download) 16.x & (optional) [nvm](https://github.com/nvm-sh/nvm) to manage it
- [Ruby 3.3.4](https://www.ruby-lang.org/)
- [Node.js 20.x](https://nodejs.org/en/download) & (optional) [nvm](https://github.com/nvm-sh/nvm) to manage it
- [Yarn 1.x](https://classic.yarnpkg.com/lang/en/)
- [ImageMagick](https://imagemagick.org/index.php) for image manipulation
- [Graphviz](https://voormedia.github.io/rails-erd/install.html) for documentation diagrams
Expand Down Expand Up @@ -67,6 +67,29 @@ Amongst other things, this will create an admin user for you:
- The admin interface is at `admin.lvh.me:3000`
- Access code docs through your local filesystem and update them with `bin/rails yard`

### Importing calendars

To import all events, run the following command.

```sh
rails events:import_all_calendars
```

After this has run once, the following command can be run which attempts to skip calendars which have not been updated. This should be run regularly on a cron in production environments. If you are using dokku to deploy like we are, this is handled in the `app.json` config file.

```sh
rails events:scan_for_calendars_needing_import
```

To import one calendar, run:

```sh
rails events:import_calendar[100]

# nb: zsh users will need to escape brackets
rails events:import_calendar\[100\]
```

## Testing, linting and formatting

PlaceCal tests are written in minitest. We use Rubocop to lint our Ruby code.
Expand Down Expand Up @@ -94,6 +117,12 @@ Previously this system used mountain view, and some of the components are still

More info here: https://viewcomponent.org/guide/generators.html

## API

API examples and test environment are provided using [Bruno](https://www.usebruno.com/).

Install it with your system package manager then point it at the `collections` directory.

## Donations

If you'd like to support development, please consider sending us a one-off or regular donation on Ko-fi. You can do this through the "support" button in GitHub at the top of this repo.
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"cron": [
{
"command": "bundle exec rails import:scan_for_calendars_needing_import",
"command": "bundle exec rails events:scan_for_calendars_needing_import",
"schedule": "0 * * * *"
}
]
Expand Down
2 changes: 2 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
@import "components/case_study_component";
@import "components/container_with_header_component";
@import "components/featured_partnerships_component";
@import "components/filters";
@import "components/four_col_grid_component";
@import "components/full_width_action_component";
@import "components/hero_section_component";
Expand All @@ -44,5 +45,6 @@
@import "components/link_btn_lrg_component";
@import "components/max_width_component";
@import "components/neighbourhood_home_card_component";
@import "components/partner_preview_component.scss";
@import "components/partnership_card_component";
@import "components/pull_quote_component";
59 changes: 59 additions & 0 deletions app/assets/stylesheets/components/filters.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@import "variables_mixins";

.filters {
&__form {
position: relative;
}

&__toggle button {
border: none;
background: none;
font-family: $sans-serif;
}

&__label {
text-align: left;
margin-left: 0.25rem;
}

&__dropdown {
background-color: $base-background;
box-shadow: 7px 7px 20px 0px rgba(153, 134, 117, 0.83);
padding: 0.8rem;
position: absolute;
top: 2rem;
z-index: 500;
text-align: center;

&--category {
left: -1rem;
}

&--neighbourhood {
right: -3rem;
}

&--hidden {
display: none;
}
}

&__option {
padding: 0.25rem 0;
display: grid;
grid-template-columns: auto 1fr;
}

&__reset {
}

input {
&:checked + label {
font-weight: bold;
}
}

hr {
border-width: 3px 0 0;
}
}
2 changes: 1 addition & 1 deletion app/components/breadcrumb/breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

.btn {
border-bottom-color: var(--base-primary);
margin-left: 0.5rem;
margin: 0.75rem 0 0.2rem 0;
line-height: normal;
}

Expand Down
Loading

0 comments on commit 88a5e8d

Please sign in to comment.