33 |
34 |

35 |
36 |
37 | {appState.userName}
38 |
43 |
44 | )
45 | }
46 |
47 | showLogoutConfirm = () => {
48 | Modal.confirm({
49 | title: 'Are you sure you want to logout?',
50 | okText: 'Logout',
51 | cancelText: 'Cancel',
52 | onOk: () => {
53 | this.props.appState!.logout()
54 | }
55 | });
56 | }
57 |
58 | }
59 |
60 | export default AppHeader;
--------------------------------------------------------------------------------
/src/main/resources/com/haulmont/cuba/cli/cubaplugin/templates/project/7.0/modules/core/test/$[project.rootPackage]/core/SampleIntegrationTest.java:
--------------------------------------------------------------------------------
1 | package ${project.rootPackage}.core;
2 |
3 | import ${project.rootPackage}.AppTestContainer;
4 | import com.haulmont.cuba.core.EntityManager;
5 | import com.haulmont.cuba.core.Persistence;
6 | import com.haulmont.cuba.core.Transaction;
7 | import com.haulmont.cuba.core.TypedQuery;
8 | import com.haulmont.cuba.core.global.AppBeans;
9 | import com.haulmont.cuba.core.global.DataManager;
10 | import com.haulmont.cuba.core.global.Metadata;
11 | import com.haulmont.cuba.security.entity.User;
12 | import org.junit.After;
13 | import org.junit.Before;
14 | import org.junit.ClassRule;
15 | import org.junit.Test;
16 |
17 | import java.util.List;
18 |
19 | import static org.junit.Assert.assertEquals;
20 |
21 | public class SampleIntegrationTest {
22 |
23 | @ClassRule
24 | public static AppTestContainer cont = AppTestContainer.Common.INSTANCE;
25 |
26 | private Metadata metadata;
27 | private Persistence persistence;
28 | private DataManager dataManager;
29 |
30 | @Before
31 | public void setUp() throws Exception {
32 | metadata = cont.metadata();
33 | persistence = cont.persistence();
34 | dataManager = AppBeans.get(DataManager.class);
35 | }
36 |
37 | @After
38 | public void tearDown() throws Exception {
39 | }
40 |
41 | @Test
42 | public void testLoadUser() {
43 | try (Transaction tx = persistence.createTransaction()) {
44 | EntityManager em = persistence.getEntityManager();
45 | TypedQuery