Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing the deprecated Primer::TimeAgoComponent #1792

Merged
merged 5 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/strong-kangaroos-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/view-components": patch
---

Removing the deprecated Primer::TimeAgoComponent
2 changes: 1 addition & 1 deletion app/components/primer/primer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import './alpha/tool_tip'
import './alpha/x_banner'
import './beta/auto_complete/auto_complete'
import './beta/clipboard_copy'
import './beta/relative_time'
import './alpha/tab_container'
import './time_ago_component'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keithamus I removed this import and realized that we weren't including the relative-time component anywhere so I added ./beta/relative_time which does the same import as before.

import '../../../lib/primer/forms/primer_multi_input'
import '../../../lib/primer/forms/primer_text_field'
import '../../../lib/primer/forms/toggle_switch_input'
51 changes: 0 additions & 51 deletions app/components/primer/time_ago_component.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/lib/primer/view_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class ViewHelperNotFound < StandardError; end
HELPERS = {
octicon: "Primer::Beta::Octicon",
heading: "Primer::Beta::Heading",
time_ago: "Primer::TimeAgoComponent",
image: "Primer::Alpha::Image"
}.freeze

Expand Down
2 changes: 0 additions & 2 deletions docs/src/@primer/gatsby-theme-doctocat/nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@
url: "/components/button"
- title: IconButton
url: "/components/iconbutton"
- title: TimeAgo
url: "/components/timeago"
- title: Tooltip
url: "/components/tooltip"
- title: Architecture decisions
Expand Down
5 changes: 0 additions & 5 deletions lib/primer/deprecations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ deprecations:
autocorrect: true
replacement: "Primer::Beta::IconButton"

- component: "Primer::TimeAgoComponent"
autocorrect: false
replacement: "Primer::Beta::RelativeTime"
guide: "https://primer.style/view-components/guides/primer_time_ago"

- component: "Primer::Tooltip"
autocorrect: true
replacement: "Primer::Alpha::Tooltip"
1 change: 0 additions & 1 deletion lib/primer/yard/component_manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class ComponentManifest
Primer::Beta::Subhead => {},
Primer::Alpha::TabContainer => { js: true },
Primer::Beta::Text => {},
Primer::TimeAgoComponent => { js: true },
Primer::Beta::TimelineItem => {},
Primer::Tooltip => {},
Primer::Truncate => {},
Expand Down
27 changes: 0 additions & 27 deletions previews/primer/time_ago_component_preview.rb

This file was deleted.

26 changes: 0 additions & 26 deletions static/arguments.json
Original file line number Diff line number Diff line change
Expand Up @@ -2375,32 +2375,6 @@
}
]
},
{
"component": "TimeAgo",
"status": "deprecated",
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/time_ago_component.rb",
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/time_ago/default/",
"parameters": [
{
"name": "time",
"type": "Time",
"default": "N/A",
"description": "The time to be formatted"
},
{
"name": "micro",
"type": "Boolean",
"default": "`false`",
"description": "If true then the text will be formatted in \"micro\" mode, using as few characters as possible"
},
{
"name": "system_arguments",
"type": "Hash",
"default": "N/A",
"description": "[System arguments](/system-arguments)"
}
]
},
{
"component": "Tooltip",
"status": "deprecated",
Expand Down
1 change: 0 additions & 1 deletion static/audited_at.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"Primer::IconButton": "",
"Primer::LayoutComponent": "",
"Primer::Navigation::TabComponent": "",
"Primer::TimeAgoComponent": "",
"Primer::Tooltip": "",
"Primer::Truncate": ""
}
2 changes: 0 additions & 2 deletions static/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,6 @@
],
"DEFAULT_ARIA_CURRENT_FOR_ANCHOR": "page"
},
"Primer::TimeAgoComponent": {
},
"Primer::Tooltip": {
"ALIGN_DEFAULT": "default",
"ALIGN_MAPPING": {
Expand Down
1 change: 0 additions & 1 deletion static/statuses.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"Primer::IconButton": "deprecated",
"Primer::LayoutComponent": "alpha",
"Primer::Navigation::TabComponent": "alpha",
"Primer::TimeAgoComponent": "deprecated",
"Primer::Tooltip": "deprecated",
"Primer::Truncate": "beta"
}
1 change: 0 additions & 1 deletion test/components/component_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class PrimerComponentTest < Minitest::Test
[Primer::Beta::Text, {}],
[Primer::Truncate, {}],
[Primer::Beta::Truncate, {}, proc { |component| component.with_item { "Foo" } }],
[Primer::TimeAgoComponent, { time: Time.zone.now }],
[Primer::Beta::TimelineItem, {}, proc { |component| component.with_body { "Foo" } }],
[Primer::Tooltip, { label: "More" }],
[Primer::Alpha::UnderlineNav, { label: "aria label" }, proc { |component| component.with_tab(selected: true) { "Foo" } }],
Expand Down
60 changes: 0 additions & 60 deletions test/components/time_ago_component_test.rb

This file was deleted.

6 changes: 0 additions & 6 deletions test/lib/primer/view_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ def test_renders_heading_using_shorthand
assert_selector("h2", text: "My Heading")
end

def test_renders_time_ago_using_shorthand
primer_time_ago(time: Time.at(1_615_490_863).utc)

assert_selector("relative-time", text: "Mar 11, 2021")
end

def test_renders_octicon_using_shorthand
primer_octicon icon: :star

Expand Down
17 changes: 0 additions & 17 deletions test/system/time_ago_component_test.rb

This file was deleted.