forked from jhipster/jhipster-vuejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Entity generation and User Management using Vue-Class-Component
- Loading branch information
1 parent
b729b53
commit 411e209
Showing
29 changed files
with
949 additions
and
751 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
generators/client/templates/vue/src/main/webapp/app/entities/UserService.vue
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
generators/client/templates/vue/src/main/webapp/app/shared/sort/sorts.ts.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default function buildPaginationQueryOpts(paginationQuery) { | ||
if (paginationQuery) { | ||
let sorts = ''; | ||
for (let idx in paginationQuery.sort) { | ||
if (sorts.length > 0) { | ||
sorts += '&'; | ||
} | ||
sorts += 'sort=' + paginationQuery.sort[idx]; | ||
} | ||
return `${sorts}&page=${paginationQuery.page}&size=${paginationQuery.size}`; | ||
} | ||
return ''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 32 additions & 26 deletions
58
.../entity-client/templates/vue/src/main/webapp/app/entities/entity-details.component.ts.ejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
import <%= entityAngularName %>Service from './<%= entityFileName %>.service.vue'; | ||
import { Component,<% if (!fieldsContainBlob) { %> Vue,<% } %> Inject } from 'vue-property-decorator'; | ||
<% if (fieldsContainBlob) { %> | ||
import JhiDataUtils from '../../<% if (clientRootFolder) { %>../<% } %>shared/data/DataUtilsService.vue'; | ||
import { mixins } from 'vue-class-component'; | ||
import JhiDataUtils from '@/shared/data/DataUtilsService.vue'; | ||
<% } %> | ||
import { I<%= entityAngularName %> } from '@/shared/model/<%= entityModelFileName %>.model'; | ||
import <%= entityAngularName %>Service from './<%= entityFileName %>.service'; | ||
|
||
const <%= entityAngularName %>Details = { | ||
mixins: [<%= entityAngularName %>Service<% if (fieldsContainBlob) { %>, JhiDataUtils<% } %>], | ||
data() { | ||
return { | ||
<%= entityInstance %>: {} | ||
} | ||
}, | ||
beforeRouteEnter (to, from, next) { | ||
next(vm => { | ||
if (to.params.<%= entityInstance %>Id) { | ||
vm.retrieve<%= entityAngularName %>(to.params.<%= entityInstance %>Id); | ||
} | ||
}) | ||
}, | ||
methods: { | ||
retrieve<%= entityAngularName %>(<%= entityInstance %>Id) { | ||
this.find<%= entityAngularName %>(<%= entityInstance %>Id).then((res) => { | ||
this.<%= entityInstance %> = res.data; | ||
}); | ||
}, | ||
previousState() { | ||
this.$router.go(-1); | ||
} | ||
const beforeRouteEnter = (to, from, next) => { | ||
next(vm => { | ||
if (to.params.<%= entityInstance %>Id) { | ||
vm.retrieve<%= entityAngularName %>(to.params.<%= entityInstance %>Id); | ||
} | ||
}); | ||
}; | ||
|
||
export default <%= entityAngularName %>Details; | ||
@Component({ | ||
beforeRouteEnter | ||
}) | ||
export default class <%= entityAngularName %>Details extends <% if (fieldsContainBlob) { %>mixins(JhiDataUtils)<% } else { %>Vue<% } %> { | ||
@Inject('<%= entityInstance %>Service') private <%= entityInstance %>Service : () => <%= entityAngularName %>Service; | ||
public <%= entityInstance %>: I<%= entityAngularName %>; | ||
|
||
constructor() { | ||
super(); | ||
this.<%= entityInstance %> = {}; | ||
} | ||
|
||
public retrieve<%= entityAngularName %>(<%= entityInstance %>Id) { | ||
this.<%= entityInstance %>Service().find(<%= entityInstance %>Id).then((res) => { | ||
this.<%= entityInstance %> = res; | ||
}); | ||
} | ||
|
||
public previousState() { | ||
this.$router.go(-1); | ||
} | ||
} |
Oops, something went wrong.