Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
3d35a1a7
Commit
3d35a1a7
authored
3 years ago
by
pabois
Browse files
Options
Downloads
Patches
Plain Diff
git_dependencies
parent
f24bd77b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/communication/website.rb
+18
-37
18 additions, 37 deletions
app/models/communication/website.rb
app/models/research/journal.rb
+1
-3
1 addition, 3 deletions
app/models/research/journal.rb
with
19 additions
and
40 deletions
app/models/communication/website.rb
+
18
−
37
View file @
3d35a1a7
...
...
@@ -51,47 +51,28 @@ class Communication::Website < ApplicationRecord
"data/website.yml"
end
def
git_dependencies
(
website
)
dependencies
=
(
[
self
,
config_permalinks
,
config_base_url
]
+
pages
+
pages
.
map
(
&
:active_storage_blobs
).
flatten
+
posts
+
posts
.
map
(
&
:active_storage_blobs
).
flatten
+
[
index_for
(
:home
)]
+
index_for
(
:home
).
active_storage_blobs
+
[
index_for
(
:communication_posts
)]
+
index_for
(
:communication_posts
).
active_storage_blobs
+
[
index_for
(
:persons
)]
+
index_for
(
:persons
).
active_storage_blobs
+
[
index_for
(
:authors
)]
+
index_for
(
:authors
).
active_storage_blobs
+
people_with_facets
+
people
.
map
(
&
:active_storage_blobs
).
flatten
+
categories
+
menus
+
[
about
]
)
dependencies
=
[
self
,
config_permalinks
,
config_base_url
]
+
menus
dependencies
+=
pages
+
pages
.
map
(
&
:active_storage_blobs
).
flatten
dependencies
+=
posts
+
posts
.
map
(
&
:active_storage_blobs
).
flatten
if
has_communication_posts?
dependencies
+=
people_with_facets
+
people
.
map
(
&
:active_storage_blobs
).
flatten
if
has_people?
dependencies
+=
[
categories
]
if
has_communication_categories?
dependencies
+=
about
.
git_dependencies
if
about
.
is_a?
Education
::
School
dependencies
<<
index_for
(
:education_programs
)
dependencies
+=
index_for
(
:education_programs
).
active_storage_blobs
dependencies
+=
about
.
programs
dependencies
+=
about
.
programs
.
map
(
&
:active_storage_blobs
).
flatten
dependencies
<<
index_for
(
:administrators
)
dependencies
+=
index_for
(
:administrators
).
active_storage_blobs
dependencies
<<
index_for
(
:teachers
)
dependencies
+=
index_for
(
:teachers
).
active_storage_blobs
elsif
about
.
is_a?
Research
::
Journal
dependencies
<<
index_for
(
:research_volumes
)
dependencies
+=
index_for
(
:research_volumes
).
active_storage_blobs
dependencies
+=
about
.
volumes
dependencies
+=
about
.
volumes
.
map
(
&
:active_storage_blobs
).
flatten
dependencies
<<
index_for
(
:research_articles
)
dependencies
+=
index_for
(
:research_articles
).
active_storage_blobs
dependencies
+=
about
.
articles
dependencies
+=
about
.
articles
.
map
(
&
:active_storage_blobs
).
flatten
dependencies
<<
index_for
(
:researchers
)
dependencies
+=
index_for
(
:researchers
).
active_storage_blobs
end
# TMP: add index_pages
dependencies
+=
[
index_for
(
:home
)]
+
index_for
(
:home
).
active_storage_blobs
dependencies
+=
[
index_for
(
:communication_posts
)]
+
index_for
(
:communication_posts
).
active_storage_blobs
if
has_communication_posts?
dependencies
+=
[
index_for
(
:education_programs
)]
+
index_for
(
:education_programs
).
active_storage_blobs
if
has_education_programs?
dependencies
+=
[
index_for
(
:persons
)]
+
index_for
(
:persons
).
active_storage_blobs
if
has_people?
dependencies
+=
[
index_for
(
:authors
)]
+
index_for
(
:authors
).
active_storage_blobs
if
has_authors?
dependencies
+=
[
index_for
(
:administrators
)]
+
index_for
(
:administrators
).
active_storage_blobs
if
has_administrators?
dependencies
+=
[
index_for
(
:teachers
)]
+
index_for
(
:teachers
).
active_storage_blobs
if
has_teachers?
dependencies
+=
[
index_for
(
:research_volumes
)]
+
index_for
(
:research_volumes
).
active_storage_blobs
if
has_research_volumes?
dependencies
+=
[
index_for
(
:research_articles
)]
+
index_for
(
:research_articles
).
active_storage_blobs
if
has_research_articles?
dependencies
+=
[
index_for
(
:researchers
)]
+
index_for
(
:researchers
).
active_storage_blobs
if
has_researchers?
# END TMP
dependencies
end
end
This diff is collapsed.
Click to expand it.
app/models/research/journal.rb
+
1
−
3
View file @
3d35a1a7
...
...
@@ -45,9 +45,7 @@ class Research::Journal < ApplicationRecord
dependencies
=
[
self
]
dependencies
+=
articles
+
articles
.
map
(
&
:active_storage_blobs
).
flatten
if
has_research_articles?
dependencies
+=
volumes
+
volumes
.
map
(
&
:active_storage_blobs
).
flatten
if
has_research_volumes?
if
has_researchers?
dependencies
+=
people
+
people
.
map
(
&
:researcher
)
+
people
.
map
(
&
:active_storage_blobs
).
flatten
end
dependencies
+=
people
+
people
.
map
(
&
:researcher
)
+
people
.
map
(
&
:active_storage_blobs
).
flatten
if
has_researchers?
dependencies
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment