Merge branch 'dev'
This commit is contained in:
commit
65a0013e41
13 changed files with 27 additions and 88 deletions
|
@ -89,9 +89,9 @@ class StatsController < ApplicationController
|
||||||
|
|
||||||
def satisfaction_usagers
|
def satisfaction_usagers
|
||||||
legend = {
|
legend = {
|
||||||
Feedback.ratings.fetch(:unhappy) => "Mécontents",
|
Feedback.ratings.fetch(:happy) => "Satisfaits",
|
||||||
Feedback.ratings.fetch(:neutral) => "Neutres",
|
Feedback.ratings.fetch(:neutral) => "Neutres",
|
||||||
Feedback.ratings.fetch(:happy) => "Satisfaits"
|
Feedback.ratings.fetch(:unhappy) => "Mécontents"
|
||||||
}
|
}
|
||||||
|
|
||||||
totals = Feedback.where(created_at: 5.weeks.ago..Time.now).group_by_week(:created_at).count
|
totals = Feedback.where(created_at: 5.weeks.ago..Time.now).group_by_week(:created_at).count
|
||||||
|
|
|
@ -45,7 +45,7 @@ class ApiEntreprise::API
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.url(resource_name, siret_or_siren)
|
def self.url(resource_name, siret_or_siren)
|
||||||
[base_url, resource_name, siret_or_siren].join("/")
|
[API_ENTREPRISE_URL, resource_name, siret_or_siren].join("/")
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.params(siret_or_siren, procedure_id)
|
def self.params(siret_or_siren, procedure_id)
|
||||||
|
@ -62,8 +62,4 @@ class ApiEntreprise::API
|
||||||
def self.token
|
def self.token
|
||||||
Rails.application.secrets.api_entreprise[:key]
|
Rails.application.secrets.api_entreprise[:key]
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.base_url
|
|
||||||
Rails.application.secrets.api_entreprise[:base_url]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,4 +6,6 @@ class Feedback < ApplicationRecord
|
||||||
neutral: 'neutral',
|
neutral: 'neutral',
|
||||||
unhappy: 'unhappy'
|
unhappy: 'unhappy'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
validates :rating, presence: true
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,14 +18,6 @@
|
||||||
|
|
||||||
.container
|
.container
|
||||||
- if @dossiers.present?
|
- if @dossiers.present?
|
||||||
- if @dossiers.total_pages >= 2
|
|
||||||
.card.feedback
|
|
||||||
.card-title Nous avons redesigné la liste des dossiers.
|
|
||||||
%p
|
|
||||||
Une suggestion pour améliorer cette page ? Votre avis nous intéresse ! Écrivez-nous à
|
|
||||||
= mail_to CONTACT_EMAIL, CONTACT_EMAIL, subject: "Amélioration de la liste des dossiers"
|
|
||||||
\.
|
|
||||||
|
|
||||||
%table.table.dossiers-table.hoverable
|
%table.table.dossiers-table.hoverable
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
.chart-container
|
.chart-container
|
||||||
.chart
|
.chart
|
||||||
= line_chart @satisfaction_usagers,
|
= line_chart @satisfaction_usagers,
|
||||||
colors: ["#F28900", "rgba(161, 0, 5, 0.9)", "#15AD70"]
|
colors: ["#15AD70", "#F28900", "rgba(161, 0, 5, 0.9)"]
|
||||||
|
|
||||||
.stat-card.stat-card-half.pull-left
|
.stat-card.stat-card-half.pull-left
|
||||||
%span.stat-card-title
|
%span.stat-card-title
|
||||||
|
|
|
@ -6,8 +6,7 @@ GITHUB_CLIENT_SECRET=""
|
||||||
|
|
||||||
FC_PARTICULIER_ID=""
|
FC_PARTICULIER_ID=""
|
||||||
FC_PARTICULIER_SECRET=""
|
FC_PARTICULIER_SECRET=""
|
||||||
FC_PARTICULIER_REDIRECT_URI=""
|
FC_PARTICULIER_BASE_URL=""
|
||||||
FC_PARTICULIER_HOST=""
|
|
||||||
|
|
||||||
API_ENTREPRISE_KEY=""
|
API_ENTREPRISE_KEY=""
|
||||||
API_ENTREPRISE_BASE_URL="https://entreprise.api.gouv.fr/v2"
|
API_ENTREPRISE_BASE_URL="https://entreprise.api.gouv.fr/v2"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
|
# API URLs
|
||||||
API_CARTO_URL = "https://apicarto.sgmap.fr"
|
API_CARTO_URL = "https://apicarto.sgmap.fr"
|
||||||
|
API_ENTREPRISE_URL = "https://entreprise.api.gouv.fr/v2"
|
||||||
API_GEO_URL = "https://geo.api.gouv.fr"
|
API_GEO_URL = "https://geo.api.gouv.fr"
|
||||||
|
|
||||||
PIPEDRIVE_API_URL = 'https://api.pipedrive.com/v1'
|
PIPEDRIVE_API_URL = 'https://api.pipedrive.com/v1'
|
||||||
|
|
||||||
|
# External services URLs
|
||||||
DOC_URL = "https://doc.demarches-simplifiees.fr"
|
DOC_URL = "https://doc.demarches-simplifiees.fr"
|
||||||
LISTE_DES_DEMARCHES_URL = [DOC_URL, "listes-des-demarches"].join("/")
|
LISTE_DES_DEMARCHES_URL = [DOC_URL, "listes-des-demarches"].join("/")
|
||||||
CGU_URL = [DOC_URL, "cgu"].join("/")
|
CGU_URL = [DOC_URL, "cgu"].join("/")
|
||||||
MENTIONS_LEGALES_URL = [CGU_URL, "4-mentions-legales"].join("#")
|
MENTIONS_LEGALES_URL = [CGU_URL, "4-mentions-legales"].join("#")
|
||||||
|
|
||||||
FAQ_URL = "https://faq.demarches-simplifiees.fr"
|
FAQ_URL = "https://faq.demarches-simplifiees.fr"
|
||||||
|
|
|
@ -18,11 +18,11 @@ defaults: &defaults
|
||||||
france_connect_particulier:
|
france_connect_particulier:
|
||||||
identifier: <%= ENV['FC_PARTICULIER_ID'] %>
|
identifier: <%= ENV['FC_PARTICULIER_ID'] %>
|
||||||
secret: <%= ENV['FC_PARTICULIER_SECRET'] %>
|
secret: <%= ENV['FC_PARTICULIER_SECRET'] %>
|
||||||
redirect_uri: <%= ENV['FC_PARTICULIER_REDIRECT_URI'] %>
|
redirect_uri: https://{{ <%= ENV['APP_HOST'] %> }}/france_connect/particulier/callback
|
||||||
authorization_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/authorize
|
authorization_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/authorize
|
||||||
token_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/token
|
token_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/token
|
||||||
userinfo_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/userinfo
|
userinfo_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/userinfo
|
||||||
logout_endpoint: <%= ENV['FC_PARTICULIER_HOST'] %>/api/v1/logout
|
logout_endpoint: <%= ENV['FC_PARTICULIER_BASE_URL'] %>/api/v1/logout
|
||||||
github:
|
github:
|
||||||
client_id: <%= ENV['GITHUB_CLIENT_ID'] %>
|
client_id: <%= ENV['GITHUB_CLIENT_ID'] %>
|
||||||
client_secret: <%= ENV['GITHUB_CLIENT_SECRET'] %>
|
client_secret: <%= ENV['GITHUB_CLIENT_SECRET'] %>
|
||||||
|
@ -31,7 +31,6 @@ defaults: &defaults
|
||||||
secret_key: <%= ENV['MAILJET_SECRET_KEY'] %>
|
secret_key: <%= ENV['MAILJET_SECRET_KEY'] %>
|
||||||
api_entreprise:
|
api_entreprise:
|
||||||
key: <%= ENV['API_ENTREPRISE_KEY'] %>
|
key: <%= ENV['API_ENTREPRISE_KEY'] %>
|
||||||
base_url: <%= ENV['API_ENTREPRISE_BASE_URL'] %>
|
|
||||||
pipedrive:
|
pipedrive:
|
||||||
key: <%= ENV['PIPEDRIVE_KEY'] %>
|
key: <%= ENV['PIPEDRIVE_KEY'] %>
|
||||||
fog:
|
fog:
|
||||||
|
@ -57,7 +56,6 @@ test:
|
||||||
signing_key: aef3153a9829fa4ba10acb02927ac855df6b92795b1ad265d654443c4b14a017
|
signing_key: aef3153a9829fa4ba10acb02927ac855df6b92795b1ad265d654443c4b14a017
|
||||||
api_entreprise:
|
api_entreprise:
|
||||||
key: api_entreprise_test_key
|
key: api_entreprise_test_key
|
||||||
base_url: https://entreprise.api.gouv.fr/v2
|
|
||||||
fog:
|
fog:
|
||||||
base_url: https://storage.apientreprise.fr
|
base_url: https://storage.apientreprise.fr
|
||||||
directory: tps_dev
|
directory: tps_dev
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class MakeFeedbacksRatingNotNull < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
change_column_null :feedbacks, :rating, false
|
||||||
|
end
|
||||||
|
end
|
5
db/migrate/20180827111451_remove_mark_on_feedbacks.rb
Normal file
5
db/migrate/20180827111451_remove_mark_on_feedbacks.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class RemoveMarkOnFeedbacks < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
remove_column :feedbacks, :mark
|
||||||
|
end
|
||||||
|
end
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2018_08_27_102828) do
|
ActiveRecord::Schema.define(version: 2018_08_27_111451) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -320,10 +320,9 @@ ActiveRecord::Schema.define(version: 2018_08_27_102828) do
|
||||||
|
|
||||||
create_table "feedbacks", force: :cascade do |t|
|
create_table "feedbacks", force: :cascade do |t|
|
||||||
t.bigint "user_id"
|
t.bigint "user_id"
|
||||||
t.integer "mark"
|
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.string "rating"
|
t.string "rating", null: false
|
||||||
t.index ["user_id"], name: "index_feedbacks_on_user_id"
|
t.index ["user_id"], name: "index_feedbacks_on_user_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,56 +1,4 @@
|
||||||
namespace :dev do
|
namespace :dev do
|
||||||
desc 'Initialise dev environment'
|
|
||||||
task :init do
|
|
||||||
puts 'start initialisation'
|
|
||||||
Rake::Task['dev:generate_franceconnect_file'].invoke
|
|
||||||
Rake::Task['dev:generate_fog_credentials_file'].invoke
|
|
||||||
Rake::Task['dev:generate_features_file'].invoke
|
|
||||||
|
|
||||||
puts 'end initialisation'
|
|
||||||
end
|
|
||||||
|
|
||||||
task :generate_franceconnect_file do
|
|
||||||
file = File.new('config/france_connect.yml', 'w+')
|
|
||||||
comment = <<~EOF
|
|
||||||
particulier_identifier: plop
|
|
||||||
particulier_secret: plip
|
|
||||||
|
|
||||||
particulier_redirect_uri: 'http://localhost:3000/france_connect/particulier/callback'
|
|
||||||
|
|
||||||
particulier_authorization_endpoint: 'https://fcp.integ01.dev-franceconnect.fr/api/v1/authorize'
|
|
||||||
particulier_token_endpoint: 'https://fcp.integ01.dev-franceconnect.fr/api/v1/token'
|
|
||||||
particulier_userinfo_endpoint: 'https://fcp.integ01.dev-franceconnect.fr/api/v1/userinfo'
|
|
||||||
particulier_logout_endpoint: 'https://fcp.integ01.dev-franceconnect.fr/api/v1/logout'
|
|
||||||
EOF
|
|
||||||
file.write(comment)
|
|
||||||
file.close
|
|
||||||
end
|
|
||||||
|
|
||||||
task :generate_fog_credentials_file do
|
|
||||||
puts 'creating fog_credentials.test.yml file'
|
|
||||||
content = <<~EOF
|
|
||||||
default:
|
|
||||||
openstack_tenant: "ovh_fake_tenant_name"
|
|
||||||
openstack_api_key: "ovh_fake_password"
|
|
||||||
openstack_username: "ovh_fake_username"
|
|
||||||
openstack_auth_url: "https://auth.cloud.ovh.net/v2.0/tokens"
|
|
||||||
openstack_region: "SBG1"
|
|
||||||
EOF
|
|
||||||
file = File.new("config/fog_credentials.test.yml", "w+")
|
|
||||||
file.write(content)
|
|
||||||
file.close
|
|
||||||
end
|
|
||||||
|
|
||||||
task :generate_features_file do
|
|
||||||
puts 'creating features.yml file'
|
|
||||||
content = <<~EOF
|
|
||||||
remote_storage: true
|
|
||||||
EOF
|
|
||||||
file = File.new("config/initializers/features.yml", "w+")
|
|
||||||
file.write(content)
|
|
||||||
file.close
|
|
||||||
end
|
|
||||||
|
|
||||||
def run_and_stop_if_error(cmd)
|
def run_and_stop_if_error(cmd)
|
||||||
sh cmd do |ok, res|
|
sh cmd do |ok, res|
|
||||||
if !ok
|
if !ok
|
||||||
|
|
|
@ -59,11 +59,6 @@ describe 'user access to the list of his dossier' do
|
||||||
page.click_link("Suivant")
|
page.click_link("Suivant")
|
||||||
expect(page).to have_content(dossier_archived.procedure.libelle)
|
expect(page).to have_content(dossier_archived.procedure.libelle)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'the user sees a card asking for feedback' do
|
|
||||||
expect(page).to have_css('.card.feedback')
|
|
||||||
expect(page).to have_content(CONTACT_EMAIL)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "recherche" do
|
describe "recherche" do
|
||||||
|
|
Loading…
Reference in a new issue