Skip to content

Commit

Permalink
avniproject/avni-server#1328 - order dashboards by name in response. …
Browse files Browse the repository at this point in the history
…added back setters, removed wrongly.
  • Loading branch information
petmongrels committed Mar 13, 2024
1 parent 6f6b1e4 commit 05fef58
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ default GroupDashboard findByNameIgnoreCase(String name) {
throw new UnsupportedOperationException("No field 'name' in GroupDashboard");
}

List<GroupDashboard> findByGroup_IdAndIsVoidedFalse(Long groupId);
List<GroupDashboard> findByGroup_IdAndIsVoidedFalseOrderByDashboardName(Long groupId);

List<GroupDashboard> findByGroup_IdAndIdNotAndIsVoidedFalse(Long groupId, Long Id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.avni.server.web.request.GroupDashboardContract;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.transaction.Transactional;
Expand Down Expand Up @@ -105,7 +104,7 @@ public void deleteGroupDashboard(@PathVariable Long id) {

@RequestMapping(value = "/groups/{id}/dashboards", method = RequestMethod.GET)
public List<GroupDashboardContract> getDashboardsByGroupId(@PathVariable("id") Long id) {
return groupDashboardRepository.findByGroup_IdAndIsVoidedFalse(id).stream()
return groupDashboardRepository.findByGroup_IdAndIsVoidedFalseOrderByDashboardName(id).stream()
.map(GroupDashboardContract::fromEntity)
.collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,30 @@ public boolean isSecondaryDashboard() {
return isSecondaryDashboard;
}

public void setPrimaryDashboard(boolean primaryDashboard) {
isPrimaryDashboard = primaryDashboard;
}

public void setSecondaryDashboard(boolean secondaryDashboard) {
isSecondaryDashboard = secondaryDashboard;
}

public void setDashboardId(long dashboardId) {
this.dashboardId = dashboardId;
}

public void setGroupId(long groupId) {
this.groupId = groupId;
}

public void setDashboardName(String dashboardName) {
this.dashboardName = dashboardName;
}

public void setDashboardDescription(String dashboardDescription) {
this.dashboardDescription = dashboardDescription;
}

public long getDashboardId() {
return dashboardId;
}
Expand Down

0 comments on commit 05fef58

Please sign in to comment.