Href migration from 1.x to 2.x? - vuejs2

I have the following href with php tag. It works on 1.x, i need to migrate to 2.x version.
test
how to change to work on 2.x version?

You should just be able to do this:
<a :href="'/report/message/compose/' + student.StudentID">test</a>

Can do it in this way.
<a v-bind:href=" '<?=base_url('report/message/compose/')?>' + student.StudentID">test</a>

Related

Vue3 - how to get version

in Vue2 I had:
console.log(Vue.version);
How do I get the version now in Vue 3?
Do I get it somehow out from the context?
What you have should work.
See example:
console.log(Vue.version)
<script src="https://unpkg.com/vue#3.0.2/dist/vue.global.prod.js"></script>
The issue may be that you are calling a different vue bundle, try using/importing vue.global.

jet-application-mark in laravel 8.x

I know that a vue component has an ending tag. But in laravel 8.x, I found jet-application-mark without an ending tag like this...
<div class="flex-shrink-0 flex items-center">
<a href="/dashboard">
<jet-application-mark class="block h-9 w-auto" />
</a>
</div>
If you have laravel installed, you will find the full source code here...
resources > js > layouts > AppLayout.vue (line no: 11)
Is it a vue component? of anything else?
It Jetstream from the new Livewire package that replaces Laravel Auth packages:
From the webpage: Laravel Jetstream is a beautifully designed application scaffolding for Laravel. Jetstream provides the perfect starting point for your next Laravel application and includes login, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management.
If you need to change the icon you must publish the Jetstream views with this command:
php artisan vendor:publish --tag=jetstream-views
Next, you should customize the SVGs located in the
resources/views/vendor/jetstream/components/application-logo.blade.php,
resources/views/vendor/jetstream/components/authentication-card-logo.blade.php,
and
resources/views/vendor/jetstream/components/application-mark.blade.php
components.
Source: Jetstream Documentation
If you want to learn what is Livewire you can read the docs in https://laravel-livewire.com

Grails 3 fields plugin generating form elements from a command object

I am running grails 3.0.4 and I have a simple command object AdvanceCommand
I am trying to create a form for all the fields in the command object using f:all tag from fields plugin. But I get an error
[views/advance/create.gsp:35] [views/advance/create.gsp:30] Tag [all] currently only supports domain types
the documentation specifically mentions command objects so I am a bit confused. if this tag is not working how do I generate form elements for a command object?
This is a snippet from my controller
def create() {
respond new AdvanceCommand()
}
and this is my gsp
<g:form action="save">
<fieldset class="form">
<f:all bean="advanceCommand"/>
</fieldset>
<fieldset class="buttons">
<g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" />
</fieldset>
</g:form>
PS in the source repo of field plugin the latest version is 1.5.1 but if I run plugin-info I get 2.0.3 and 1.5.x is not even mentioned. Am I using a different plugin ?
grails> plugin-info fields
| Plugin Info: fields
| Latest Version: 2.0.3
| All Versions: 2.0.0.M1,2.0.0,2.0.1,2.0.2,2.0.3
| Title: Fields Plugin
Customizable form-field rendering based on overrideable GSP template
* License: APACHE
* Documentation: https://grails-fields-plugin.github.io/grails-fields
* Issue Tracker: https://github.com/grails-fields-plugin/grails-fields/issues
* Source: https://github.com/grails-fields-plugin/grails-fields
It appears they have forked a fields plugin from 1.4 to support grails 3. New documentation and source repo.
There is a feature request to support non domain objects in <f:all>. so it looks like its not supported yet. Using <f:field> seems to be the only way out

Dojo AMD and portlet-client-model

