How to keep-alive nested QRouteTab (vuejs3 with Quasar2) - vue.js

I try to create an UI with 2 nested tabs (see the screen shot), which keep alive all visited panels.
I have made a small example here: https://codesandbox.io/s/no-keep-alive-b7x2sj
However only panels of the second level (child tabs) are keep alive (we can navigate between tabs of TEST I, TEST II, ... without re run the setup function, see console output), but when we navigate between tabs of the first level (parent tabs) it doesn't work anymore:
[Quasar] Running SPA.
##### setup -> index
##### setup -> layout test A
##### setup -> test i
##### setup -> test ii
##### setup -> test iii
##### setup -> layout test B
##### setup -> test j
##### setup -> layout test A
##### setup -> test i
As you can see in the console output above:
the setup of "test i" is rerun, when the user comeback in the tab "test A"
and we don't comeback on "test iii", which are the last panel visited in "test A".
I try to fix it, by adding <keep-alive> for each parent panel (test A, B, C, D) in index.vue, like:
<q-tab-panel name="testA" class="no-padding">
<keep-alive>
<component :is="Component" />
</keep-alive>
</q-tab-panel>
However, it doesn't work nether and I get a side effect which run the setup of "test j" two consecutive times, as you can see in the console:
[Quasar] Running SPA.
##### setup -> index
##### setup -> layout test A
##### setup -> test i
##### setup -> test ii
##### setup -> layout test B
##### setup -> test j
##### setup -> test j
You can find the code here: https://codesandbox.io/s/duplicate-run-of-setup-jjovrb
Does anyone have an idea to help me to get through these issues ? Or an explanation of why it doesn't work as I expected.
Thank,
Eric.

As explain here:
https://github.com/quasarframework/quasar/discussions/12604#discussioncomment-2255160
the solution was to not used QTabPanel with QRouteTab.
You can find an example of the solution here: https://codesandbox.io/s/without-qtabpanel-m43nec
However, there still have a bug which run setup function twice in child route.
[Quasar] Running SPA.
##### setup -> index
##### setup -> layout test A
##### setup -> test i
##### setup -> layout test B
##### setup -> test j
##### setup -> test j
##### setup -> test C
It seems to be linked to a known issue of the vuejs's router:
https://github.com/vuejs/router/issues/626

Related

Getting this error while building a react-native iOS app on xcode: `React/RCTBridgeModule.h` file not found

React/RCTBridgeModule.h file not found
after a while of searching, here is my solution:
1. Disable the parallel builds:
+++Xcode menu -> Product -> Scheme -> Edit Schemes...
+++Double click on your application
+++Build tab -> uncheck Parallelize Build
+++Click on the '+' sign, then add React
enter image description here:
[1]: https://i.stack.imgur.com/IeEdK.png
[2]: https://i.stack.imgur.com/4w3pC.png

Chrome launching twice when running a Cucumber feature

I have a problem where Chrome driver is launching twice when I run a feature file.
I'm using Cucumber with Selenium Java using IntelliJ.
The problem came about when I created a new stepdef file for a new area of functionality that I'm working on. So I'm pretty sure this is something to do with how the features are linked to step defs. I'm still learning the ropes here so this is an area I haven't had much experience in.
My Step Defs each come with #Before code to run before every stepdef method and the #Before code contains a
driver.get("https://mywebsite_under_test");
This website URL is different for each of the two StepDef files.
When I launch my test I can see that the two chrome sessions it starts are the ones mentioned in the #Before of each Step Def file. I'm launching from the IDE where I just run the feature.
My project structure is as follows:
├───main
│ ├───java
│ └───resources
└───test
├───java
│ ├───Database
│ ├───Pages
│ └───stepdefs
│ ├───MOPStepDefs
│ └───MOSStepDefs
└───Resources
├───MOP Features
└───MOS Features
I'm out of ideas here. I've messed about with Glue value in the Config but not getting any luck.
With your before tag add the scenario tag so it only runs when you run that scenario i.e. #Before("#MOP") where #MOP is a tag of your feature or scenario. In your instance the syntax should be #Before("#Automated, #MOP")

