Skip to content

Commit

Permalink
Additional feed version display options
Browse files Browse the repository at this point in the history
  • Loading branch information
irees committed Apr 11, 2024
1 parent 2ab9ff1 commit a8d9cbe
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/runtime/components/feed-version-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
<table class="table is-striped is-fullwidth">
<thead>
<tr>
<th v-if="showDescriptionColumn">
Name
</th>
<th v-if="showDescriptionColumn">
Description
</th>
<th>Fetched</th>
<th>SHA1</th>
<th>Earliest date</th>
Expand All @@ -17,6 +23,12 @@
</thead>
<tbody>
<tr v-for="fv of entities" :key="fv.id">
<td v-if="showDescriptionColumn">
{{ fv.name }}
</td>
<td v-if="showDescriptionColumn">
{{ fv.description }}
</td>
<td>{{ $filters.formatDate(fv.fetched_at) }} ({{ $filters.fromNow(fv.fetched_at) }})</td>
<td>
<nuxt-link
Expand Down Expand Up @@ -88,6 +100,8 @@ query ($limit:Int=100, $onestop_id: String, $after:Int) {
entities: feed_versions(limit:$limit, after:$after, where: {feed_onestop_id: $onestop_id}) {
id
sha1
name
description
earliest_calendar_date
latest_calendar_date
fetched_at
Expand Down Expand Up @@ -118,6 +132,7 @@ export default {
props: {
feed: { type: Object, default () { return {} } },
showDownloadColumn: { type: Boolean, default: true },
showDescriptionColumn: { type: Boolean, default: true },
issueDownloadRequest: { type: Boolean, default: true }
},
emits: ['downloadTriggered'],
Expand Down
22 changes: 21 additions & 1 deletion src/runtime/components/pages/feed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,17 @@
{{ staticDescription }}
</div>
</slot>

<slot v-if="showAdmin" name="admin-details" :entity="entity">
<o-button class="is-pulled-right is-primary" @click="showAdminModal=true">
Show Feed Permissions
</o-button>
<tl-modal v-model="showAdminModal" title="Feed Permissions">
<tl-admin-feed
:id="entity.id"
/>
</tl-modal>
</slot>
</div>

<slot name="edit-feed" :entity="entity" />
Expand All @@ -219,7 +230,13 @@
Archived Feed Versions
</h4>

<tl-feed-version-table :feed="entity" :show-download-column="showDownloadColumn" :issue-download-request="issueDownloadRequest" @download-triggered="(sha1, isLatest) => $emit('downloadTriggered', sha1, isLatest)" />
<tl-feed-version-table
:feed="entity"
:show-download-column="showDownloadColumn"
:show-description-column="showDescriptionColumn"
:issue-download-request="issueDownloadRequest"
@download-triggered="(sha1, isLatest) => $emit('downloadTriggered', sha1, isLatest)"
/>
<slot name="add-feed-version" :entity="entity" />
</div>
</div>
Expand Down Expand Up @@ -339,14 +356,17 @@ export default {
}
},
props: {
showAdmin: { type: Boolean, default: true },
showDownloadColumn: { type: Boolean, default: true },
showDescriptionColumn: { type: Boolean, default: true },
issueDownloadRequest: { type: Boolean, default: true },
showOperators: { type: Boolean, default: true }
},
emits: ['downloadTriggered'],
data () {
return {
page: 1,
showAdminModal: false,
tabIndex: {
1: 'versions',
2: 'service'
Expand Down

0 comments on commit a8d9cbe

Please sign in to comment.