From df00d4879200f91c8c22e592496e059de55e0005 Mon Sep 17 00:00:00 2001 From: pabois <pierreandre.boissinot@noesya.coop> Date: Thu, 6 Jul 2023 12:40:11 +0200 Subject: [PATCH] update --- app/models/communication/extranet.rb | 57 ++++++++++--------- .../website/page/research_hal_publication.rb | 43 ++++++++++++++ .../website/permalink/publication.rb | 25 ++++++++ db/schema.rb | 5 +- test/fixtures/communication/extranets.yml | 57 ++++++++++--------- 5 files changed, 129 insertions(+), 58 deletions(-) diff --git a/app/models/communication/extranet.rb b/app/models/communication/extranet.rb index 0dc316363..1a4615b3d 100644 --- a/app/models/communication/extranet.rb +++ b/app/models/communication/extranet.rb @@ -2,34 +2,35 @@ # # Table name: communication_extranets # -# id :uuid not null, primary key -# about_type :string indexed => [about_id] -# color :string -# cookies_policy :text -# css :text -# feature_alumni :boolean default(FALSE) -# feature_contacts :boolean default(FALSE) -# feature_jobs :boolean default(FALSE) -# feature_library :boolean default(FALSE) -# feature_posts :boolean default(FALSE) -# has_sso :boolean default(FALSE) -# home_sentence :text -# host :string -# name :string -# privacy_policy :text -# registration_contact :string -# sass :text -# sso_button_label :string -# sso_cert :text -# sso_mapping :jsonb -# sso_name_identifier_format :string -# sso_provider :integer default("saml") -# sso_target_url :string -# terms :text -# created_at :datetime not null -# updated_at :datetime not null -# about_id :uuid indexed => [about_type] -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# about_type :string indexed => [about_id] +# allow_experiences_modification :boolean default(TRUE) +# color :string +# cookies_policy :text +# css :text +# feature_alumni :boolean default(FALSE) +# feature_contacts :boolean default(FALSE) +# feature_jobs :boolean default(FALSE) +# feature_library :boolean default(FALSE) +# feature_posts :boolean default(FALSE) +# has_sso :boolean default(FALSE) +# home_sentence :text +# host :string +# name :string +# privacy_policy :text +# registration_contact :string +# sass :text +# sso_button_label :string +# sso_cert :text +# sso_mapping :jsonb +# sso_name_identifier_format :string +# sso_provider :integer default("saml") +# sso_target_url :string +# terms :text +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid indexed => [about_type] +# university_id :uuid not null, indexed # # Indexes # diff --git a/app/models/communication/website/page/research_hal_publication.rb b/app/models/communication/website/page/research_hal_publication.rb index 9fc695c78..4dd7fbeb8 100644 --- a/app/models/communication/website/page/research_hal_publication.rb +++ b/app/models/communication/website/page/research_hal_publication.rb @@ -1,3 +1,46 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# header_text :text +# kind :integer +# meta_description :text +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# summary :text +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid not null, indexed +# original_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_original_id (original_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_304f57360f (original_id => communication_website_pages.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# class Communication::Website::Page::ResearchHalPublication < Communication::Website::Page def is_necessary_for_website? diff --git a/app/models/communication/website/permalink/publication.rb b/app/models/communication/website/permalink/publication.rb index b5904c51e..4a9b486c2 100644 --- a/app/models/communication/website/permalink/publication.rb +++ b/app/models/communication/website/permalink/publication.rb @@ -1,3 +1,28 @@ +# == Schema Information +# +# Table name: communication_website_permalinks +# +# id :uuid not null, primary key +# about_type :string not null, indexed => [about_id] +# is_current :boolean default(TRUE) +# path :string +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid not null, indexed => [about_type] +# university_id :uuid not null, indexed +# website_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_permalinks_on_about (about_type,about_id) +# index_communication_website_permalinks_on_university_id (university_id) +# index_communication_website_permalinks_on_website_id (website_id) +# +# Foreign Keys +# +# fk_rails_e9646cce64 (university_id => universities.id) +# fk_rails_f389ba7d45 (website_id => communication_websites.id) +# class Communication::Website::Permalink::Publication < Communication::Website::Permalink def self.required_in_config?(website) website.connected_hal_publications.any? diff --git a/db/schema.rb b/db/schema.rb index aa152d1d0..414774df6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -105,8 +105,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_05_073214) do t.datetime "updated_at", null: false t.string "title" t.boolean "published", default: true - t.uuid "heading_id" t.uuid "communication_website_id" + t.uuid "heading_id" t.index ["about_type", "about_id"], name: "index_communication_website_blocks_on_about" t.index ["communication_website_id"], name: "index_communication_blocks_on_communication_website_id" t.index ["heading_id"], name: "index_communication_blocks_on_heading_id" @@ -223,6 +223,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_05_073214) do t.text "home_sentence" t.text "sass" t.text "css" + t.boolean "allow_experiences_modification", default: true t.index ["about_type", "about_id"], name: "index_communication_extranets_on_about" t.index ["university_id"], name: "index_communication_extranets_on_university_id" end @@ -461,7 +462,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_05_073214) do t.index ["university_id"], name: "index_communication_website_pages_on_university_id" end - create_table "communication_website_permalinks", id: :uuid, default: -> { "public.gen_random_uuid()" }, force: :cascade do |t| + create_table "communication_website_permalinks", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "university_id", null: false t.uuid "website_id", null: false t.string "about_type", null: false diff --git a/test/fixtures/communication/extranets.yml b/test/fixtures/communication/extranets.yml index c4a725645..5b00f559b 100644 --- a/test/fixtures/communication/extranets.yml +++ b/test/fixtures/communication/extranets.yml @@ -2,34 +2,35 @@ # # Table name: communication_extranets # -# id :uuid not null, primary key -# about_type :string indexed => [about_id] -# color :string -# cookies_policy :text -# css :text -# feature_alumni :boolean default(FALSE) -# feature_contacts :boolean default(FALSE) -# feature_jobs :boolean default(FALSE) -# feature_library :boolean default(FALSE) -# feature_posts :boolean default(FALSE) -# has_sso :boolean default(FALSE) -# home_sentence :text -# host :string -# name :string -# privacy_policy :text -# registration_contact :string -# sass :text -# sso_button_label :string -# sso_cert :text -# sso_mapping :jsonb -# sso_name_identifier_format :string -# sso_provider :integer default("saml") -# sso_target_url :string -# terms :text -# created_at :datetime not null -# updated_at :datetime not null -# about_id :uuid indexed => [about_type] -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# about_type :string indexed => [about_id] +# allow_experiences_modification :boolean default(TRUE) +# color :string +# cookies_policy :text +# css :text +# feature_alumni :boolean default(FALSE) +# feature_contacts :boolean default(FALSE) +# feature_jobs :boolean default(FALSE) +# feature_library :boolean default(FALSE) +# feature_posts :boolean default(FALSE) +# has_sso :boolean default(FALSE) +# home_sentence :text +# host :string +# name :string +# privacy_policy :text +# registration_contact :string +# sass :text +# sso_button_label :string +# sso_cert :text +# sso_mapping :jsonb +# sso_name_identifier_format :string +# sso_provider :integer default("saml") +# sso_target_url :string +# terms :text +# created_at :datetime not null +# updated_at :datetime not null +# about_id :uuid indexed => [about_type] +# university_id :uuid not null, indexed # # Indexes # -- GitLab