Why does my Ember component integration test pass when I run it in isolation, but fail when I run the full suite?

I have a simple, bare-bones integration test for a component which depends on an i18n service (which the test injects). The component itself is a simple select dropdown from ember-select-list, with a default value of Select Language. Here's the test:
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
moduleForComponent('language-select', 'Integration | Component | language select', {
integration: true,
beforeEach() {
this.inject.service('i18n');
}
});
test('it renders', function(assert) {
this.render(hbs`{{language-select}}`);
assert.equal(this.$().text().trim().includes('Select Language'), true);
});
When I attempt to just run this one test file (i.e. ember test -f "language-select"), the output I see indicates that only linting tests were performed:
[ hospitalrun-frontend ] $ ember test -f "language-select"
WARNING: Node v7.5.0 is not tested against Ember CLI on your platform. We recommend that you use the most-recent "Active LTS" version of Node.js.
cleaning up...
Built project successfully. Stored in "/Users/richie.thomas/Desktop/Workspace/OpenSource/hospitalrun-frontend/tmp/core_object-tests_dist-5MT1adu7.tmp".
ok 1 PhantomJS 2.1 - ESLint - acceptance/language-select-test.js: should pass ESLint
ok 2 PhantomJS 2.1 - ESLint - components/language-select.js: should pass ESLint
ok 3 PhantomJS 2.1 - TemplateLint - hospitalrun/templates/components/language-select.hbs: should pass TemplateLint
ok 4 PhantomJS 2.1 - ESLint - integration/components/language-select-test.js: should pass ESLint
1..4
# tests 4
# pass 4
# skip 0
# fail 0
# ok
However when I run a plain ember test, I see that this test fails because I am apparently injecting the i18n service incorrectly:
not ok 488 PhantomJS 2.1 - Integration | Component | language select: it renders
---
actual: >
null
expected: >
null
stack: >
http://localhost:7357/assets/hospitalrun.js:4090:18
get#http://localhost:7357/assets/vendor.js:35757:32
get#http://localhost:7357/assets/vendor.js:40664:22
compute#http://localhost:7357/assets/vendor.js:33758:29
value#http://localhost:7357/assets/vendor.js:33625:52
value#http://localhost:7357/assets/vendor.js:65639:37
value#http://localhost:7357/assets/vendor.js:33512:34
create#http://localhost:7357/assets/vendor.js:31495:53
evaluate#http://localhost:7357/assets/vendor.js:66320:43
execute#http://localhost:7357/assets/vendor.js:72898:36
render#http://localhost:7357/assets/vendor.js:72472:30
render#http://localhost:7357/assets/vendor.js:30793:52
runInTransaction#http://localhost:7357/assets/vendor.js:41756:28
_renderRoots#http://localhost:7357/assets/vendor.js:31058:64
_renderRootsTransaction#http://localhost:7357/assets/vendor.js:31096:26
_renderRoot#http://localhost:7357/assets/vendor.js:31017:35
_appendDefinition#http://localhost:7357/assets/vendor.js:30930:23
appendOutletView#http://localhost:7357/assets/vendor.js:30913:29
invoke#http://localhost:7357/assets/vendor.js:19795:19
flush#http://localhost:7357/assets/vendor.js:19865:15
flush#http://localhost:7357/assets/vendor.js:19989:20
end#http://localhost:7357/assets/vendor.js:20059:28
run#http://localhost:7357/assets/vendor.js:20182:19
run#http://localhost:7357/assets/vendor.js:40972:32
render#http://localhost:7357/assets/test-support.js:20665:30
http://localhost:7357/assets/tests.js:15398:16
runTest#http://localhost:7357/assets/test-support.js:3859:34
run#http://localhost:7357/assets/test-support.js:3845:13
http://localhost:7357/assets/test-support.js:4037:15
advance#http://localhost:7357/assets/test-support.js:3522:26
begin#http://localhost:7357/assets/test-support.js:5213:27
http://localhost:7357/assets/test-support.js:4407:11
message: >
Died on test #1 http://localhost:7357/assets/tests.js:15392:24
exports#http://localhost:7357/assets/vendor.js:123:37
requireModule#http://localhost:7357/assets/vendor.js:38:25
require#http://localhost:7357/assets/test-support.js:19547:14
loadModules#http://localhost:7357/assets/test-support.js:19539:21
load#http://localhost:7357/assets/test-support.js:19569:33
http://localhost:7357/assets/test-support.js:7584:22: undefined is not an object (evaluating 'i18n.get')
Log: |
...
I don't see anything in the documentation here about the filter flag affecting the type of tests that are run (i.e. lint vs non-lint tests).
I'm happy to post a separate question about how to properly inject the i18n service, but my question here is:
Why does adding the filter flag result in only filtering tests being run?
It filters module names, not file names. You have dash inside a filter string. Remove it and use space instead:
ember test -f "language select"

