-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only show the user the project directory levels that are visible to t…
…hem (#952) * Move access to project metadata to the project presenter instead of diging deep in the views Moves all access to the metadata_model instead of some through the model and some through the hash * Only showing the user the project directory visible to them fixes #941
- Loading branch information
1 parent
4a1fe82
commit 4010954
Showing
7 changed files
with
75 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
# frozen_string_literal: true | ||
class ProjectShowPresenter | ||
delegate "id", "in_mediaflux?", "mediaflux_id", "metadata", "metadata_model", "pending?", "project_directory", "status", "title", to: :project | ||
delegate "id", "in_mediaflux?", "mediaflux_id", "pending?", "status", "title", to: :project | ||
delegate "description", "project_id", "storage_capacity", "storage_performance_expectations", "project_purpose", to: :project_metadata | ||
|
||
attr_reader :project | ||
attr_reader :project, :project_metadata | ||
|
||
def initialize(project) | ||
@project = project | ||
@project_metadata = @project.metadata_model | ||
end | ||
|
||
# used to hide the project root that is not visible to the end user | ||
def project_directory | ||
project.project_directory.gsub(Mediaflux::Connection.hidden_root, "") | ||
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
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