Merge remote-tracking branch 'origin/developer' into developer

# Conflicts:
#	public/routes/createMessage.js
#	public/routes/files.js
This commit is contained in:
Edwina Barbalan
2019-07-22 16:51:34 +02:00
8 changed files with 44 additions and 45 deletions
+23 -22
View File
@@ -1,9 +1,4 @@
var tagArray = [];
const data=[
'th',
'efi',
'wichtig',
];
const CreateMsgRouter = {
template: `
<div class="content">
@@ -22,12 +17,12 @@ const CreateMsgRouter = {
<b-taginput
id="tag"
v-model="selected"
:data=taglist
:data="filteredDataArray"
autocomplete
allow-new:false
icon="label"
placeholder="#"
@typing="getFilteredTags"
@input="saveTagsToArray">
</b-taginput>
</b-field>
@@ -47,9 +42,20 @@ const CreateMsgRouter = {
auth: auth,
isDisabled: false,
selected: [],
searchtext : "",
taglist: data,
};
},
computed:{
filteredDataArray() {
return this.taglist.filter((option) => {
return option
.toString()
.toLowerCase()
.indexOf(this.searchtext.toLowerCase()) >= 0
})
}
},
methods: {
saveTagsToArray: function() {
tagArray = this.selected;
@@ -94,12 +100,15 @@ const CreateMsgRouter = {
$.ajax({url: "api/tag/ids",method: "GET"})
.done(jd => {
// NICHT SO wg. Vue: _messagelist = jd;
_taglist.splice(0, _taglist.length);
_taglist.push.apply(_taglist, jd);
console.log("tag: jd: " + jd);
for (var e in jd) {
if (!_tags[jd[e]]) {
get_insert_tag(jd[e]);
console.log("DATA: "+data);
if(data == ""){
_taglist.splice(0, _taglist.length);
_taglist.push.apply(_taglist, jd);
console.log("tag: jd: " + jd);
for (var e in jd) {
if (!_tags[jd[e]]) {
get_insert_tag(jd[e]);
}
}
}
}).fail(function (e, f, g) {
@@ -120,17 +129,9 @@ const CreateMsgRouter = {
userField.prop('disabled',false);
}
this.list_tags();
//this.list_tags();
if ($(this).bootstrapMaterialDesign)
$(this).bootstrapMaterialDesign();
},
};
function get_insert_tag(id){
$.ajax({ url: "api/tag/id/"+id, method: "GET" }).done(function (tag) {
data.push("#" + tag.name);
console.log("Array:"+this.data);
}).fail(function (e, f, g) {
console.log("cannot load " + id + ".json: " + e + f + g);
})
}
+8 -11
View File
@@ -3,7 +3,6 @@ var tagArray = [];
const FileRouter = {
template: `
<div class="content">
<div class="column is-four-fifths-desktop pull-right-sm">
<h4>Erweiterte Suche</h4>
<b-field label="Suche nach">
@@ -23,16 +22,16 @@ const FileRouter = {
</b-field>
<b-field v-if="selectedOptions=='tags'">
<b-autocomplete rounded v-model="searchtext"
<b-autocomplete v-model="searchtext"
:data="filteredDataArray"
placeholder="suche..." icon="magnify"
placeholder="#" icon="label"
@select="option => selected = option">
</b-autocomplete>
</b-field>
<b-button type="is-primary" @click="search">SUCHE</b-button>
<div id="om-msg-cards">
<div id="om-msg-cards" v-if="isExtendedSearch==true">
<MsgCard
v-for="id in messagelist.slice().reverse()"
:key="id"
@@ -40,7 +39,6 @@ const FileRouter = {
></MsgCard>
</div>
</div>
</div>
`,
data: function () {
@@ -51,6 +49,7 @@ const FileRouter = {
taglist: data,
messagelist: _messagelist,
messages: _messages,
isExtendedSearch: false,
}
},
computed: {
@@ -67,10 +66,6 @@ const FileRouter = {
list_messages: function () {
messages();
},
saveTagsToArray: function () {
tagArray = this.selected;
console.info(tagArray);
},
getFilteredTags(text) {
this.taglist = data.filter((option) => {
return option
@@ -78,7 +73,6 @@ const FileRouter = {
.toLowerCase()
.indexOf(text.toLowerCase()) >= 0
})
this.search();
},
list_tags: function () {
$.ajax({
@@ -87,6 +81,7 @@ const FileRouter = {
})
.done(jd => {
// NICHT SO wg. Vue: _messagelist = jd;
if(data == ""){
_taglist.splice(0, _taglist.length);
_taglist.push.apply(_taglist, jd);
console.log("tag: jd: " + jd);
@@ -95,6 +90,7 @@ const FileRouter = {
get_insert_tag(jd[e]);
}
}
}
}).fail(function (e, f, g) {
console.log("err: " + e + f + g);
});
@@ -105,6 +101,7 @@ const FileRouter = {
},
search: function () {
searching(this.searchtext);
this.isExtendedSearch=true;
},
list_messages: function () {
messages();
@@ -112,7 +109,7 @@ const FileRouter = {
},
mounted: function () {
//this.search();
this.list_tags();
//this.list_tags();
//this.list_messages();
},
};