-
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dashboard): show tooltip explaining auto created branches
- Loading branch information
Showing
8 changed files
with
123 additions
and
9 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
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,39 @@ | ||
require "pact_broker/api/pact_broker_urls" | ||
require "pact_broker/ui/helpers/url_helper" | ||
require "pact_broker/date_helper" | ||
|
||
module PactBroker | ||
module UI | ||
module ViewDomain | ||
class IndexItemBranchHead | ||
|
||
include PactBroker::Api::PactBrokerUrls | ||
|
||
def initialize branch_head, pacticipant_name | ||
@branch_head = branch_head | ||
@pacticipant_name = pacticipant_name | ||
end | ||
|
||
def branch_name | ||
branch_head.branch_name | ||
end | ||
|
||
def tooltip | ||
if branch_head.branch_version.auto_created | ||
"This is the latest pact from branch \"#{branch_name}\". This branch was automatically inferred from the first tag because the Pact Broker configuration setting `use_first_tag_as_branch` was true." | ||
else | ||
"This is the latest pact from branch \"#{branch_name}\"." | ||
end | ||
end | ||
|
||
def latest? | ||
true | ||
end | ||
|
||
private | ||
|
||
attr_reader :branch_head, :pacticipant_name | ||
end | ||
end | ||
end | ||
end |
39 changes: 39 additions & 0 deletions
39
lib/pact_broker/ui/view_models/index_item_provider_branch_head.rb
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,39 @@ | ||
require "pact_broker/api/pact_broker_urls" | ||
require "pact_broker/ui/helpers/url_helper" | ||
require "pact_broker/date_helper" | ||
|
||
module PactBroker | ||
module UI | ||
module ViewDomain | ||
class IndexItemProviderBranchHead | ||
|
||
include PactBroker::Api::PactBrokerUrls | ||
|
||
def initialize branch_head, pacticipant_name | ||
@branch_head = branch_head | ||
@pacticipant_name = pacticipant_name | ||
end | ||
|
||
def branch_name | ||
branch_head.branch_name | ||
end | ||
|
||
def tooltip | ||
if branch_head.branch_version.auto_created | ||
"The latest verification is from branch \"#{branch_name}\". This branch was automatically inferred from the first tag because the Pact Broker configuration setting `use_first_tag_as_branch` was true." | ||
else | ||
"The latest verification is from branch \"#{branch_name}\"." | ||
end | ||
end | ||
|
||
def latest? | ||
true | ||
end | ||
|
||
private | ||
|
||
attr_reader :branch_head, :pacticipant_name | ||
end | ||
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