I'm using Dojo 1.9.1 AMD with WebSphere 8 portlets and can't figure out how to continue to leverage the WebSphere mechanism for getting/setting user's portlet preferences. Prior to moving from pre-AMD Dojo (1.6) to Dojo 1.9.1 AMD, I was including at the top of some JSP files these lines:
<%# taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.1/portlet-client-model"
prefix="portlet-client-model" %> <portlet:defineObjects/>
<portlet-client-model:init>
<portlet-client-model:require module="ibm.portal.xml.*"/>
<portlet-client-model:require module="ibm.portal.portlet.*"/>
</portlet-client-model:init>
which get converted/generated into these lines at run-time:
<script> if(typeof dojo=='undefined') {
document.writeln("<scr"+"ipt src='/wps/portal_dojo/v1.4.3/dojo/dojo.js' ></scr"+"ipt>");
} </script>
<script>dojo.require('ibm.portal.xml.xpath'); dojo.require('ibm.portal.xml.xslt');</script>
<script>dojo.require('ibm.portal.portlet.portlet');</script>
<script>if(typeof(ibmPortalConfig) == "undefined") {ibmPortalConfig = {contentHandlerURI: "/wps/mycontenthandler/urs/!ut/p/digest!q8eCn6qc7fl2VjdmXXlayA/nm/oid:wps.portal.root"};} else if(!ibmPortalConfig["contentHandlerURI"]) {ibmPortalConfig["contentHandlerURI"] = "/wps/mycontenthandler/urs/!ut/p/digest!q8eCn6qc7fl2VjdmXXlayA/nm/oid:wps.portal.root";} </script><div id='com.ibm.wps.web2.portlet.root.Z7_HHGGGIO0JGPN00AI72U5E530O2' style='display: none;'>/wps/mycontenthandler/urs/!ut/p/digest!q8eCn6qc7fl2VjdmXXlayA/pm/oid:--portletwindowid--#oid:Z6_HHGGGIO0JGPN00AI72U5E530G4</div>
<div id='com.ibm.wps.web2.portlet.preferences.Z7_HHGGGIO0JGPN00AI72U5E530O2' style='display: none;' pageid='Z6_HHGGGIO0JGPN00AI72U5E530G4' configid='Z3_HHGGGIO0JGPN00AI72U5E53085' editdefaultsid='Z5_HHGGGIO0JGPN00AI72U5E530O6'
></div>
<div id='com.ibm.wps.web2.portlet.user.Z7_HHGGGIO0JGPN00AI72U5E530O2' style='display: none;'>/wps/mycontenthandler/urs/!ut/p/digest!q8eCn6qc7fl2VjdmXXlayA/um/secure/currentuser/profile?expandRefs=true</div>
which then allowed me to use javascript for getting and setting user portlet preferences. When I try using this same technique with Dojo 1.9.1 AMD, the same code that is generated above causes a javascript error complaining that the "dojo.require" is not a function.
With the improved Dojo AMD, I no longer have any calls to "dojo.require" like I used to, so I haven't encountered this issue, but these WebSphere custom tags automatically generate "dojo.require" calls that are now failing.
Do I need to try to mix the old pre-AMD inclusion of dojo.js with the preferred AMD inclusion calls? Has anyone encountered this issue yet?
Any help is appreciated. Thanks.
Your main problem is that you're using an old taglib. If I look at the URL I see that you're using a v6.1 taglib, which uses Dojo 1.4.3 and that is obviously outdated. Try to replace the taglib with:
<%# taglib
uri="http://www.ibm.com/xmlns/prod/websphere/portal/v8.0/portlet-client-model"
prefix="portlet-client-model" %>
I suppose that should generate some more appropriate code, compatible with the latest releases. You will probably have to update some libraries on your classpath as well.
Also, if you're using WebSphere Portal 8, then only Dojo 1.7 is supported officially, so make sure you're not using different versions here. WebSphere Portal 8.5 supports Dojo 1.9 (uses 1.9.3 to be exactly), but from your question it was not clear if you're using v8 or v8.5.
If you want to change the Dojo configuration and set async: false, that's possible, but you will have to set it before dojo.js is loaded. That means you will have to edit theme.html and the localized themes (for example theme_en.html) to add the following content above the co:head dynamic content spot:
<script type="text/javascript">
dojoConfig = {
async: false
};
</script>
<link rel="dynamic-content" href="co:head">
Be careful though, if you set it, you might break something, I don't know if IBM has their own configuration that includes custom packages or not, but if they do and you're overriding that configuration, then it might lead to errors.

Protractor/Jasmine showing different versions - what am I doing wrong?

When I do this:
console.log('jasmine-version:' + jasmine.getEnv().versionString());
it prints: jasmine-version:1.3.1 revision 1354556913
When I run 'npm list jasmine-core' it prints:
server#0.0.1 /Users/xx/Desktop/workingDirectory
└── jasmine-core#2.1.3
Why is one showing 2.1.3 and another showing 1.3.1?
I don't seem to have the features in 2.1.3, so it's running 1.3.1. How do I fix this?
You have to specify that you want to use jasmine2 in the conf file. Please read the docs here: https://github.com/angular/protractor/blob/master/docs/jasmine-upgrade.md#in-your-conf-file.
Protractor supports both jasmine 1.3 and 2.x, and it's up to you to specify the version of jasmine you want to use. (Side note, 2.x is provided via jasmine-core, while 1.3 is provided via minijasminenode)
EDIT: another side note, protractor support for 2.x is not released until protractor 1.6 or if you use master
This is my issue https://github.com/angular/protractor/issues/362
Looks like Jasmine2 was only checked in a few days ago.