-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(deployments): create endpoint for recording deployments * test: update tests for version decorator and approvals * feat: support specifying an environment when calling the can-i-deploy and matrix endpoints * chore: made sure all db models are loaded * feat: support marking previously deployed version as not currently deployed * feat: add validation to ensure both tag and environment can't be used together to query the matrix * chore: update key name * chore: update deployed versions resource policy * feat: distinguish between "the" version in an environment and "one of the versions" in an environment in the matrix explanation messages * test: add tests to cover the 'multiple versions in an environment' use case * feat: add environments to index and matrix pages * style: reformatting
- Loading branch information
Showing
10 changed files
with
96 additions
and
10 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
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,37 @@ | ||
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 MatrixDeployedVersion | ||
include PactBroker::Api::PactBrokerUrls | ||
|
||
def initialize deployed_version | ||
@deployed_version = deployed_version | ||
end | ||
|
||
def environment_name | ||
deployed_version.environment.name | ||
end | ||
|
||
def tooltip | ||
"Currently deployed to #{deployed_version.environment.display_name} (#{relative_date(deployed_version.created_at)})" | ||
end | ||
|
||
def url | ||
hal_browser_url(deployed_version_url(deployed_version)) | ||
end | ||
|
||
private | ||
|
||
attr_reader :deployed_version | ||
|
||
def relative_date date | ||
DateHelper.distance_of_time_in_words(date, DateTime.now) + " ago" | ||
end | ||
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