Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vue] Fix: this.userManagementService is not a function #17569

Merged
merged 2 commits into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const validations: any = {
validations
})
export default class <%=jhiPrefixCapitalized%>UserManagementEdit extends Vue {
@Inject('userService') private userManagementService: () => UserManagementService;
@Inject('userManagementService') private userManagementService: () => UserManagementService;
@Inject('alertService') private alertService: () => AlertService;

public userAccount: IUser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AlertService from '@/shared/alert/alert.service';

@Component
export default class <%=jhiPrefixCapitalized%>UserManagementView extends Vue {
@Inject('userService') private userManagementService: () => UserManagementService;
@Inject('userManagementService') private userManagementService: () => UserManagementService;
@Inject('alertService') private alertService: () => AlertService;

public user: any = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import AlertService from '@/shared/alert/alert.service';
mixins: [Vue2Filters.mixin]
})
export default class <%=jhiPrefixCapitalized%>UserManagementComponent extends Vue {
@Inject('userService') private userManagementService: () => UserManagementService;
@Inject('userManagementService') private userManagementService: () => UserManagementService;
@Inject('alertService') private alertService: () => AlertService;

public error = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import ConfigurationService from '@/admin/configuration/configuration.service';
<%_ if (!skipUserManagement) { _%>
import ActivateService from './account/activate/activate.service';
import RegisterService from './account/register/register.service';
import UserManagementService from './admin/user-management/user-management.service';
<%_ } _%>
import LoginService from './account/login.service';
import AccountService from './account/account.service';
Expand Down Expand Up @@ -102,6 +103,7 @@ new Vue({
<%_ if (!skipUserManagement) { _%>
activateService: () => new ActivateService(),
registerService: () => new RegisterService(),
userManagementService: () => new UserManagementService(),
<%_ } _%>
<%_ if (applicationTypeGateway && serviceDiscoveryType) { %>
gatewayService: () => new GatewayService(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('UserManagementEdit Component', () => {
<%_ } _%>
localVue,
provide: {
userService: () => new UserManagementService(),
userManagementService: () => new UserManagementService(),
alertService: () => new AlertService(),
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('UserManagementView Component', () => {
let userManagementView: UserManagementViewClass;

beforeEach(() => {
wrapper = shallowMount<UserManagementViewClass>(UserManagementView, { store, <% if (enableTranslation) { %>i18n, <% } %>localVue, provide: { userService: () => new UserManagementService(), alertService: () => new AlertService(), } });
wrapper = shallowMount<UserManagementViewClass>(UserManagementView, { store, <% if (enableTranslation) { %>i18n, <% } %>localVue, provide: { userManagementService: () => new UserManagementService(), alertService: () => new AlertService(), } });
userManagementView = wrapper.vm;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('UserManagement Component', () => {
bModal: true
},
provide: {
userService: () => new UserManagementService(),
userManagementService: () => new UserManagementService(),
alertService: () => new AlertService(),
}
});
Expand Down