From b9768ef6cf8dec2b3e9e0533410d43797325b9ef Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 27 Nov 2017 12:40:08 +0200 Subject: [PATCH 1/9] Remove unused component --- static/css/directives/ui/tag-info-sidebar.css | 5 --- static/directives/tag-info-sidebar.html | 42 ------------------- static/js/directives/ui/tag-info-sidebar.js | 28 ------------- 3 files changed, 75 deletions(-) delete mode 100644 static/css/directives/ui/tag-info-sidebar.css delete mode 100644 static/directives/tag-info-sidebar.html delete mode 100644 static/js/directives/ui/tag-info-sidebar.js diff --git a/static/css/directives/ui/tag-info-sidebar.css b/static/css/directives/ui/tag-info-sidebar.css deleted file mode 100644 index 020625ad0..000000000 --- a/static/css/directives/ui/tag-info-sidebar.css +++ /dev/null @@ -1,5 +0,0 @@ -.tag-info-sidebar .control-bar { - padding-top: 10px; - margin-top: 10px; - border-top: 1px solid #eee; -} \ No newline at end of file diff --git a/static/directives/tag-info-sidebar.html b/static/directives/tag-info-sidebar.html deleted file mode 100644 index b4835359d..000000000 --- a/static/directives/tag-info-sidebar.html +++ /dev/null @@ -1,42 +0,0 @@ -
-
-
Last Modified
-
- -
Total Compressed Size
-
- - {{ tracker.getTotalSize(tag) | bytes }} - -
-
- - - -
- -
-
diff --git a/static/js/directives/ui/tag-info-sidebar.js b/static/js/directives/ui/tag-info-sidebar.js deleted file mode 100644 index 3e029e805..000000000 --- a/static/js/directives/ui/tag-info-sidebar.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * An element which displays sidebar information for a tag. Primarily used in the repo view. - */ -angular.module('quay').directive('tagInfoSidebar', function () { - var directiveDefinitionObject = { - priority: 0, - templateUrl: '/static/directives/tag-info-sidebar.html', - replace: false, - transclude: true, - restrict: 'C', - scope: { - 'tracker': '=tracker', - 'tag': '=tag', - - 'imageSelected': '&imageSelected', - 'deleteTagRequested': '&deleteTagRequested' - }, - controller: function($scope, $element) { - $scope.$watch('tag', function(tag) { - if (!tag || !$scope.tracker) { return; } - - $scope.tagImage = $scope.tracker.getImageForTag(tag); - $scope.tagData = $scope.tracker.lookupTag(tag); - }); - } - }; - return directiveDefinitionObject; -}); \ No newline at end of file From 33af54d355110fd25b0ebddacdb997b2f3bd7e9a Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 27 Nov 2017 12:40:58 +0200 Subject: [PATCH 2/9] Add a component to abstract out common handling of showing how long ago an event occurred --- .../directives/ui/time-ago/time-ago.component.html | 6 ++++++ .../js/directives/ui/time-ago/time-ago.component.ts | 13 +++++++++++++ static/js/quay.module.ts | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 static/js/directives/ui/time-ago/time-ago.component.html create mode 100644 static/js/directives/ui/time-ago/time-ago.component.ts diff --git a/static/js/directives/ui/time-ago/time-ago.component.html b/static/js/directives/ui/time-ago/time-ago.component.html new file mode 100644 index 000000000..a718716b2 --- /dev/null +++ b/static/js/directives/ui/time-ago/time-ago.component.html @@ -0,0 +1,6 @@ + + + + + Unknown + \ No newline at end of file diff --git a/static/js/directives/ui/time-ago/time-ago.component.ts b/static/js/directives/ui/time-ago/time-ago.component.ts new file mode 100644 index 000000000..528a98e22 --- /dev/null +++ b/static/js/directives/ui/time-ago/time-ago.component.ts @@ -0,0 +1,13 @@ +import { Input, Component } from 'ng-metadata/core'; + +/** + * A component that displays how long ago an event occurred, with associated + * tooltip showing the actual time. + */ +@Component({ + selector: 'timeAgo', + templateUrl: '/static/js/directives/ui/time-ago/time-ago.component.html' +}) +export class TimeAgoComponent { + @Input('<') public datetime: any; +} diff --git a/static/js/quay.module.ts b/static/js/quay.module.ts index 9eaa1683c..36b6913c9 100644 --- a/static/js/quay.module.ts +++ b/static/js/quay.module.ts @@ -37,6 +37,7 @@ import { ManageTriggerComponent } from './directives/ui/manage-trigger/manage-tr import { ClipboardCopyDirective } from './directives/ui/clipboard-copy/clipboard-copy.directive'; import { CorTabsModule } from './directives/ui/cor-tabs/cor-tabs.module'; import { TriggerDescriptionComponent } from './directives/ui/trigger-description/trigger-description.component'; +import { TimeAgoComponent } from './directives/ui/time-ago/time-ago.component'; import { MarkdownModule } from './directives/ui/markdown/markdown.module'; import * as Clipboard from 'clipboard'; @@ -79,6 +80,7 @@ import * as Clipboard from 'clipboard'; ExpirationStatusViewComponent, ClipboardCopyDirective, TriggerDescriptionComponent, + TimeAgoComponent, ], providers: [ ViewArrayImpl, From 2ea06d3df85b11a36c47a79fd9750213f42c7ea1 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 27 Nov 2017 12:41:19 +0200 Subject: [PATCH 3/9] Change all uses of am-time-ago to the component --- static/directives/build-info-bar.html | 2 +- static/directives/build-mini-status.html | 2 +- static/directives/build-status.html | 2 +- static/directives/config/config-license-field.html | 2 +- static/directives/repo-view/repo-panel-tags.html | 5 +---- static/directives/service-keys-manager.html | 4 ++-- static/directives/triggered-build-description.html | 2 +- static/js/directives/ui/app-public-view/last-modified.html | 4 +--- .../expiration-status-view.component.html | 4 ++-- .../ui/manage-trigger/manage-trigger.component.html | 2 +- static/partials/build-view.html | 2 +- static/partials/search.html | 2 +- static/partials/team-view.html | 2 +- 13 files changed, 15 insertions(+), 20 deletions(-) diff --git a/static/directives/build-info-bar.html b/static/directives/build-info-bar.html index a25a056c6..b3b9b8479 100644 --- a/static/directives/build-info-bar.html +++ b/static/directives/build-info-bar.html @@ -9,7 +9,7 @@
- +
diff --git a/static/directives/build-mini-status.html b/static/directives/build-mini-status.html index d1dda84cc..28242a090 100644 --- a/static/directives/build-mini-status.html +++ b/static/directives/build-mini-status.html @@ -5,7 +5,7 @@
- +
diff --git a/static/directives/build-status.html b/static/directives/build-status.html index 1ae92d29f..79f25459d 100644 --- a/static/directives/build-status.html +++ b/static/directives/build-status.html @@ -6,7 +6,7 @@
- Started: + Started:
diff --git a/static/directives/config/config-license-field.html b/static/directives/config/config-license-field.html index f414f2aa6..73ddc29fb 100644 --- a/static/directives/config/config-license-field.html +++ b/static/directives/config/config-license-field.html @@ -20,7 +20,7 @@ {{ status.requirement.count }} {{ status.entitlement.product_name }} {{ status.entitlement.count }} - + diff --git a/static/directives/repo-view/repo-panel-tags.html b/static/directives/repo-view/repo-panel-tags.html index aebd4b2be..cef474017 100644 --- a/static/directives/repo-view/repo-panel-tags.html +++ b/static/directives/repo-view/repo-panel-tags.html @@ -147,10 +147,7 @@ - - - - Unknown + diff --git a/static/directives/service-keys-manager.html b/static/directives/service-keys-manager.html index cfd82507f..b3278df69 100644 --- a/static/directives/service-keys-manager.html +++ b/static/directives/service-keys-manager.html @@ -110,12 +110,12 @@ - + - Automatically rotated + Automatically rotated diff --git a/static/directives/triggered-build-description.html b/static/directives/triggered-build-description.html index 4da1bd7fa..50199a292 100644 --- a/static/directives/triggered-build-description.html +++ b/static/directives/triggered-build-description.html @@ -40,7 +40,7 @@
Authored - + - - + \ No newline at end of file diff --git a/static/js/directives/ui/expiration-status-view/expiration-status-view.component.html b/static/js/directives/ui/expiration-status-view/expiration-status-view.component.html index 780381518..9bbab4263 100644 --- a/static/js/directives/ui/expiration-status-view/expiration-status-view.component.html +++ b/static/js/directives/ui/expiration-status-view/expiration-status-view.component.html @@ -1,7 +1,7 @@ - + - + diff --git a/static/js/directives/ui/manage-trigger/manage-trigger.component.html b/static/js/directives/ui/manage-trigger/manage-trigger.component.html index 517dc15fd..8da9e2b56 100644 --- a/static/js/directives/ui/manage-trigger/manage-trigger.component.html +++ b/static/js/directives/ui/manage-trigger/manage-trigger.component.html @@ -130,7 +130,7 @@ datafield="last_updated_datetime" templateurl="/static/js/directives/ui/manage-trigger-githost/repository-last-updated.html"> Build started - +
diff --git a/static/partials/search.html b/static/partials/search.html index c800736e3..2b4ecc666 100644 --- a/static/partials/search.html +++ b/static/partials/search.html @@ -29,7 +29,7 @@ first-line-only="true">

- Last Modified: + Last Modified: activity Last Updated: - at {{ syncInfo.last_updated | amDateFormat:'dddd, MMMM Do YYYY, h:mm:ss a' }} + Never From 7d55ff9c67d6bc8180315446098d6ef4eedb67fe Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 27 Nov 2017 12:56:06 +0200 Subject: [PATCH 4/9] Add a component for better display of time --- .../ui/time-display/time-display.component.html | 1 + .../ui/time-display/time-display.component.ts | 12 ++++++++++++ static/js/quay.module.ts | 2 ++ 3 files changed, 15 insertions(+) create mode 100644 static/js/directives/ui/time-display/time-display.component.html create mode 100644 static/js/directives/ui/time-display/time-display.component.ts diff --git a/static/js/directives/ui/time-display/time-display.component.html b/static/js/directives/ui/time-display/time-display.component.html new file mode 100644 index 000000000..d209651d4 --- /dev/null +++ b/static/js/directives/ui/time-display/time-display.component.html @@ -0,0 +1 @@ +{{ ::$ctrl.datetime | amDateFormat:'dddd, MMMM Do YYYY, h:mm A' }} \ No newline at end of file diff --git a/static/js/directives/ui/time-display/time-display.component.ts b/static/js/directives/ui/time-display/time-display.component.ts new file mode 100644 index 000000000..f3c513532 --- /dev/null +++ b/static/js/directives/ui/time-display/time-display.component.ts @@ -0,0 +1,12 @@ +import { Input, Component } from 'ng-metadata/core'; + +/** + * A component that displays when an event occurred. + */ +@Component({ + selector: 'timeDisplay', + templateUrl: '/static/js/directives/ui/time-display/time-display.component.html' +}) +export class TimeDisplayComponent { + @Input('<') public datetime: any; +} diff --git a/static/js/quay.module.ts b/static/js/quay.module.ts index 36b6913c9..f47094cc3 100644 --- a/static/js/quay.module.ts +++ b/static/js/quay.module.ts @@ -38,6 +38,7 @@ import { ClipboardCopyDirective } from './directives/ui/clipboard-copy/clipboard import { CorTabsModule } from './directives/ui/cor-tabs/cor-tabs.module'; import { TriggerDescriptionComponent } from './directives/ui/trigger-description/trigger-description.component'; import { TimeAgoComponent } from './directives/ui/time-ago/time-ago.component'; +import { TimeDisplayComponent } from './directives/ui/time-display/time-display.component'; import { MarkdownModule } from './directives/ui/markdown/markdown.module'; import * as Clipboard from 'clipboard'; @@ -81,6 +82,7 @@ import * as Clipboard from 'clipboard'; ClipboardCopyDirective, TriggerDescriptionComponent, TimeAgoComponent, + TimeDisplayComponent, ], providers: [ ViewArrayImpl, From 89d635f6cfb64147dd4e9eb7e24c513fd86fa446 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 27 Nov 2017 12:56:26 +0200 Subject: [PATCH 5/9] Change to use the component --- static/directives/quay-service-status-bar.html | 2 +- static/directives/repo-tag-history.html | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/static/directives/quay-service-status-bar.html b/static/directives/quay-service-status-bar.html index 84c3e0671..25cfdce50 100644 --- a/static/directives/quay-service-status-bar.html +++ b/static/directives/quay-service-status-bar.html @@ -10,7 +10,7 @@ - Scheduled for {{ scheduled.scheduled_for | amDateFormat:'dddd, MMMM Do YYYY, h:mm A' }}: + Scheduled for : In progress: diff --git a/static/directives/repo-tag-history.html b/static/directives/repo-tag-history.html index ba756f26a..5c9a46da2 100644 --- a/static/directives/repo-tag-history.html +++ b/static/directives/repo-tag-history.html @@ -73,10 +73,14 @@ -

{{ entry.time | amDateFormat:'dddd, MMMM Do YYYY, h:mm:ss a' }}
+
+ +
-
{{ entry.time | amDateFormat:'MMM Do YYYY, h:mm:ss a' }}
+
+ +
From b5b4aa154c14952f2459a483502c99df9b55ab7b Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 27 Nov 2017 13:08:38 +0200 Subject: [PATCH 6/9] Add support for date-only to the time-display component --- static/directives/repo-tag-history.html | 2 +- .../ui/time-display/time-display.component.html | 2 +- .../directives/ui/time-display/time-display.component.ts | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/static/directives/repo-tag-history.html b/static/directives/repo-tag-history.html index 5c9a46da2..baf651650 100644 --- a/static/directives/repo-tag-history.html +++ b/static/directives/repo-tag-history.html @@ -26,7 +26,7 @@ - {{ entry.date | amDateFormat:'dddd, MMMM Do YYYY' }} + diff --git a/static/js/directives/ui/time-display/time-display.component.html b/static/js/directives/ui/time-display/time-display.component.html index d209651d4..b88a23910 100644 --- a/static/js/directives/ui/time-display/time-display.component.html +++ b/static/js/directives/ui/time-display/time-display.component.html @@ -1 +1 @@ -{{ ::$ctrl.datetime | amDateFormat:'dddd, MMMM Do YYYY, h:mm A' }} \ No newline at end of file +{{ ::$ctrl.datetime | amDateFormat:$ctrl.getFormat($ctrl.dateOnly) }} \ No newline at end of file diff --git a/static/js/directives/ui/time-display/time-display.component.ts b/static/js/directives/ui/time-display/time-display.component.ts index f3c513532..68dacf388 100644 --- a/static/js/directives/ui/time-display/time-display.component.ts +++ b/static/js/directives/ui/time-display/time-display.component.ts @@ -9,4 +9,13 @@ import { Input, Component } from 'ng-metadata/core'; }) export class TimeDisplayComponent { @Input('<') public datetime: any; + @Input('<') public dateOnly: boolean; + + private getFormat(dateOnly: boolean): string { + if (dateOnly) { + return 'dddd, MMMM Do YYYY'; + } + + return 'dddd, MMMM Do YYYY, h:mm A'; + } } From 110fac19026b0095816ecaa427b78a23a8ff9a59 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 27 Nov 2017 13:19:18 +0200 Subject: [PATCH 7/9] Switch logs view to use component --- static/directives/logs-view.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/directives/logs-view.html b/static/directives/logs-view.html index 977100498..a56006885 100644 --- a/static/directives/logs-view.html +++ b/static/directives/logs-view.html @@ -62,7 +62,7 @@ - +
From db53f82a347e59bcf1f493b90495d420cb782924 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 27 Nov 2017 13:19:26 +0200 Subject: [PATCH 8/9] Shorten the default date/times shown --- .../js/directives/ui/time-display/time-display.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/directives/ui/time-display/time-display.component.ts b/static/js/directives/ui/time-display/time-display.component.ts index 68dacf388..86bad99d6 100644 --- a/static/js/directives/ui/time-display/time-display.component.ts +++ b/static/js/directives/ui/time-display/time-display.component.ts @@ -13,9 +13,9 @@ export class TimeDisplayComponent { private getFormat(dateOnly: boolean): string { if (dateOnly) { - return 'dddd, MMMM Do YYYY'; + return 'ddd, MMM Do YYYY'; } - return 'dddd, MMMM Do YYYY, h:mm A'; + return 'ddd, MMM Do YYYY, h:mm A'; } } From 49dff5729c792aa0acf07fe0116f0a7ea7ee2840 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 27 Nov 2017 16:03:54 +0200 Subject: [PATCH 9/9] Switch time display components to use locale-aware format strings --- static/js/directives/ui/time-ago/time-ago.component.html | 2 +- .../js/directives/ui/time-display/time-display.component.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/js/directives/ui/time-ago/time-ago.component.html b/static/js/directives/ui/time-ago/time-ago.component.html index a718716b2..0748eee21 100644 --- a/static/js/directives/ui/time-ago/time-ago.component.html +++ b/static/js/directives/ui/time-ago/time-ago.component.html @@ -1,5 +1,5 @@ - + Unknown diff --git a/static/js/directives/ui/time-display/time-display.component.ts b/static/js/directives/ui/time-display/time-display.component.ts index 86bad99d6..fd80c35ce 100644 --- a/static/js/directives/ui/time-display/time-display.component.ts +++ b/static/js/directives/ui/time-display/time-display.component.ts @@ -13,9 +13,9 @@ export class TimeDisplayComponent { private getFormat(dateOnly: boolean): string { if (dateOnly) { - return 'ddd, MMM Do YYYY'; + return 'll'; } - return 'ddd, MMM Do YYYY, h:mm A'; + return 'llll'; } }