Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
LocoDelAssembly committed Aug 24, 2020
2 parents 8cad974 + d99be41 commit 70bb471
Show file tree
Hide file tree
Showing 54 changed files with 1,107 additions and 1,037 deletions.
33 changes: 32 additions & 1 deletion CHANGELOG.md
Expand Up @@ -9,6 +9,36 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv

\-

## [0.12.16] - 2020-08-24

### Added
- Highlight metadata that is not in this project in uniquify people task [#1648]
- Locks buttons on grid digitizer task [#1599]
- Option to export styled bibliography on filter sources task [#1652]
- Edit button in content section on radial object [#1670]

### Changed
- Drag button style on new taxon name [#1669]
- Removed SimpleMDE lib from ruby assets and added to npm dependencies
- Allow taxon name type relationships to be cited [#1667]

### Fixed
- BibTex html no longer escaped [#1657]
- Some of the elements of the form are not accessible on overflow. [#1661]
- Populate masculine, feminine and neuter on gender form [#1665]
- Markdown render on Browse OTU [#1671]

[#1599]: https://github.com/SpeciesFileGroup/taxonworks/issues/1599
[#1648]: https://github.com/SpeciesFileGroup/taxonworks/issues/1648
[#1652]: https://github.com/SpeciesFileGroup/taxonworks/issues/1652
[#1657]: https://github.com/SpeciesFileGroup/taxonworks/issues/1657
[#1661]: https://github.com/SpeciesFileGroup/taxonworks/issues/1661
[#1665]: https://github.com/SpeciesFileGroup/taxonworks/issues/1665
[#1667]: https://github.com/SpeciesFileGroup/taxonworks/issues/1667
[#1669]: https://github.com/SpeciesFileGroup/taxonworks/issues/1669
[#1670]: https://github.com/SpeciesFileGroup/taxonworks/issues/1670
[#1671]: https://github.com/SpeciesFileGroup/taxonworks/issues/1671

## [0.12.15] - 2020-08-18

### Fixed
Expand Down Expand Up @@ -343,7 +373,8 @@ This project <em>does not yet</em> adheres to [Semantic Versioning](https://semv

[#1532]: https://github.com/SpeciesFileGroup/taxonworks/issues/1532

[unreleased]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.15...development
[unreleased]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.16...development
[0.12.16]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.15...v0.12.16
[0.12.15]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.14...v0.12.15
[0.12.14]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.13...v0.12.14
[0.12.13]: https://github.com/SpeciesFileGroup/taxonworks/compare/v0.12.12...v0.12.13
Expand Down
15 changes: 0 additions & 15 deletions app/assets/javascripts/vendor/src/simplemde/simplemde.min.js

This file was deleted.

7 changes: 0 additions & 7 deletions app/assets/stylesheets/vendor/simplemde.min.scss

This file was deleted.

23 changes: 17 additions & 6 deletions app/controllers/sources_controller.rb
Expand Up @@ -53,7 +53,7 @@ def new
# POST /sources
# POST /sources.json
def create
@source = new_source
@source = new_source
respond_to do |format|
if @source&.save
format.html { redirect_to url_for(@source.metamorphosize),
Expand All @@ -80,6 +80,12 @@ def citation_object_types
.pluck(:citation_object_type).sort
end


# GET /sources/csl_types.json
def csl_types
render json: TaxonWorks::Vendor::BibtexRuby::CSL_STYLES
end

def parse
error_message = 'Unknown'

Expand Down Expand Up @@ -198,10 +204,15 @@ def download
end

# GET /sources/generate.json?<filter params>
def generate
def generate
sources = Queries::Source::Filter.new(filter_params).all.page(params[:page]).per(params[:per] || 2000)
@download = ::Export::Bibtex.download(sources, request.url, is_public: (params[:is_public] == 'true' ? true : false))
render '/downloads/show'
@download = ::Export::Bibtex.download(
sources,
request.url,
(params[:is_public] == 'true' ? true : false),
params[:style_id]
)
render '/downloads/show.json'
end

private
Expand Down Expand Up @@ -234,7 +245,7 @@ def filter_params
:per,
:project_id,
:query_term,
:recent,
:recent,
:roles,
:source_type,
:tags,
Expand Down Expand Up @@ -270,7 +281,7 @@ def source_params
:publisher, :school, :series, :title, :type, :volume, :doi,
:abstract, :copyright, :language, :stated_year, :verbatim,
:bibtex_type, :day, :year, :isbn, :issn, :verbatim_contents,
:verbatim_keywords, :language_id, :translator, :year_suffix, :url, :type,
:verbatim_keywords, :language_id, :translator, :year_suffix, :url, :type, :style_id,
roles_attributes: [
:id,
:_destroy,
Expand Down
6 changes: 5 additions & 1 deletion app/helpers/roles_helper.rb
Expand Up @@ -19,6 +19,10 @@ def role_link(role)
def role_object_tag(role)
return nil if role.nil?
[role.class.human_name, object_tag(role.role_object)].join(' of ').html_safe
end
end

def role_in_project?(role)
Role.exists?(project_id: sessions_current_project_id, id: role.id.to_param)
end

end
12 changes: 9 additions & 3 deletions app/helpers/taxon_names/catalog_helper.rb
Expand Up @@ -182,13 +182,19 @@ def history_in_taxon_name(t, c, i)

def history_type_material(entry_item)
return nil if entry_item.object_class != 'Protonym' || !entry_item.is_first # is_subsequent?

type_taxon_name_relationship = entry_item.base_object&.type_taxon_name_relationship

str = citations_tag(type_taxon_name_relationship) if type_taxon_name_relationship

[ content_tag(:span, ' '.html_safe + type_taxon_name_relationship_tag(entry_item.base_object.type_taxon_name_relationship), class: 'history__type_information'),

# citations_tag(entry_item.base_object&.type_taxon_name_relationship)
(entry_item.base_object&.type_taxon_name_relationship&.citations&.load&.any? ? (content_tag(:em, ' in ') + citations_tag(entry_item.base_object&.type_taxon_name_relationship)) : '')
# history_in(entry_item.base_object&.type_taxon_name_relationship&.source)
# (entry_item.base_object&.type_taxon_name_relationship&.citations&.load&.any? ? (content_tag(:em, ' in ') + citations_tag(entry_item.base_object&.type_taxon_name_relationship)) : '')
(type_taxon_name_relationship&.citations&.load&.any? ? (content_tag(:em, ' in ') +
link_to(content_tag(:span, str, title: type_taxon_name_relationship&.citations&.first&.source&.cached, class: 'history__pages'), send(:nomenclature_by_source_task_path, source_id: type_taxon_name_relationship&.citations&.first&.source&.id) ) ) : '')


# history_in(entry_item.base_object&.type_taxon_name_relationship&.source)
].compact.join.html_safe
end

Expand Down
20 changes: 6 additions & 14 deletions app/javascript/vue/components/markdown-editor.vue
Expand Up @@ -5,6 +5,10 @@
</template>

<script>
import SimpleMDE from 'simplemde'
import 'simplemde/dist/simplemde.min.css'
export default {
template: '',
props: {
Expand All @@ -18,10 +22,7 @@ export default {
},
configs: {
type: Object,
default () {
return {
}
}
default: () => {}
}
},
data: function () {
Expand All @@ -31,16 +32,12 @@ export default {
cursorPosition: 0
}
},
ready () {
this.initialize()
this.syncValue()
},
mounted () {
this.initialize()
},
methods: {
initialize () {
let configs = {}
const configs = {}
Object.assign(configs, this.configs)
configs.element = configs.element || this.$el.firstElementChild
configs.initialValue = configs.initialValue || this.value
Expand Down Expand Up @@ -81,11 +78,6 @@ export default {
wrapper.nextSibling.className += ` ${className}`
preview.className = `editor-preview ${className}`
wrapper.appendChild(preview)
},
syncValue () {
this.simplemde.codemirror.on('change', () => {
this.value = this.simplemde.value()
})
}
},
destroyed () {
Expand Down
Expand Up @@ -39,11 +39,16 @@
<table-list
:header="['Text', 'Topic', '']"
:attributes="['text', ['topic', 'name']]"
:list="list"
:list="shortList"
@delete="removeItem"
class="list"/>
class="list">
<template v-slot:options="slotProps">
<a
class="circle-button btn-edit"
:href="`/tasks/content/editor/index?otu_id=${slotProps.item.otu_id}&topic_id=${slotProps.item.topic_id}`"></a>
</template>
</table-list>
</div>

</template>

<script>
Expand All @@ -53,6 +58,7 @@ import annotatorExtend from '../../components/annotatorExtend.js'
import SmartSelector from 'components/switch.vue'
import TopicItem from '../citations/topicItem.vue'
import TableList from 'components/table_list.vue'
import { shorten } from 'helpers/strings.js'
export default {
mixins: [CRUD, annotatorExtend],
Expand All @@ -62,8 +68,14 @@ export default {
TableList
},
computed: {
validate() {
validate () {
return (this.content.text.length > 1 && this.content.topic_id != undefined)
},
shortList () {
return this.list.map(content => {
content.text = shorten(content.text, 150)
return content
})
}
},
data() {
Expand Down
4 changes: 3 additions & 1 deletion app/javascript/vue/components/table_list.vue
Expand Up @@ -20,6 +20,9 @@
v-html="getValue(item, attr)"/>
<td>
<div class="horizontal-right-content">
<slot
:item="item"
name="options"/>
<pdf-component
v-if="pdf"
:pdf="item.document"/>
Expand Down Expand Up @@ -136,7 +139,6 @@
.vue-table-container {
padding: 0px;
position: relative;
word-break: break-all;
}
.vue-table {
Expand Down
17 changes: 17 additions & 0 deletions app/javascript/vue/helpers/files.js
@@ -0,0 +1,17 @@
function downloadTextFile (text, fileType, fileName) {
var blob = new Blob([text], { type: fileType })

var a = document.createElement('a')
a.download = fileName
a.href = URL.createObjectURL(blob)
a.dataset.downloadurl = [fileType, a.download, a.href].join(':')
a.style.display = 'none'
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
setTimeout(() => { URL.revokeObjectURL(a.href) }, 1500)
}

export {
downloadTextFile
}

0 comments on commit 70bb471

Please sign in to comment.