list master user without searching

This commit is contained in:
sindhu
2024-05-17 16:39:34 +07:00
parent 02983cbd1b
commit 5565c0d48d
11 changed files with 363 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ import (
"strconv"
"cpone/component/customdropdown"
"cpone/component/pagination"
tablecomponent "cpone/component/table"
"cpone/models"
@@ -35,6 +36,7 @@ type MasterMenuUserService interface {
GetListMasterUserBySearch(search string) ([]models.MasterUser, error)
GetListMasterUserPagination(search string, currentPage int, rowPerPage int) ([]models.MasterUser, error)
GetListMasterUserFilteredBySearch(search string) ([]models.MasterUser, error)
GetListMasterUserGroupSearch() ([]models.UserGroupV1, error)
}
func NewMasterMenuUserHandler(us MasterMenuUserService) *MasterMenuUserHandler {
@@ -174,6 +176,18 @@ func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserV1(c echo.Context) err
zap.Any("data", dataBreadCrumb),
)
dataUserGroupAll, err := lh.MasterMenuUserService.GetListMasterUserGroupSearch()
fmt.Println(dataUserGroupAll)
fmt.Println(err)
if err != nil {
defer logger.Sync()
logger.Info("ERROR LIST USER GROUP ALL DEV",
zap.Any("error", err),
)
fmt.Println(dataUserGroupAll)
return err
}
// navbar menu
navbarmenuComponent := navbarmenu.NavbarMenu(dataMenu)
@@ -192,6 +206,9 @@ func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserV1(c echo.Context) err
inputansearchComponent := customtextfieldsearch.MainCustomTextFieldSearchV1("#"+contentIDSearch, "q", "Cari User Group", "text", "/dev/searchuserv1?"+link, "input changed delay:500ms, search", "#"+contentID, "#indicator", "", contentIDHtmxExtension)
listItemComponent := mastermenuuser.ItemDropdown(dataUserGroupAll)
dropdownComponent := customdropdown.MainCustomDropdown("User Group", "usergroup", "idusergroup", "#"+contentID, "", "indicator", listItemComponent)
// toast
// contentIDToast := utils.GenerateRandomID("toastmgu")
// toastComponent = customtoast.CustomToastV1("", contentIDHtmxExtension)
@@ -206,6 +223,7 @@ func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserV1(c echo.Context) err
pagination.PaginationV1(totalPages, 1, "/dev/userv1pagination", contentID, searchQueryParam),
contentID,
inputansearchComponent,
dropdownComponent,
)
si := mastermenuusergroup.ShowMasterMenuUserGroupV1x(
@@ -315,6 +333,7 @@ func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserSearchV1(c echo.Contex
pagination.PaginationV1(totalPages, 1, "/dev/userv1pagination", contentID, searchQueryParam),
contentID,
inputansearchComponent,
tablecomponent.DivEmpty(),
)
si := tabelusergroupComponent
@@ -419,6 +438,7 @@ func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserPaginationV1(c echo.Co
pagination.PaginationV1(totalPages, currentPage, "/dev/userv1pagination", contentID, searchQueryParam),
contentID,
inputansearchComponent,
tablecomponent.DivEmpty(),
)
// tabelusergroupComponent := mastermenuusergroup.TableRowV1(dataUserMaster)
@@ -427,3 +447,5 @@ func (lh *MasterMenuUserHandler) HandlerShowMasterMenuUserPaginationV1(c echo.Co
return utils.View(c, si)
}
// versi 2

View File

@@ -256,7 +256,6 @@ func (lh *MasterMenuUserGroupHandler) HandlerShowMasterMenuUserGroupV1(c echo.Co
link := "currentPage=1&page=" + strconv.Itoa(totalPages) + "&contentID=" + contentID
inputansearchComponent := customtextfieldsearch.MainCustomTextFieldSearchV1("#"+contentIDSearch, "q", "Cari User Group", "text", "/dev/searchusergroupv1?"+link, "input changed delay:500ms, search", "#"+contentID, "#indicator", "", contentIDHtmxExtension)
// toast
// contentIDToast := utils.GenerateRandomID("toastmgu")
// toastComponent = customtoast.CustomToastV1("", contentIDHtmxExtension)
@@ -271,6 +270,7 @@ func (lh *MasterMenuUserGroupHandler) HandlerShowMasterMenuUserGroupV1(c echo.Co
pagination.PaginationV1(totalPages, 1, "/dev/usergroupv1pagination", contentID, searchQueryParam),
contentID,
inputansearchComponent,
tablecomponent.DivEmpty(),
)
si := mastermenuusergroup.ShowMasterMenuUserGroupV1x(
@@ -526,6 +526,7 @@ func (lh *MasterMenuUserGroupHandler) HandlerShowMasterMenuUserGroupSearchV1(c e
pagination.PaginationV1(totalPages, 1, "/dev/usergroupv1pagination", contentID, searchQueryParam),
contentID,
inputansearchComponent,
tablecomponent.DivEmpty(),
)
si := tabelusergroupComponent
@@ -630,6 +631,7 @@ func (lh *MasterMenuUserGroupHandler) HandlerShowMasterMenuUserGroupPaginationV1
pagination.PaginationV1(totalPages, currentPage, "/dev/usergroupv1pagination", contentID, searchQueryParam),
contentID,
inputansearchComponent,
tablecomponent.DivEmpty(),
)
// tabelusergroupComponent := mastermenuusergroup.TableRowV1(dataUserGroup)