-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2110 from unboxed/consultee-engine
Add initial setup for BOPS consultees engine
- Loading branch information
Showing
19 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//= link_tree ../builds | ||
//= link_tree ../images |
9 changes: 9 additions & 0 deletions
9
engines/bops_consultees/app/controllers/bops_consultees/application_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
module BopsConsultees | ||
class ApplicationController < ActionController::Base | ||
include BopsCore::ApplicationController | ||
|
||
layout "application" | ||
end | ||
end |
11 changes: 11 additions & 0 deletions
11
engines/bops_consultees/app/controllers/bops_consultees/dashboards_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module BopsConsultees | ||
class DashboardsController < ApplicationController | ||
def show | ||
respond_to do |format| | ||
format.html | ||
end | ||
end | ||
end | ||
end |
Empty file.
16 changes: 16 additions & 0 deletions
16
engines/bops_consultees/app/helpers/bops_consultees/application_helper.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
module BopsConsultees | ||
module ApplicationHelper | ||
include BopsCore::ApplicationHelper | ||
include BreadcrumbNavigationHelper | ||
|
||
def nav_items | ||
[] | ||
end | ||
|
||
def home_path | ||
root_path | ||
end | ||
end | ||
end |
Empty file.
11 changes: 11 additions & 0 deletions
11
engines/bops_consultees/app/views/bops_consultees/dashboards/show.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<% content_for :page_title do %> | ||
<%= t(".consultee_overview") %> - <%= t("page_title") %> | ||
<% end %> | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-full"> | ||
<h1 class="govuk-heading-l"> | ||
BOPS consultees | ||
</h1> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env ruby | ||
# This command will automatically be run when you run "rails" with Rails gems | ||
# installed from the root of your application. | ||
|
||
ENGINE_ROOT = File.expand_path("..", __dir__) | ||
ENGINE_PATH = File.expand_path("../lib/bops_consultees/engine", __dir__) | ||
APP_PATH = File.expand_path("../../../config/application", __dir__) | ||
|
||
# Set up gems listed in the Gemfile. | ||
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__) | ||
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) | ||
|
||
require "rails" | ||
|
||
require "active_model/railtie" | ||
require "active_record/railtie" | ||
require "action_controller/railtie" | ||
require "action_mailer/railtie" | ||
require "action_view/railtie" | ||
require "rails/engine/commands" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "bops_consultees" | ||
spec.version = "0.1.0" | ||
spec.authors = ["Unboxed Consulting Ltd"] | ||
spec.email = ["[email protected]"] | ||
spec.homepage = "https://unboxed.co/" | ||
spec.summary = "Provides the interface for consultees using BOPS" | ||
|
||
spec.files = Dir.chdir(File.expand_path(__dir__)) do | ||
Dir["{app,consultees,db,lib}/**/*"] | ||
end | ||
|
||
spec.add_dependency "bops_core", "0.1.0" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
en: | ||
bops_consultees: | ||
dashboards: | ||
show: | ||
consultee_overview: Consultee overview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
BopsConsultees::Engine.routes.draw do | ||
root to: redirect("dashboard") | ||
|
||
resource :dashboard, only: %i[show] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
require "bops_consultees/engine" | ||
|
||
module BopsConsultees | ||
class << self | ||
def table_name_prefix | ||
"" | ||
end | ||
|
||
def env | ||
ActiveSupport::StringInquirer.new(ENV.fetch("BOPS_ENVIRONMENT", "development")) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
module BopsConsultees | ||
class Engine < ::Rails::Engine | ||
isolate_namespace BopsConsultees | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rails_helper" | ||
|
||
RSpec.describe "Dashboard", type: :system do | ||
let!(:local_authority) { create(:local_authority, :default) } | ||
|
||
before do | ||
visit "/consultees" | ||
end | ||
|
||
it "I can view the dashboard" do | ||
expect(page).to have_current_path("/consultees/dashboard") | ||
expect(page).to have_content("BOPS consultees") | ||
end | ||
end |