Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more documentation links and align setting pages header style #646

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BLAZAM/BLAZAM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>false</ServerGarbageCollection>
<AssemblyVersion>1.1.0</AssemblyVersion>
<Version>2024.11.13.1850</Version>
<Version>2024.11.13.2234</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
Expand Down
4 changes: 2 additions & 2 deletions BLAZAM/Pages/Computers/ViewComputer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
Computer.Delete();
SnackBarService.Success(Computer.CanonicalName + " has been deleted.");
await AuditLogger.Computer.Deleted(Computer);
_ = OUNotificationService.PostAsync(Computer, NotificationType.Delete, CurrentUser.State);
_ = NotificationGenerationService.PostAsync(Computer, NotificationType.Delete, CurrentUser.State);

Nav.NavigateTo("/users/search");

Expand Down Expand Up @@ -328,7 +328,7 @@
}
if (changes.Any(c => c.Field != ActiveDirectoryFields.MemberOf.FieldName))
{
_ = OUNotificationService.PostAsync(Computer, NotificationType.Modify, CurrentUser.State);
_ = NotificationGenerationService.PostAsync(Computer, NotificationType.Modify, CurrentUser.State);
await AuditLogger.User.Changed(Computer, changes.Where(c => c.Field != ActiveDirectoryFields.MemberOf.FieldName).ToList());
}

Expand Down
4 changes: 2 additions & 2 deletions BLAZAM/Pages/Configure/Audit.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@



<AppPageTitle>Audit</AppPageTitle>
<h3>Audit</h3>
<AppPageTitle>@AppLocalization["Audit"]</AppPageTitle>
<MudText Typo="Typo.h4">@AppLocalization["Audit"]</MudText>



Expand Down
7 changes: 4 additions & 3 deletions BLAZAM/Pages/Configure/Fields.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
@inherits DatabaseComponentBase
@attribute [Authorize(Roles = UserRoles.SuperAdmin)]

<AppPageTitle>@AppLocalization["Fields"]</AppPageTitle>

<MudText Typo="Typo.h4">@AppLocalization["Fields"] <AppDocumentationButton Page="/admin/fields" /></MudText>
<MudDataGrid @ref=fieldGrid
T="CustomActiveDirectoryField"
ServerData="RefreshData"
Expand All @@ -11,10 +14,8 @@
FixedHeader=true
EditTrigger="DataGridEditTrigger.Manual">
<ToolBarContent>
<MudText Typo="Typo.h6">@AppLocalization["Fields"]</MudText>
<MudSpacer />
<MudIconButton Icon="@Icons.Material.Filled.Add" OnClick="@(()=>{addFieldModal?.ShowAsync();})" />
<AppDocumentationButton Page="/admin/fields" />
<MudIconButton Icon="@Icons.Material.Filled.Add" [email protected] OnClick="@(()=>{addFieldModal?.ShowAsync();})" />

</ToolBarContent>

Expand Down
4 changes: 2 additions & 2 deletions BLAZAM/Pages/Configure/Permissions.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
@attribute [Authorize(Roles = UserRoles.SuperAdmin)]

@inherits TabbedAppComponentBase
<AppPageTitle>@AppLocalization["Permissions"]</AppPageTitle>

<AppPageTitle>Permissions</AppPageTitle>
<AuthorizeView [email protected]>

<SetHeader>
Expand Down Expand Up @@ -48,7 +48,7 @@

@if (Monitor.DirectoryConnectionStatus == ServiceConnectionState.Up)
{
<ImpersonateUser />

<PermissionMapper />

}
Expand Down
2 changes: 1 addition & 1 deletion BLAZAM/Pages/Configure/Settings.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
@attribute [Authorize(Roles = UserRoles.SuperAdmin)]

@inherits TabbedAppComponentBase
<AppPageTitle>@AppLocalization["Settings"]</AppPageTitle>

<AppPageTitle>Settings</AppPageTitle>
<SetHeader>
</SetHeader>
<AuthorizeView>
Expand Down
2 changes: 2 additions & 0 deletions BLAZAM/Pages/Configure/Templates.razor
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@

</AppModal>
</SetHeader>

