Skip to content

Commit 161af39

Browse files
committed
commit before plugin
1 parent 467aedf commit 161af39

File tree

11 files changed

+155
-137
lines changed

11 files changed

+155
-137
lines changed

src/main/java/com/sapanywhere/app/controller/EmployeeController.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import com.sapanywhere.app.repository.EmployeeRepository;
3232
import com.sapanywhere.app.service.ApproverService;
3333
import com.sapanywhere.app.service.CompanyService;
34+
import com.sapanywhere.app.service.DepartmentService;
3435
import com.sapanywhere.app.service.EmployeeService;
3536
import com.sapanywhere.app.service.FileService;
3637
import com.sapanywhere.app.service.UserService;
@@ -61,6 +62,9 @@ public class EmployeeController {
6162
@Autowired
6263
private UserService userService;
6364

65+
@Autowired
66+
private DepartmentService departmentService;
67+
6468
@ModelAttribute("companyInfo")
6569
public Company getCompanyInfo(){
6670
return this.companyService.findById((long) 1);
@@ -83,6 +87,7 @@ public String createPage(@AuthenticationPrincipal UserInfo userInfo, EmployeeInf
8387
public String createEditForm(@AuthenticationPrincipal UserInfo userInfo,EmployeeInfoForm employeeInfoForm){
8488
Employee employee = employeeRepository.findByUser(userInfo.getUser());
8589
employeeInfoForm.setByEmployee(employee);
90+
8691
logger.info("load edit.html");
8792
return "/employee/edit";
8893
}

src/main/java/com/sapanywhere/app/controller/SettingController.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,12 @@ public String update(@Valid ApproverListView settingForm,BindingResult result) {
139139
@RequestMapping(value = "/setting/workHours", method = RequestMethod.POST)
140140
public String updateWorkHours(@Valid WorkHoursForm workHoursForm,
141141
BindingResult result) throws Exception {
142+
142143
if (result.hasErrors()) {
143144
return "/settings/index";
144145
}
145146

146-
return "/settings/index";
147-
/*if(userApproverDTO != null && userApproverDTO.getId()!= null && userApproverDTO.getApproverId() != null){
148-
this.userApproverService.update(userApproverDTO.getId(), userApproverDTO.getApproverId());
149-
}else{
150-
throw new Exception();
151-
}*/
147+
return "redirect:/setting.html";
152148
}
153149

154150
@RequestMapping(value = "/addLeaveTypeRule", method = RequestMethod.POST)

src/main/java/com/sapanywhere/app/service/DepartmentService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.sapanywhere.app.service;
22

33
import org.springframework.beans.factory.annotation.Autowired;
4+
import org.springframework.cache.annotation.Cacheable;
45
import org.springframework.stereotype.Service;
56

67
import com.sapanywhere.app.entity.Department;
7-
import com.sapanywhere.app.entity.Employee;
88
import com.sapanywhere.app.repository.DepartmentRepository;
99

1010
@Service

src/main/resources/application.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ spring.mail.password=SAPB1Admin
3232
spring.mail.from=jingjing.wang01@sap.com
3333

3434
# SAP Anywhere App configuration
35-
sapanywhere.app.appId=8129385087834123-xAPBGrTItgi6Oc6cAlwItcMvmiyxSRfg
36-
sapanywhere.app.appSecret=nl1O3hlhLRVWJNLHO-fB2XsjssA4
35+
sapanywhere.app.appId=2146032466576710-JGdQYvdV4YlHG1hzrsYMFxqJBNux0dcs
36+
sapanywhere.app.appSecret=MB63X6Lz4pO6dJX2rxStovVyGG-2
3737
sapanywhere.app.appScope=AdminFunction_R,AdminFunction_RW,BusinessData_R,BusinessData_RW
38-
sapanywhere.app.rootCallbackUrl=http://localhost:8080/oauth/callback
38+
sapanywhere.app.rootCallbackUrl=http://localhost:8085/oauth/callback
3939
sapanywhere.app.installCallbackUrl=http://localhost:8080/oauth/install
40-
sapanywhere.app.sapanywhereIdpUrl=https://idp.cnpvgvb1ep058.sapanywhere.sap.corp/sld
41-
sapanywhere.app.sapanywhereOpenApiUrl=https://cnpvgvb1ep058-api.sapanywhere.sap.corp/v1
40+
sapanywhere.app.sapanywhereIdpUrl=https://occ.cnpvgvb1ep032.sapanywhere.sap.corp/sbo/oauth2/
41+
sapanywhere.app.sapanywhereOpenApiUrl=https://api.cnpvgvb1ep032.sapanywhere.sap.corp/v1/

src/main/resources/messages_en.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ com.sapanywhere.constraints.fieldmatch=The field '{sourceField}' value not match
33

44
# common
55
common.button.save=Save
6-
common.button.cancal=Cancel
6+
common.button.cancel=Cancel
77
common.button.setting=Setting
88
common.button.approve=Approve
99
common.button.reject=Reject

src/main/resources/static/css/common.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ ul, menu, dir {
1818
padding-left: 0px;
1919
width:38.7%;
2020
min-height : 270px;
21+
margin-bottom: 5px;
2122
}
2223

2324
.page-body {

src/main/resources/static/css/employee.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
}
55

66
.employee.information .modal-dialog .modal-content {
7-
min-height: 600px;
87
}
98

109
.employee.information .modal-dialog .modal-content .modal-footer {
1110
bottom: 0;
12-
position: absolute;
11+
position: relative;
1312
left: 0;
1413
right: 0;
1514
}

src/main/resources/static/css/setting.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1+
.departmentInfo{
2+
width: 50px;
3+
}
4+
15

26
.page.setting .modal-dialog {
37
width: 500px;
48
margin:100px auto;
59
}
610

711
.page.setting .modal-dialog .modal-content {
8-
min-height: 600px;
912
}
1013

1114
.page.setting .modal-dialog .modal-content .modal-footer {
1215
bottom: 0;
13-
position: absolute;
16+
position: relative;
1417
left: 0;
1518
right: 0;
1619
}
1720

1821
.page.setting .modal-dialog .modal-content .modal-body {
19-
padding-top: 0px;
22+
padding-top : 0px;
2023
}
2124

2225
.page.setting .modal-dialog .modal-content .modal-body .row {

src/main/resources/templates/employee/edit.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@
9595

9696
<div class="input-field-group">
9797
<div class="input-label" th:text="#{employee.info.department}"></div>
98-
<input class="input-field " type="text" th:field="*{department}" th:value="${employeeInfoForm.department}" />
98+
<select class="input-field " th:field="*{department}">
99+
<option th:each="it : ${@departmentService.findAll()}" th:value="${it.name}" th:text="${it.name}"></option>
100+
</select>
99101
</div>
100102

101103
<div class="input-field-group">
@@ -114,6 +116,7 @@
114116
</div>
115117

116118
<button class="btn btn-primary" type="submit" th:text="#{common.button.save}"> </button>
119+
<a th:href="@{/information.html}" class="btn btn-default" role="button" th:text="#{common.button.cancel}" style="float:right"></a>
117120
</form>
118121
</div>
119122
</div>

src/main/resources/templates/employee/information.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@
5757
<div class="page-body">
5858

5959
<div class="panel panel-default">
60-
<div class="panel-heading">Employee Information</div>
60+
<div class="panel-heading">
61+
<span>Employee Information</span>
62+
<a href="#" th:href="@{/edit.html}" role="button" class="btn btn-primary btn-xs" style="float:right"> Edit</a>
63+
</div>
6164
<div class="panel-body">
6265
<div class="media-left media-middle">
6366
<img class="media-object" th:src="'/getImage/'+${employeeInfoForm.avatarId}" src="/imgs/avatar.jpg" alt="avatar" height="100" width="100"> </img>
@@ -127,7 +130,7 @@
127130
</table>
128131
</div>
129132
<div class= "media-right">
130-
<a href="#" th:href="@{/edit.html}" role="button" class="btn btn-primary btn-xs"> Edit</a>
133+
131134
</div>
132135
</div>
133136
</div>
@@ -173,9 +176,6 @@ <h4 class="modal-title" id="chooseApproverDialog-title">Selector Approvers</h4>
173176
<div th:text="${it.fullName}"></div>
174177
</div>
175178
</div>
176-
<div class="modal-footer">
177-
<button type="button" class="btn btn-default" data-dismiss="modal" th:text="#{common.button.cancal}"></button>
178-
</div>
179179
</div>
180180
</div>
181181
</div>

0 commit comments

Comments
 (0)