mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 01:24:03 +02:00
Merge remote-tracking branch 'origin/group-snapshots-by-place' into no-snapshots-welcome
This commit is contained in:
commit
6078b833a1
2 changed files with 25 additions and 3 deletions
|
@ -114,6 +114,7 @@ Window {
|
|||
timestamp: model.created_at;
|
||||
onlineUsers: model.online_users;
|
||||
storyId: model.metaverseId;
|
||||
drillDownToPlace: model.drillDownToPlace;
|
||||
hoverThunk: function () { ListView.view.currentIndex = index; }
|
||||
unhoverThunk: function () { ListView.view.currentIndex = -1; }
|
||||
}
|
||||
|
@ -392,6 +393,7 @@ Window {
|
|||
tags: tags,
|
||||
description: description,
|
||||
online_users: data.details.concurrency || 0,
|
||||
drillDownToPlace: false,
|
||||
|
||||
searchText: [name].concat(tags, description || []).join(' ').toUpperCase()
|
||||
}
|
||||
|
@ -407,6 +409,23 @@ Window {
|
|||
selectedTab = textButton;
|
||||
fillDestinations();
|
||||
}
|
||||
property var placeMap: ({});
|
||||
function addToSuggestions(place) {
|
||||
var collapse = allTab.selected && (place.action !== 'concurrency');
|
||||
if (collapse) {
|
||||
var existing = placeMap[place.place_name];
|
||||
if (existing) {
|
||||
existing.drillDownToPlace = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
suggestions.append(place);
|
||||
if (collapse) {
|
||||
placeMap[place.place_name] = suggestions.get(suggestions.count - 1);
|
||||
} else if (place.action === 'concurrency') {
|
||||
suggestions.get(suggestions.count - 1).drillDownToPlace = true; // Don't change raw place object (in allStories).
|
||||
}
|
||||
}
|
||||
function getUserStoryPage(pageNumber, cb) { // cb(error) after all pages of domain data have been added to model
|
||||
var options = [
|
||||
'include_actions=' + selectedTab.includeActions,
|
||||
|
@ -442,18 +461,20 @@ Window {
|
|||
}
|
||||
return function (place) {
|
||||
if (matches(place)) {
|
||||
suggestions.append(place);
|
||||
addToSuggestions(place);
|
||||
}
|
||||
};
|
||||
}
|
||||
function filterChoicesByText() {
|
||||
suggestions.clear();
|
||||
placeMap = {};
|
||||
allStories.forEach(makeFilteredPlaceProcessor());
|
||||
}
|
||||
|
||||
function fillDestinations() {
|
||||
allStories = [];
|
||||
suggestions.clear();
|
||||
placeMap = {};
|
||||
getUserStoryPage(1, function (error) {
|
||||
console.log('user stories query', error || 'ok', allStories.length);
|
||||
});
|
||||
|
|
|
@ -27,6 +27,7 @@ Rectangle {
|
|||
property var goFunction: null;
|
||||
property string storyId: "";
|
||||
|
||||
property bool drillDownToPlace: false;
|
||||
property string timePhrase: pastTime(timestamp);
|
||||
property int onlineUsers: 0;
|
||||
|
||||
|
@ -113,7 +114,7 @@ Rectangle {
|
|||
}
|
||||
FiraSansRegular {
|
||||
id: users;
|
||||
text: (action === 'concurrency') ? onlineUsers : 'snapshot';
|
||||
text: (action === 'concurrency') ? onlineUsers : ('snapshot' + (drillDownToPlace ? 's' : ''));
|
||||
size: (action === 'concurrency') ? textSize : textSizeSmall;
|
||||
color: hifi.colors.white;
|
||||
anchors {
|
||||
|
@ -140,7 +141,7 @@ Rectangle {
|
|||
id: usersImage;
|
||||
imageURL: "../../images/" + action + ".svg";
|
||||
size: 32;
|
||||
onClicked: goFunction("/user_stories/" + storyId);
|
||||
onClicked: goFunction(drillDownToPlace ? ("/places/" + placeName) : ("/user_stories/" + storyId));
|
||||
buttonState: 0;
|
||||
defaultState: 0;
|
||||
hoverState: 1;
|
||||
|
|
Loading…
Reference in a new issue