MobileNav komponentten Intranet erişimi
This commit is contained in:
parent
56233c54df
commit
3cff822775
5 changed files with 39 additions and 19 deletions
|
|
@ -72,6 +72,7 @@ public class NotificationAppService : ReadOnlyAppService<
|
|||
var now = Clock.Now.AddDays(-1);
|
||||
query = query
|
||||
.AsNoTracking()
|
||||
.Include(a => a.NotificationType)
|
||||
.Where(a => a.UserId == CurrentUser.Id)
|
||||
.Where(a => input.Channels.Contains(a.NotificationChannel))
|
||||
.WhereIf(input.IsRead.HasValue, a => a.IsRead == input.IsRead)
|
||||
|
|
@ -105,9 +106,11 @@ public class NotificationAppService : ReadOnlyAppService<
|
|||
{
|
||||
var query = await repository.GetQueryableAsync();
|
||||
|
||||
var item = await query.FirstOrDefaultAsync(a =>
|
||||
a.UserId == CurrentUser.Id &&
|
||||
a.Id == notificationId);
|
||||
var item = await query
|
||||
.Include(a => a.NotificationType)
|
||||
.FirstOrDefaultAsync(a =>
|
||||
a.UserId == CurrentUser.Id &&
|
||||
a.Id == notificationId);
|
||||
if (item == null)
|
||||
{
|
||||
throw new EntityNotFoundException(L["RecordNotFound"]);
|
||||
|
|
@ -134,9 +137,11 @@ public class NotificationAppService : ReadOnlyAppService<
|
|||
{
|
||||
var query = await repository.GetQueryableAsync();
|
||||
|
||||
var item = await query.FirstOrDefaultAsync(a =>
|
||||
a.UserId == CurrentUser.Id &&
|
||||
a.Id == notificationId);
|
||||
var item = await query
|
||||
.Include(a => a.NotificationType)
|
||||
.FirstOrDefaultAsync(a =>
|
||||
a.UserId == CurrentUser.Id &&
|
||||
a.Id == notificationId);
|
||||
if (item == null)
|
||||
{
|
||||
throw new EntityNotFoundException(L["RecordNotFound"]);
|
||||
|
|
|
|||
|
|
@ -84,7 +84,9 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
|||
ColumnOptionJson = DefaultColumnOptionJson(),
|
||||
PermissionJson = DefaultPermissionJson(AbpIdentity.PermissionGroups.Create, AbpIdentity.PermissionGroups.Default, AbpIdentity.PermissionGroups.Update, AbpIdentity.PermissionGroups.Delete, AbpIdentity.PermissionGroups.Export, AbpIdentity.PermissionGroups.Import, AbpIdentity.PermissionGroups.Note),
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(),
|
||||
InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
||||
new() { FieldName = "Id", FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }
|
||||
}),
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 350, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
|
|
@ -216,7 +218,9 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
|||
PermissionJson = DefaultPermissionJson(AbpIdentity.Permissions.Create, listFormName, AbpIdentity.Permissions.Update, AbpIdentity.Permissions.Delete, AbpIdentity.Permissions.Export, AbpIdentity.Permissions.Import, AbpIdentity.Permissions.Note),
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
TreeOptionJson = DefaultTreeOptionJson("Name", "ParentName", true),
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(),
|
||||
InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
||||
new() { FieldName = "Id", FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }
|
||||
}),
|
||||
EditingOptionJson = DefaultEditingOptionJson(listFormName, 600, 600, true, true, true, true, false),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
|
|
@ -2711,8 +2715,8 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
|
|||
{
|
||||
new() {
|
||||
Order=1, ColCount=2, ColSpan=1, ItemType="group", Items =[
|
||||
new EditingFormItemDto { Order = 1, DataField = "Title", ColSpan=2, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 2, DataField = "Excerpt", ColSpan=2, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 1, DataField = "Title", ColSpan=1, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 2, DataField = "Excerpt", ColSpan=1, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 3, DataField = "Content", ColSpan=2, EditorType2 = EditorTypes.dxHtmlEditor, EditorOptions = EditorOptionValues.HtmlEditorOptions },
|
||||
new EditingFormItemDto { Order = 4, DataField = "Category", ColSpan=1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
new EditingFormItemDto { Order = 5, DataField = "UserId", ColSpan=1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
|
||||
|
|
|
|||
|
|
@ -1064,7 +1064,9 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
|||
ColumnOptionJson = DefaultColumnOptionJson(),
|
||||
PermissionJson = DefaultPermissionJson(listFormName),
|
||||
PagerOptionJson = DefaultPagerOptionJson,
|
||||
InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(),
|
||||
InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
||||
new() { FieldName = "Id", FieldDbType = DbType.Guid, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }
|
||||
}),
|
||||
DeleteCommand = $"DELETE FROM \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.GlobalSearch))}\" WHERE \"Id\"=@Id",
|
||||
DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
||||
new() { FieldName = "Id", FieldDbType = DbType.Int32, Value = "@ID", CustomValueType = FieldCustomValueTypeEnum.CustomKey }
|
||||
|
|
|
|||
|
|
@ -1,16 +1,13 @@
|
|||
import { useState, Suspense, lazy } from 'react'
|
||||
import classNames from 'classnames'
|
||||
import Drawer from '@/components/ui/Drawer'
|
||||
import {
|
||||
DIR_RTL,
|
||||
MODE_DARK,
|
||||
NAV_MODE_DARK,
|
||||
NAV_MODE_THEMED,
|
||||
} from '@/constants/theme.constant'
|
||||
import { DIR_RTL, MODE_DARK, NAV_MODE_DARK, NAV_MODE_THEMED } from '@/constants/theme.constant'
|
||||
import withHeaderItem, { WithHeaderItemProps } from '@/utils/hoc/withHeaderItem'
|
||||
import NavToggle from '@/components/shared/NavToggle'
|
||||
import useResponsive from '@/utils/hooks/useResponsive'
|
||||
import { useStoreState } from '@/store'
|
||||
import { ROUTES_ENUM } from '@/routes/route.constant'
|
||||
import type { NavigationTree } from '@/proxy/menus/navigation'
|
||||
|
||||
const VerticalMenuContent = lazy(() => import('@/components/template/VerticalMenuContent'))
|
||||
|
||||
|
|
@ -20,6 +17,17 @@ type MobileNavToggleProps = {
|
|||
|
||||
const MobileNavToggle = withHeaderItem<MobileNavToggleProps & WithHeaderItemProps>(NavToggle)
|
||||
|
||||
const intranetDashboardNavItem: NavigationTree = {
|
||||
key: ROUTES_ENUM.protected.dashboard,
|
||||
path: ROUTES_ENUM.protected.dashboard,
|
||||
title: 'Intranet',
|
||||
translateKey: 'App.Intranet',
|
||||
icon: 'FaHome',
|
||||
type: 'item',
|
||||
authority: [],
|
||||
subMenu: [],
|
||||
}
|
||||
|
||||
const MobileNav = () => {
|
||||
const [isOpen, setIsOpen] = useState(false)
|
||||
|
||||
|
|
@ -51,6 +59,7 @@ const MobileNav = () => {
|
|||
}
|
||||
|
||||
const { mainMenu: navigationConfig } = useStoreState((state) => state.abpConfig.menu)
|
||||
const mobileNavigationConfig = [intranetDashboardNavItem, ...navigationConfig]
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
@ -75,7 +84,7 @@ const MobileNav = () => {
|
|||
<VerticalMenuContent
|
||||
navMode={mobileNavMode}
|
||||
collapsed={false}
|
||||
navigationTree={navigationConfig}
|
||||
navigationTree={mobileNavigationConfig}
|
||||
routeKey={currentRouteKey}
|
||||
userAuthority={userAuthority as string[]}
|
||||
direction={direction}
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ const VerticalMenuContent = (props: VerticalMenuContentProps) => {
|
|||
|
||||
return (
|
||||
<Menu
|
||||
className="px-4 pb-4"
|
||||
className="px-4 pb-4 pt-2"
|
||||
variant={navMode}
|
||||
sideCollapsed={collapsed}
|
||||
defaultActiveKeys={defaultActiveKeys}
|
||||
|
|
|
|||
Loading…
Reference in a new issue