Skip to content

Commit

Permalink
MappingBrowser: Make schemes clickable (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed May 31, 2019
1 parent 3203420 commit 3b76d4e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
35 changes: 31 additions & 4 deletions src/components/MappingBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,28 @@
class="button"
@click="showMappingsForConcordance(item.concordance)" />
</span>
<span
slot="from"
slot-scope="{ value }">
<item-name
:item="value"
:show-text="false"
:show-tooltip="true"
:is-link="value.__SAVED__ === true"
:is-left="true"
font-size="sm" />
</span>
<span
slot="to"
slot-scope="{ value }">
<item-name
:item="value"
:show-text="false"
:show-tooltip="true"
:is-link="value.__SAVED__"
:is-left="false"
font-size="sm" />
</span>
</flexible-table>
</div>
<div style="display: flex;">
Expand Down Expand Up @@ -320,6 +342,7 @@ import MappingBrowserTable from "./MappingBrowserTable"
import FlexibleTable from "vue-flexible-table"
import RegistryNotation from "./RegistryNotation"
import RegistryName from "./RegistryName"
import ItemName from "./ItemName"
import _ from "lodash"
// Only use for cancel token generation!
import axios from "axios"
Expand All @@ -331,7 +354,7 @@ import dragandrop from "../mixins/dragandrop"
export default {
name: "MappingBrowser",
components: { FlexibleTable, MappingBrowserTable, RegistryNotation, RegistryName },
components: { FlexibleTable, MappingBrowserTable, RegistryNotation, RegistryName, ItemName },
mixins: [auth, objects, dragandrop],
data() {
return {
Expand Down Expand Up @@ -452,14 +475,18 @@ export default {
let items = []
for (let concordance of this.concordances || []) {
let item = { concordance }
item.from = this.$util.notation(_.get(concordance, "fromScheme")) || "-"
item.to = this.$util.notation(_.get(concordance, "toScheme")) || "-"
item.from = _.get(concordance, "fromScheme")
item.from = this._getObject(item.from) || item.from
item.fromNotation = this.$util.notation(item.from) || "-"
item.to = _.get(concordance, "toScheme")
item.to = this._getObject(item.to) || item.to
item.toNotation = this.$util.notation(item.to) || "-"
item.description = _.get(concordance, "scopeNote.de[0]") || _.get(concordance, "scopeNote.en[0]") || "-"
item.creator = _.get(concordance, "creator[0].prefLabel.de") || _.get(concordance, "creator[0].prefLabel.en") || "-"
item.date = _.get(concordance, "modified") || _.get(concordance, "created") || ""
item.download = _.get(concordance, "distributions", [])
item.mappings = _.get(concordance, "extent")
if (item.from.toLowerCase().startsWith(this.concordanceFilter.from.toLowerCase()) && item.to.toLowerCase().startsWith(this.concordanceFilter.to.toLowerCase()) && item.creator.toLowerCase().startsWith(this.concordanceFilter.creator.toLowerCase())) {
if (item.fromNotation.toLowerCase().startsWith(this.concordanceFilter.from.toLowerCase()) && item.toNotation.toLowerCase().startsWith(this.concordanceFilter.to.toLowerCase()) && item.creator.toLowerCase().startsWith(this.concordanceFilter.creator.toLowerCase())) {
items.push(item)
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/MappingBrowserTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
:item="value"
:show-text="false"
:show-tooltip="true"
:is-link="true"
:is-left="true"
font-size="sm"
class="fontWeight-heavy" />
<!-- null means repeating scheme, undefined means no scheme -->
Expand Down Expand Up @@ -84,6 +86,8 @@
:item="value"
:show-text="false"
:show-tooltip="true"
:is-link="true"
:is-left="false"
font-size="sm"
class="fontWeight-heavy" />
<!-- null means repeating scheme, undefined means no scheme -->
Expand Down

0 comments on commit 3b76d4e

Please sign in to comment.