Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Memri
Flutter App for Memri
Commits
326e7a8d
Commit
326e7a8d
authored
2 years ago
by
Koen van der Veen
Browse files
Options
Download
Email Patches
Plain Diff
fix duplicates
parent
3e3bf824
Pipeline
#9835
failed with stages
in 1 minute and 10 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/core/services/graph_service.dart
+9
-2
lib/core/services/graph_service.dart
lib/providers/data_app_provider.dart
+7
-7
lib/providers/data_app_provider.dart
lib/widgets/data_app/data_app.dart
+1
-1
lib/widgets/data_app/data_app.dart
with
17 additions
and
10 deletions
+17
-10
lib/core/services/graph_service.dart
+
9
-
2
View file @
326e7a8d
...
...
@@ -198,13 +198,20 @@ query {
else
if
(
properties
.
contains
(
'postDate'
)){
sorter
=
'order_desc: postDate,'
;
}
return
await
getResultAsItemList
(
query:
'''
List
<
Item
>
res
=
await
getResultAsItemList
(
query:
'''
query {
$type
(
$sorter
limit:
$amount
) {
$type
(
$sorter
, filter: {deleted: {eq: 0}}
) {
${properties.join('\n')}
isMock
}
}
'''
);
//ugly hack to make sure we can filter and limit
res
=
res
.
where
((
x
)
=
>
x
.
get
(
'isMock'
)
!=
true
)
.
toList
();
if
(
res
.
length
>
amount
){
res
=
res
.
sublist
(
0
,
amount
);
}
return
res
;
}
Future
<
List
<
Item
>>
loadAppContent
(
String
pluginId
,
String
dataType
,
List
<
String
>
properties
)
async
{
...
...
This diff is collapsed.
Click to expand it.
lib/providers/data_app_provider.dart
+
7
-
7
View file @
326e7a8d
...
...
@@ -357,7 +357,7 @@ class DataAppProvider with ChangeNotifier {
}
newItems
.
add
(
newItem
);
}
AppLogger
.
debug
(
newItems
);
//
AppLogger.debug(newItems);
await
_podService
.
bulkAction
(
createItems:
newItems
);
AppLogger
.
debug
(
'Created
${newItems.length}
new mock messages'
);
...
...
@@ -416,10 +416,10 @@ class DataAppProvider with ChangeNotifier {
notifyListeners
();
}
handleOpenDataApp
(
BuildContext
context
,
Item
plugin
,
AppState
appState
)
{
handleOpenDataApp
(
BuildContext
context
,
Item
plugin
,
AppState
appState
)
async
{
var
pluginId
=
plugin
.
get
(
'id'
);
if
(
!
runningPlugins
.
containsKey
(
pluginId
))
{
runDataAppPlugin
(
plugin
);
await
runDataAppPlugin
(
plugin
);
}
else
{
AppLogger
.
debug
(
'Already running'
);
}
...
...
@@ -429,7 +429,7 @@ class DataAppProvider with ChangeNotifier {
param:
{
'id'
:
pluginId
,
'tab'
:
appState
.
toUrlString
()});
}
runDataAppPlugin
(
Item
plugin
)
{
runDataAppPlugin
(
Item
plugin
)
async
{
AppLogger
.
debug
(
'Creating pluginRun:
${plugin.get("name")}
'
);
Item
pluginRun
=
Item
(
type:
'PluginRun'
);
plugin
.
properties
.
forEach
((
key
,
value
)
{
...
...
@@ -448,7 +448,7 @@ class DataAppProvider with ChangeNotifier {
pluginRun
.
properties
[
'config'
]
=
jsonEncode
(
config
);
currentDataType
=
plugin
.
get
(
'dataType'
);
createMockItems
(
128
,
plugin
.
get
(
'id'
));
await
createMockItems
(
128
,
plugin
.
get
(
'id'
));
_podService
.
createItem
(
item:
pluginRun
);
AppLogger
.
debug
(
"created PluginRun
${pluginRun.get("id")}
"
);
...
...
@@ -843,7 +843,7 @@ class DataAppProvider with ChangeNotifier {
// set items if we already ran the plugin in the past
currentPluginItems
=
await
loadAppContent
(
'_preview-
$currentGitProjectId
'
,
currentDataType
!
);
print
(
'initial items'
);
print
(
currentPluginItems
);
//
print('initial items');
//
print(currentPluginItems);
}
}
This diff is collapsed.
Click to expand it.
lib/widgets/data_app/data_app.dart
+
1
-
1
View file @
326e7a8d
...
...
@@ -85,7 +85,7 @@ class _DataAppState extends State<DataApp> {
loadAppContent
()
async
{
contentHasLoaded
=
false
;
appContent
=
await
_dataAppProvider
.
loadAppContent
(
widget
.
pluginId
,
'Tweet'
);
appContent
=
await
_dataAppProvider
.
loadAppContent
(
widget
.
pluginId
,
'Tweet'
,
onlyWithPredictions:
false
);
contentHasLoaded
=
true
;
setState
(()
{});
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets