-
Notifications
You must be signed in to change notification settings - Fork 1
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 #61 from anyone-oslo/react-page-form
Rewrite Page form in React
- Loading branch information
Showing
98 changed files
with
2,571 additions
and
1,360 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
module PagesCore | ||
module PageParameters | ||
extend ActiveSupport::Concern | ||
|
||
def page_attachment_attributes | ||
{ page_images_attributes: %i[id position image_id primary _destroy], | ||
page_files_attributes: %i[id position attachment_id _destroy] } | ||
end | ||
|
||
def page_content_attributes | ||
locales = PagesCore.config.locales&.keys || [I18n.default_locale] | ||
[page_static_attributes, | ||
PagesCore::Templates::TemplateConfiguration.all_blocks, | ||
:path_segment, | ||
(PagesCore::Templates::TemplateConfiguration | ||
.localized_blocks + %i[path_segment]) | ||
.index_with { locales }, | ||
page_attachment_attributes] | ||
end | ||
|
||
def page_static_attributes | ||
%i[template user_id status feed_enabled published_at redirect_to | ||
news_page unique_name pinned parent_page_id serialized_tags | ||
meta_image_id starts_at ends_at all_day] | ||
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
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
Oops, something went wrong.