<MudText Typo="Typo.h4">@AppLocalization["Templates"] <AppDocumentationButton Page="/admin/templates" /></MudText>
@if (Templates.Count() > 0)
{

Expand Down
8 changes: 4 additions & 4 deletions BLAZAM/Pages/Groups/ViewGroup.razor
Original file line number Diff line number Diff line change
Expand Up @@ -161,20 +161,20 @@
{
await AuditLogger.User.Assigned(assignment.Member, assignment.Group);
await AuditLogger.Group.MemberAdded(assignment.Group, assignment.Member);
_ = OUNotificationService.PostAsync(assignment.Member, NotificationType.GroupAssignment, CurrentUser.State, Group);
_ = NotificationGenerationService.PostAsync(assignment.Member, NotificationType.GroupAssignment, CurrentUser.State, Group);

}

foreach (var assignment in unassignFrom)
{
await AuditLogger.User.Unassigned(assignment.Member, assignment.Group);
await AuditLogger.Group.MemberRemoved(assignment.Group, assignment.Member);
_ = OUNotificationService.PostAsync(assignment.Member, NotificationType.GroupAssignment, CurrentUser.State, Group);
_ = NotificationGenerationService.PostAsync(assignment.Member, NotificationType.GroupAssignment, CurrentUser.State, Group);

}
if (changes.Any(c => c.Field != "member"))
{
_ = OUNotificationService.PostAsync(Group, NotificationType.Modify, CurrentUser.State);
_ = NotificationGenerationService.PostAsync(Group, NotificationType.Modify, CurrentUser.State);
await AuditLogger.Group.Changed(Group, changes.Where(c => c.Field != ActiveDirectoryFields.MemberOf.FieldName).ToList());
}
//await AuditLogger.Group.Changed(Group, Group.Changes);
Expand Down Expand Up @@ -205,7 +205,7 @@
Group.Delete();
SnackBarService.Success(Group.CanonicalName + " has been deleted.");
await AuditLogger.Group.Deleted(Group);
_ = OUNotificationService.PostAsync(Group, NotificationType.Delete, CurrentUser.State);
_ = NotificationGenerationService.PostAsync(Group, NotificationType.Delete, CurrentUser.State);

//Group = null;
Nav.NavigateTo("/groups/search");
Expand Down
71 changes: 27 additions & 44 deletions BLAZAM/Pages/OU/CreateOU.razor
Original file line number Diff line number Diff line change
@@ -1,49 +1,37 @@
@page "/ou/create"
@inherits TabbedAppComponentBase
@attribute [Authorize]
<AppPageTitle>@AppLocalization["Create OU"]</AppPageTitle>

<AppPageTitle>Create OU</AppPageTitle>

<MudTabs Elevation="0" Outlined="true" @bind-ActivePanelIndex="selectedStep">
<MudTabPanel>
<ChildContent>
<MudText>

<MudTabs Elevation="0" Outlined="true" @bind-ActivePanelIndex="selectedStep">
<MudTabPanel>
<ChildContent>
<MudText>
<OUTreeView Label="Parent Organizational Unit"
SelectedEntryChanged="OUSelected"/>

<OUTreeView Label="Parent Organizational Unit"
SelectedEntryChanged="OUSelected">
@* <NodeContent>
@context.Name
</NodeContent>*@
</OUTreeView>
<MudTextField Immediate=true Label="Organizational Unit Name" @bind-Value=@newOUName />


<MudButton Disabled=@(parentOU==null || newOUName.IsNullOrEmpty()) Color="Color.Primary" OnClick="CreateNewOU">Next</MudButton>
</MudText>
</ChildContent>
<TabContent>
Create
</TabContent>
</MudTabPanel>
<MudTabPanel Disabled=@(newOU==null || newOUName.IsNullOrEmpty())>
<ChildContent>
<MudText>
<ConfirmNewOU OU="@newOU" />
</MudText>
</ChildContent>
<TabContent>
Confirm
</TabContent>
</MudTabPanel>
</MudTabs>



<MudTextField Immediate=true Label="Organizational Unit Name" @bind-Value=@newOUName />



<MudButton Disabled=@(parentOU==null || newOUName.IsNullOrEmpty()) Color="Color.Primary" OnClick="CreateNewOU">Next</MudButton>
</MudText>
</ChildContent>
<TabContent>
Create
</TabContent>
</MudTabPanel>
<MudTabPanel Disabled=@(newOU==null || newOUName.IsNullOrEmpty())>
<ChildContent>
<MudText>
<ConfirmNewOU OU="@newOU" />
</MudText>
</ChildContent>
<TabContent>
Confirm
</TabContent>
</MudTabPanel>
</MudTabs>




Expand All @@ -53,11 +41,6 @@

int selectedStep;






string newOUName;
IADOrganizationalUnit? parentOU;
IADOrganizationalUnit? newOU;
Expand Down Expand Up @@ -101,7 +84,7 @@
async void CreateNewOU()
{
LoadingData = true;

newOU = parentOU?.CreateOU(newOUName);


Expand Down
29 changes: 17 additions & 12 deletions BLAZAM/Pages/OU/ViewOU.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@inherits DirectoryEntryViewBase
@inject NotificationGenerationService OUNotificationService

<AppPageTitle>@OU?.CanonicalName</AppPageTitle>

Expand Down Expand Up @@ -87,21 +86,27 @@
}
async void SaveChanges()
{
if (await MessageService.Confirm("Are you sure you want to save the changes?", "Save Changes"))
if (OU != null)
{
var changes = OU?.Changes;
await OU.CommitChangesAsync();
EditMode = false;
//Nav.WarnOnNavigation = false;
await AuditLogger.OU.Changed(OU, changes);
_ = OUNotificationService.PostAsync(OU, NotificationType.Modify, CurrentUser.State);
if (await MessageService.Confirm("Are you sure you want to save the changes?", "Save Changes"))
{
var changes = OU?.Changes;
await OU.CommitChangesAsync();
EditMode = false;
//Nav.WarnOnNavigation = false;
await AuditLogger.OU.Changed(OU, changes);
_ = NotificationGenerationService.PostAsync(OU, NotificationType.Modify, CurrentUser.State);

SnackBarService.Success("The changes made to this ou have been saved.");
await RefreshEntryComponents();
SnackBarService.Success(AppLocalization["The changes made to this ou have been saved."]);
await RefreshEntryComponents();


}
}
else
{
SnackBarService.Error("OU is null");
}

}
void ChildClicked(DataGridRowClickEventArgs<IDirectoryEntryAdapter> args)
{
Expand All @@ -116,7 +121,7 @@
OU.Delete();
SnackBarService.Success(OU.CanonicalName + " has been deleted.");
await AuditLogger.OU.Deleted(OU);
_ = OUNotificationService.PostAsync(OU, NotificationType.Delete, CurrentUser.State);
_ = NotificationGenerationService.PostAsync(OU, NotificationType.Delete, CurrentUser.State);


Nav.NavigateTo("/ou/search");
Expand Down
2 changes: 1 addition & 1 deletion BLAZAM/Pages/Recycle Bin/RecycleBin.razor
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@page "/recyclebin"
@inherits AppComponentBase
@attribute [Authorize(Roles = UserRoles.SuperAdmin)]
<AppPageTitle>@AppLocalization["Recycle Bin"]</AppPageTitle>

<AppPageTitle>Recycle Bin</AppPageTitle>

<MudDataGrid T="IDirectoryEntryAdapter"
Virtualize=true
Expand Down
3 changes: 2 additions & 1 deletion BLAZAM/Pages/Users/CreateUser.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
{
<AppNavLock />
}
<AppPageTitle>Create User</AppPageTitle>
<AppPageTitle>@AppLocalization["Create User"]</AppPageTitle>

<MudContainer MaxWidth="MaxWidth.ExtraExtraLarge">
<MudTabs PanelClass="mx-auto w-100"
@ref=Tabs
Expand Down
8 changes: 4 additions & 4 deletions BLAZAM/Pages/Users/ViewUser.razor
Original file line number Diff line number Diff line change
Expand Up @@ -666,20 +666,20 @@
{
await AuditLogger.User.Assigned(assignment.Member, assignment.Group);
await AuditLogger.Group.MemberAdded(assignment.Group, assignment.Member);
_ = OUNotificationService.PostAsync(User, NotificationType.GroupAssignment, CurrentUser.State, assignment.Group);
_ = NotificationGenerationService.PostAsync(User, NotificationType.GroupAssignment, CurrentUser.State, assignment.Group);

}

foreach (var assignment in unassignFrom)
{
await AuditLogger.User.Unassigned(assignment.Member, assignment.Group);
await AuditLogger.Group.MemberRemoved(assignment.Group, assignment.Member);
_ = OUNotificationService.PostAsync(User, NotificationType.GroupAssignment, CurrentUser.State, assignment.Group);
_ = NotificationGenerationService.PostAsync(User, NotificationType.GroupAssignment, CurrentUser.State, assignment.Group);

}
if (changes.Any(c => c.Field != ActiveDirectoryFields.MemberOf.FieldName))
{
_ = OUNotificationService.PostAsync(User, NotificationType.Modify, CurrentUser.State);
_ = NotificationGenerationService.PostAsync(User, NotificationType.Modify, CurrentUser.State);
await AuditLogger.User.Changed(User, changes.Where(c => c.Field != ActiveDirectoryFields.MemberOf.FieldName).ToList());
}

Expand Down Expand Up @@ -729,7 +729,7 @@

SnackBarService.Success(User.DisplayName + " has been deleted.");
await AuditLogger.User.Deleted(User);
_ = OUNotificationService.PostAsync(User, NotificationType.Delete, CurrentUser.State);
_ = NotificationGenerationService.PostAsync(User, NotificationType.Delete, CurrentUser.State);

}
catch (ApplicationException ex)
Expand Down
2 changes: 1 addition & 1 deletion BLAZAMActiveDirectory/Adapters/ADOrganizationalUnit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public IADUser CreateUser(string containerName)
/// Directory.
/// </summary>
/// <param name="containerName">The container name of the new group</param>
/// <returns>An uncommited group</returns>
/// <returns>An uncommitted group</returns>
public IADGroup CreateGroup(string containerName)
{
EnsureDirectoryEntry();
Expand Down
2 changes: 1 addition & 1 deletion BLAZAMGui/UI/DirectoryEntryViewBase.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace BLAZAM.Gui.UI
public class DirectoryEntryViewBase : DatabaseComponentBase
{
[Inject]
public NotificationGenerationService OUNotificationService { get; set; }
public NotificationGenerationService NotificationGenerationService { get; set; }
[Parameter]
public IDirectoryEntryAdapter DirectoryEntry { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ else
<MudButton Size="Size.Small"
Variant="Variant.Filled"
StartIcon="@Icons.Material.Filled.ThumbUpAlt"
OnClick="@(()=>{_approvalModal.ShowAsync();})"
OnClick="@(()=>{_=_approvalModal.ShowAsync();})"
Color="Color.Success">@AppLocalization["Approve"]</MudButton>
</MudStack>

Expand Down
20 changes: 0 additions & 20 deletions BLAZAMGui/UI/Search/SearchControls.razor
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,13 @@

@if (IsAdmin == true || CurrentUser.State?.CanSearchDisabled(ActiveDirectoryObjectType.User) == true)
{
var buttonColor = Color.Error;
if (!SearchService.IncludeDisabled)

{
buttonColor = Color.Success;
}
@* <MudButton Size=Size.Small
Class="d-flex"
Variant="Variant.Filled"
ButtonType="ButtonType.Button"
OnClick=@(async()=>{
SearchService.IncludeDisabled= !SearchService.IncludeDisabled;
await InvokeAsync(StateHasChanged);
}) Color=buttonColor>
@AppLocalization["Enabled Only"]
</MudButton> *@


<MudSwitch Class="d-flex align-middle"
Size=Size.Small
@bind-Value=SearchService.IncludeDisabled
UncheckedColor="Color.Error"
Color=Color.Success>
@AppLocalization["Include Disabled"]
</MudSwitch>


}
@{
var adornmentIcon = Icons.Material.Filled.AccountTree;
Expand Down
Loading
Loading