intellij "object index is not a member of package views.html"

I've got Intellij 15.0.5 and I cannot get rid of this error
object index is not a member of package views.
I've created a new play project in Intellij and also using the activator command
activator new PlayTestProject
But I keep getting the above error. I've read all the other similar question on SO but none of them helped and I've tried the following
Right click the project -> Add framework support -> select "Play 2"
Result: I didn't see any change to my project. When I hit OK, the window disappears but if I try the same the second time. Nothing happens and the window is still there!
Preferences -> Languages & Frameworks -> Play2 -> select "Use Play 2 compiler for this project"
Result: I get this error
Error:Module 'client' production: java.lang.NullPointerException
I've tried
invalidate cache & restart
sbt clean
checkout a fresh new project
But I keep getting the same error in Intellij.
Running sbt compile on command line runs the build successful. But Intellij keeps shows me the above error.
How do I fix this ?
Alright if anyone is running into the same problem. The fix was to mark the following two directories as Sources Roots in Intellij.
/target/twirl/main
/target/routes
Steps:
Right click the target folder -> Mark directory as -> Cancel exclusion (If you don't see Cancel exclusion do the next step.
Right click the target/scala-2.11/twirl/main folder -> Mark directory as -> Sources Root
Right click the target/scala-2.11/routes folder -> Mark directory as -> Sources Root
Right click the project Open module settings -> Sources -> and remove the above two directories if there are added in the Excluded folder's section.
This fixed my problem.
I found this problem and it appeared to be caused by an incomplete compile within sbt. (I had done "sbt clean ; sbt compile" but then aborted the compile with Ctrl+C because it had a error.)
Intellij worked correctly again after I ran:
sbt clean
After removing the .idea/ folder, I could successfully re-open/import my project, and the errors were gone.
Just remove the #() from top of index.scala.html because there are no parameters.
#()
<!DOCTYPE html>
<html lang="en">
And in Action you have
def index = Action {
Ok(views.html.index())
}
I had a similar error and just had to run npm install to fetch the necessary dependencies. Listing it here in case anyone has the same issue.

running dart project says dart:html is not available for the standalone vm

I used Git to pull a project
I then start IntelliJ, and say: Open Project.
The project itself looks like it has 4 modules, Lab1, Lab2, Solution2, Solution2
I open the full project. In Lab1, i want to run to see how my web page looks, but when i say: Run main.dart the error kicked back is:
C:\code\dart-sdk\bin\dart.exe --ignore-unrecognized-flags --checked --enable-vm-service:51293 --trace_service_pause_events C:\code\workspace\tw_remoting_training\codelab_01\web\main.dart
Observatory listening on http://127.0.0.1:51293
The built-in library 'dart:html' is not available on the stand-alone VM.
'package:remoting_training/remoting_printer.dart': error: line 20 pos 1: library handler failed
import 'dart:html';
^
Process finished with exit code 254
Im not sure what is going on here though. As a secondary option, i will also try to Right-Click on index.html and click: Open with > Dartium but that shows a blank page. It shouldve done 4 async calls which printed strings to the screen.
Is there something I am missing? Is it not running because of it being a module in a project?
If your Dart script imports dart:html or a library that imports dart:html you can run that script only from the Dartium browser (by adding a script tag to HTML that points the that Dart script, or if you run it through pub build or dart2js in any browser), but it can't be run from the console.
With dart:io it's exactly the opposite, it can't be run in the browser.