- unique keywords
- Dataset.ts formatting - composer file without composer dependencies
This commit is contained in:
parent
faa68cc223
commit
e2c131edd1
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -25,6 +25,7 @@ desktop.ini
|
||||||
|
|
||||||
/.idea
|
/.idea
|
||||||
/.vscode
|
/.vscode
|
||||||
|
/.vs
|
||||||
/.vagrant
|
/.vagrant
|
||||||
Homestead.json
|
Homestead.json
|
||||||
Homestead.yaml
|
Homestead.yaml
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
"zizaco/entrust": "^1.9"
|
"zizaco/entrust": "^1.9"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"composer/composer": "^1.9",
|
|
||||||
"fzaninotto/faker": "^1.8",
|
"fzaninotto/faker": "^1.8",
|
||||||
"phpunit/phpunit": "^7.0",
|
"phpunit/phpunit": "^7.0",
|
||||||
"squizlabs/php_codesniffer": "^3.4"
|
"squizlabs/php_codesniffer": "^3.4"
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -65,21 +65,21 @@ export default class Dataset extends Vue {
|
||||||
// return initialState();
|
// return initialState();
|
||||||
// }
|
// }
|
||||||
initialState = {};
|
initialState = {};
|
||||||
type= "";
|
type = "";
|
||||||
state= "";
|
state = "";
|
||||||
rights= null;
|
rights = null;
|
||||||
project_id= "";
|
project_id = "";
|
||||||
|
|
||||||
creating_corporation= "TETHYS Repository";
|
creating_corporation = "TETHYS Repository";
|
||||||
language= "";
|
language = "";
|
||||||
embargo_date= "";
|
embargo_date = "";
|
||||||
belongs_to_bibliography= 0;
|
belongs_to_bibliography = 0;
|
||||||
|
|
||||||
title_main= {
|
title_main = {
|
||||||
value: "",
|
value: "",
|
||||||
language: ""
|
language: ""
|
||||||
};
|
};
|
||||||
abstract_main= {
|
abstract_main = {
|
||||||
value: "",
|
value: "",
|
||||||
language: ""
|
language: ""
|
||||||
};
|
};
|
||||||
|
@ -89,7 +89,7 @@ export default class Dataset extends Vue {
|
||||||
// xmax: "",
|
// xmax: "",
|
||||||
// ymax: ""
|
// ymax: ""
|
||||||
// },
|
// },
|
||||||
coverage= {
|
coverage = {
|
||||||
xmin: "",
|
xmin: "",
|
||||||
ymin: "",
|
ymin: "",
|
||||||
xmax: "",
|
xmax: "",
|
||||||
|
@ -104,21 +104,21 @@ export default class Dataset extends Vue {
|
||||||
time_max: "",
|
time_max: "",
|
||||||
time_absolut: ""
|
time_absolut: ""
|
||||||
};
|
};
|
||||||
checkedAuthors= [];
|
checkedAuthors = [];
|
||||||
checkedLicenses= [];
|
checkedLicenses = [];
|
||||||
files= [];
|
files = [];
|
||||||
keywords= [];
|
keywords = [];
|
||||||
references= [];
|
references = [];
|
||||||
titles= [];
|
titles = [];
|
||||||
descriptions= [];
|
descriptions = [];
|
||||||
checkedContributors= [];
|
checkedContributors = [];
|
||||||
// checkedSubmitters: [],
|
// checkedSubmitters: [],
|
||||||
|
|
||||||
persons= [];
|
persons = [];
|
||||||
contributors= [];
|
contributors = [];
|
||||||
// submitters: []
|
// submitters: []
|
||||||
|
|
||||||
created () {
|
created() {
|
||||||
this.initialState = Object.assign({}, this);
|
this.initialState = Object.assign({}, this);
|
||||||
// let json = JSON.stringify(this.$data);
|
// let json = JSON.stringify(this.$data);
|
||||||
// this.reset = () => {
|
// this.reset = () => {
|
||||||
|
|
|
@ -122,6 +122,26 @@ const app = new Vue({
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const isUnique = (value, [objectArray, index]) =>
|
||||||
|
new Promise(resolve => {
|
||||||
|
setTimeout(() => {
|
||||||
|
if (objectArray.some((item, i) => item.value === value && index !== i)) {
|
||||||
|
return resolve({
|
||||||
|
valid: false,
|
||||||
|
data: {
|
||||||
|
message: value + ' is already taken.'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return resolve({
|
||||||
|
valid: true
|
||||||
|
});
|
||||||
|
}, 200);
|
||||||
|
});
|
||||||
|
VeeValidate.Validator.extend("unique", {
|
||||||
|
getMessage: (field, params, data) => field + ' ' + data.message,
|
||||||
|
validate: isUnique,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
//this.step = 2;
|
//this.step = 2;
|
||||||
|
|
|
@ -526,7 +526,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item, index) in dataset.keywords">
|
<tr v-for="(item, index) in dataset.keywords">
|
||||||
<td>
|
<td>
|
||||||
<input name="Keyword Value" class="form-control" placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="'required'"
|
<input name="Keyword Value" class="form-control" placeholder="[KEYWORD VALUE]" v-model="item.value" v-validate="{required: true, unique: [dataset.keywords, index]}"
|
||||||
data-vv-scope="step-2" />
|
data-vv-scope="step-2" />
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user