- add name_type 'Personal' and 'Organizational' for persons table (change also user interfaces therefore)

- don't use node-sass anymore
npm updates
- composer updates
- laravel-mix now produces licence files for compiled javascripts
This commit is contained in:
Arno Kaimbacher 2020-10-22 16:36:43 +02:00
parent c649af199c
commit 5bbb3c5876
56 changed files with 17143 additions and 4395 deletions

View file

@ -114,6 +114,7 @@ export default class EditDataset extends Vue {
this.titleTypes = window.Laravel.titleTypes;
this.descriptionTypes = window.Laravel.descriptionTypes;
this.contributorTypes = window.Laravel.contributorTypes;
this.nameTypes = window.Laravel.nameTypes;
this.languages = window.Laravel.languages;
this.messages = window.Laravel.messages;
this.projects = window.Laravel.projects;

View file

@ -6,6 +6,7 @@ import { Component, Inject, Vue, Prop, Watch } from "vue-property-decorator";
import VueToast from "vue-toast-notification";
// import "vue-toast-notification/dist/index.css";
import 'vue-toast-notification/dist/theme-default.css';
import { ToastOptions } from "vue-toast-notification";
Vue.use(VueToast);
// import ToastedPlugin from 'vue-toasted';
@ -21,10 +22,11 @@ export default class LocationsMap extends Vue {
map = null;
drawnItems = null;
locationErrors: Array<any> = [];
options = {
theme: "bubble",
options: ToastOptions = {
// theme: "bubble",
position: "top-right",
duration: 3000
duration: 3000,
message: ""
};
created() {
@ -52,10 +54,12 @@ export default class LocationsMap extends Vue {
_this.drawnItems.addLayer(boundingBox);
_this.map.fitBounds(bounds);
this.options.message = "valid bounding box";
this.$toast.success("valid bounding box", this.options);
} catch (e) {
this.options.message = e.message;
// _this.errors.push(e);
this.$toast.error(e, this.options);
this.$toast.error(e.message, this.options);
}
}

View file

@ -16,6 +16,9 @@
class="far fa-lg fa-question-circle"></i>
</span>
</label>
</th>
<th scope="col" v-if="Object.keys(nametypes).length">
<span>Name Type</span>
</th>
<th scope="col" v-if="Object.keys(contributortypes).length">
<span>Type</span>
@ -52,6 +55,16 @@
placeholder="[ORCID]" v-model="item.identifier_orcid" v-bind:readonly="item.status==1"
data-vv-scope="step-1" />
</td>
<td v-if="Object.keys(nametypes).length">
<input v-if="item.status==1" readonly v-bind:name="heading+'['+index+'][name_type]'" class="form-control"
placeholder="[NAME_TYPE]" v-model="item.name_type" data-vv-scope="step-1" />
<select v-else type="text" v-bind:name="heading+'['+index+'][name_type]'" v-validate="{required: true}"
data-vv-scope="step-1" v-model="item.name_type">
<option v-for="(option, i) in nametypes" :value="option" :key="i">
{{ option }}
</option>
</select>
</td>
<td v-if="Object.keys(contributortypes).length">
<select type="text" v-bind:name="heading+'['+index+'][pivot][contributor_type]'" v-validate="{required: true}"
data-vv-scope="step-1" v-model="item.pivot.contributor_type">
@ -97,6 +110,8 @@
@Prop({ required: true, type: Array })
personlist;
@Prop({ default: {}, type: Object })
nametypes;
@Prop({ default: {}, type: Object })
contributortypes;
@Prop(Number)

View file

@ -93,6 +93,7 @@ const app = new Vue({
editLink: null,
releaseLink: null,
deleteLink: null,
nameTypes : [],
contributorTypes : [],
isModalVisible: false,
@ -154,7 +155,8 @@ const app = new Vue({
this.reset();
},
beforeMount() {
this.messages = window.Laravel.messages;
this.messages = window.Laravel.messages;
this.nameTypes = window.Laravel.nameTypes;
this.contributorTypes = window.Laravel.contributorTypes;
},
computed: {
@ -318,6 +320,7 @@ const app = new Vue({
formData.append('authors[' + i + '][email]', person.email);
formData.append('authors[' + i + '][identifier_orcid]', person.identifier_orcid);
formData.append('authors[' + i + '][status]', person.status);
formData.append('authors[' + i + '][name_type]', person.name_type);
if (person.id !== undefined) {
formData.append('authors[' + i + '][id]', person.id);
}
@ -334,6 +337,7 @@ const app = new Vue({
formData.append('contributors[' + i + '][identifier_orcid]', contributor.identifier_orcid);
formData.append('contributors[' + i + '][status]', contributor.status);
formData.append('contributors[' + i + '][pivot][contributor_type]', contributor.pivot.contributor_type);
formData.append('contributors[' + i + '][name_type]', contributor.name_type);
if (contributor.id !== undefined) {
formData.append('contributors[' + i + '][id]', contributor.id);
}
@ -517,7 +521,7 @@ const app = new Vue({
},
addNewAuthor() {
let newAuthor = { status: 0, first_name: '', last_name: '', email: '', academic_title: '', identifier_orcid: '' };
let newAuthor = { status: 0, first_name: '', last_name: '', email: '', academic_title: '', identifier_orcid: '', name_type: 'Personal' };
this.dataset.persons.push(newAuthor);
},
removeAuthor(key) {
@ -531,6 +535,7 @@ const app = new Vue({
} else if (this.dataset.contributors.filter(e => e.id === person.id).length > 0) {
this.$toast.error("person is already defined as contributor");
} else {
// person.pivot = { name_type: '' };
//person.sort_order = this.dataset.persons.length;
this.dataset.persons.push(person);
this.dataset.checkedAuthors.push(person.id);
@ -538,7 +543,7 @@ const app = new Vue({
}
},
addNewContributor() {
let newContributor = { status: 0, first_name: '', last_name: '', email: '', academic_title: '', identifier_orcid: '', pivot: { contributor_type: ''} };
let newContributor = { status: 0, first_name: '', last_name: '', email: '', academic_title: '', identifier_orcid: '', name_type: 'Personal', pivot: { contributor_type: ''} };
this.dataset.contributors.push(newContributor);
},
onAddContributor(person) {
@ -550,6 +555,7 @@ const app = new Vue({
this.$toast.error("person is already defined as author");
} else {
person.pivot = { contributor_type: '' };
// person.pivot = { name_type: '', contributor_type: '' };
this.dataset.contributors.push(person);
this.dataset.checkedContributors.push(person.id);
this.$toast.success("person has been successfully added as contributor");

View file

@ -289,7 +289,7 @@
</div>
<input name="persons" v-model="dataset.persons" type="hidden" class="form-check-input" v-validate="'required'"
data-vv-as="Creator" data-vv-scope="step-1">
<person-table name="persons" v-bind:messages="messages" v-bind:heading="'creator table'"
<person-table name="persons" v-bind:messages="messages" v-bind:nametypes="nameTypes" v-bind:heading="'creator table'"
v-bind:personlist="dataset.persons"></person-table>
</fieldset>
@ -320,7 +320,7 @@
<button class="pure-button button-small" @click.prevent="addNewContributor()">+</button>
</div>
{{-- <h3>contributor table</h3> --}}
<person-table name="contributors" v-bind:messages="messages" v-bind:contributortypes="contributorTypes" v-bind:heading="'contributor table'"
<person-table name="contributors" v-bind:messages="messages" v-bind:nametypes="nameTypes" v-bind:contributortypes="contributorTypes" v-bind:heading="'contributor table'"
v-bind:personlist="dataset.contributors"></person-table>
</fieldset>
@ -963,7 +963,9 @@
window.Laravel = <?php echo json_encode([
'languages' => $languages,
'messages' => $messages,
'contributorTypes' => $contributorTypes
'contributorTypes' => $contributorTypes,
'nameTypes' => $nameTypes,
]); ?>
</script>
<script type="text/javascript" src="{{ asset('backend/publish/datasetPublish.js') }}"></script>

View file

@ -77,8 +77,8 @@
</div>
<input name="authors" v-model="form.authors" type="hidden" class="form-check-input" v-validate="'required'"
data-vv-as="Author">
<person-table name="authors" v-bind:messages="messages" v-bind:heading="'authors'" v-bind:personlist="form.authors"></person-table>
<person-table name="contributors" v-bind:messages="messages" v-bind:contributortypes="contributorTypes" v-bind:heading="'contributors'" v-bind:personlist="form.contributors">
<person-table name="authors" v-bind:messages="messages" v-bind:nametypes="nameTypes" v-bind:heading="'authors'" v-bind:personlist="form.authors"></person-table>
<person-table name="contributors" v-bind:messages="messages" v-bind:nametypes="nameTypes" v-bind:contributortypes="contributorTypes" v-bind:heading="'contributors'" v-bind:personlist="form.contributors">
</person-table>
</fieldset>

View file

@ -55,6 +55,7 @@
'titleTypes' => $titleTypes,
'descriptionTypes' => $descriptionTypes,
'contributorTypes'=> $contributorTypes,
'nameTypes' => $nameTypes,
'languages' => $languages,
'messages' => $messages,
'projects' => $projects,

View file

@ -75,8 +75,8 @@
<button class="pure-button button-small" @click.prevent="addNewAuthor()">+</button> --}}
</div>
<input name="authors" v-model="form.authors" type="hidden" class="form-check-input" v-validate="'required'" data-vv-as="Author">
<person-table name="authors" v-bind:messages="messages" v-bind:show-heading="false" v-bind:heading="'authors'" v-bind:personlist="form.authors"></person-table>
<person-table name="contributors" v-bind:messages="messages" v-bind:contributortypes="contributorTypes" v-bind:heading="'contributors'" v-bind:personlist="form.contributors">
<person-table name="authors" v-bind:messages="messages" v-bind:nametypes="nameTypes" v-bind:show-heading="false" v-bind:heading="'authors'" v-bind:personlist="form.authors"></person-table>
<person-table name="contributors" v-bind:messages="messages" v-bind:nametypes="nameTypes" v-bind:contributortypes="contributorTypes" v-bind:heading="'contributors'" v-bind:personlist="form.contributors">
</person-table>
</fieldset>

View file

@ -66,6 +66,7 @@
'titleTypes' => $titleTypes,
'descriptionTypes' => $descriptionTypes,
'contributorTypes'=> $contributorTypes,
'nameTypes' => $nameTypes,
'languages' => $languages,
'messages' => $messages,
'projects' => $projects,