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

V0.8.9 update #239

Merged
merged 13 commits into from
Feb 15, 2024
4 changes: 2 additions & 2 deletions BLAZAM/BLAZAM.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ServerGarbageCollection>false</ServerGarbageCollection>
<AssemblyVersion>0.8.8</AssemblyVersion>
<Version>2024.02.13.2312</Version>
<AssemblyVersion>0.8.9</AssemblyVersion>
<Version>2024.02.15.0147</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
Expand Down
11 changes: 6 additions & 5 deletions BLAZAM/Pages/Computers/ViewComputer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
string _fieldMudStackClasses = "flex-wrap gap-10";
}
<AppPageTitle>@Computer?.CanonicalName</AppPageTitle>
@if (Computer != null)
@if (Computer != null)
{
<EditForm OnValidSubmit=SaveChanges Context="editContext" Model="Computer">

<SetSubHeader>

<DirectoryEntryViewHeader DirectoryEntry="@Computer"
<DirectoryEntryViewHeader EditMode="@EditMode"
DirectoryEntry="@Computer"
OnAssignTo="@(()=>{AssignToModal?.Show();})"
OnChangeThumbnail="@(()=>{UploadThumbnailModal?.Show();})"
OnDelete="@DeleteComputer"
Expand Down Expand Up @@ -126,7 +127,7 @@





<Section Title=@AppLocalization["Drive Details"]>
<MudStack Row=true Class="@_fieldMudStackClasses">
Expand Down Expand Up @@ -290,7 +291,7 @@
{
if (await MessageService.Confirm("Are you sure you want to save the changes?"))
{
var jobResults= await Computer.CommitChangesAsync();
var jobResults = await Computer.CommitChangesAsync();
if (jobResults.Result == JobResult.Passed)
{

Expand All @@ -305,7 +306,7 @@
{
jobResults.ShowJobDetailsDialog(MessageService);
}


}
}
Expand Down
2 changes: 1 addition & 1 deletion BLAZAM/Pages/Groups/CreateGroup.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@



<MudTextField Label="Group Name" @bind-Value=@newGroupName />
<MudTextField Immediate=true Label="Group Name" @bind-Value=@newGroupName />



Expand Down
114 changes: 55 additions & 59 deletions BLAZAM/Pages/Groups/ViewGroup.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,34 @@



<EditForm Model="Group">


<SetSubHeader>
<DirectoryEntryViewHeader DirectoryEntry="@Group"
OnAssignTo="@(()=>{AssignToModal?.Show();})"
OnChangeThumbnail="@(()=>{UploadThumbnailModal?.Show();})"
OnDelete="@DeleteGroup"
OnMove="@(()=>{MoveToModal?.Show();})"
OnRename="@(()=>{RenameModal?.Show();})"
OnResetPassword="@(()=>{ChangePasswordModal?.Show();})"
OnShowHistory="@(()=>{ChangeHistoryModal?.Show();})"
OnToggleEditMode="@ToggleEditMode" />
<MudOverlay Visible="SavingChanges" DarkBackground="false" Absolute="true" />
</SetSubHeader>

<CascadingValue Value="EditMode">


<AppModal Title=@AppLocalization["Assign To"] @ref=@AssignToModal>
<AssignToModalContent OnGroupMembershipChange=@((change)=>{AssignToModal?.Hide(); InvokeAsync(StateHasChanged);}) DirectoryModel="Group" />
</AppModal>
<AppModal Title=@AppLocalization["Add Members"] @ref=@AssignMemberModal>
<AddMemberModalContent ModelChanged=@((change)=>{AssignMemberModal?.Hide();InvokeAsync(StateHasChanged);}) Group="Group" />
</AppModal>
<AppModal Title=@AppLocalization["Move To"] @ref=@MoveToModal>
@if (MoveToModal?.IsShown == true)
<EditForm Model="Group">


<SetSubHeader>
<DirectoryEntryViewHeader EditMode="@EditMode"
DirectoryEntry="@Group"
OnAssignTo="@(()=>{AssignToModal?.Show();})"
OnChangeThumbnail="@(()=>{UploadThumbnailModal?.Show();})"
OnDelete="@DeleteGroup"
OnMove="@(()=>{MoveToModal?.Show();})"
OnRename="@(()=>{RenameModal?.Show();})"
OnResetPassword="@(()=>{ChangePasswordModal?.Show();})"
OnShowHistory="@(()=>{ChangeHistoryModal?.Show();})"
OnToggleEditMode="@ToggleEditMode" />
<MudOverlay Visible="SavingChanges" DarkBackground="false" Absolute="true" />
</SetSubHeader>

<CascadingValue Value="EditMode">


<AppModal Title=@AppLocalization["Assign To"] @ref=@AssignToModal>
<AssignToModalContent OnGroupMembershipChange=@((change)=>{AssignToModal?.Hide(); InvokeAsync(StateHasChanged);}) DirectoryModel="Group" />
</AppModal>
<AppModal Title=@AppLocalization["Add Members"] @ref=@AssignMemberModal>
<AddMemberModalContent ModelChanged=@((change)=>{AssignMemberModal?.Hide();InvokeAsync(StateHasChanged);}) Group="Group" />
</AppModal>
<AppModal Title=@AppLocalization["Move To"] @ref=@MoveToModal>
@if (MoveToModal?.IsShown == true)
{
<MoveToOUModalContent DirectoryModel="Group" />
}
Expand All @@ -42,31 +43,26 @@
{
<RenameGroupModalContent Group="Group" />
}
</AppModal>

<AppModal Title=@AppLocalization["Rename Group"] @ref=@RenameModal>
@if (RenameModal?.IsShown == true)
</AppModal>


<AppModal Title=@AppLocalization["Change History"] @ref=@ChangeHistoryModal Options=@(new DialogOptions(){FullWidth=true,MaxWidth=MaxWidth.ExtraExtraLarge})>
@if (ChangeHistoryModal?.IsShown == true)
{
<RenameGroupModalContent Group="Group" />
<ChangeHistoryModalContent Model="Group" />
}
</AppModal>
<AppModal Title=@AppLocalization["Change History"] @ref=@ChangeHistoryModal Options=@(new DialogOptions(){FullWidth=true,MaxWidth=MaxWidth.ExtraExtraLarge})>
@if (ChangeHistoryModal?.IsShown == true)
{
<ChangeHistoryModalContent Model="Group" />
}
</AppModal>


<MudGrid>
<MudItem xs="12" md="6">
<Section Style="min-height:200px;" Title="Group Details">
<MudTextField Label="@AppLocalization["Group Name"]" @bind-Value="@Group.CanonicalName" Disabled />

<MudTextField Label="@AppLocalization["Account Name"]" @bind-Value="@Group.SamAccountName" Disabled />
<MudTextField Label="@AppLocalization["Account Name"]" @bind-Value="@Group.SamAccountName" Disabled />


<MudTextField Label="@AppLocalization["Email Address"]" @bind-Value="@Group.Email" Disabled=@(!EditMode || !Group.CanEditField(ActiveDirectoryFields.Mail)) />
<MudTextField Label="@AppLocalization["Email Address"]" @bind-Value="@Group.Email" Disabled=@(!EditMode || !Group.CanEditField(ActiveDirectoryFields.Mail)) />

<MudStack Row=true>
<MudText Typo="Typo.subtitle2">@AppLocalization["Created"]:</MudText>
Expand All @@ -84,30 +80,30 @@

</MudStack>

<MudStack Row=true>
<MudText Typo="Typo.subtitle2">@AppLocalization["OU"]:</MudText>

<MudStack Row=true>
<MudText Typo="Typo.subtitle2">@AppLocalization["OU"]:</MudText>
<MudSpacer />

<MudText Style="text-align:end;" Typo="Typo.caption">@Group.OU.ToPrettyOu()</MudText>
</MudStack>


</Section>
</MudItem>
<MudItem xs="12" md="6">
<Section Style="min-height:200px;" Title=@AppLocalization["Member Of"]>
<MemberOfList Model="Group" />
</Section>
</MudItem>
<MudItem xs="12" md="6">
<Section Style="min-height:200px;" Title=@AppLocalization["Member Of"]>
<MemberOfList Model="Group" />

</Section>
</MudItem>
<MudItem xs="12" md="12">
<Section Style="min-height:200px;" Title=@AppLocalization["Members"]>
<GroupMembersDataGrid Group="Group" />
</Section>
</MudItem>
<MudItem xs="12" md="12">
<Section Style="min-height:200px;" Title=@AppLocalization["Members"]>
<GroupMembersDataGrid Group="Group" />

</Section>
</MudItem>
</MudGrid>
</Section>
</MudItem>
</MudGrid>



Expand All @@ -121,7 +117,7 @@



@if (Group.HasUnsavedChanges)
@if (Group.HasUnsavedChanges)
{
<UnsavedChangesPrompt SaveChanges="SaveChanges" DiscardChanges="DiscardChanges" />
}
Expand Down Expand Up @@ -165,8 +161,8 @@
{
jobResults.ShowJobDetailsDialog(MessageService);
}


await InvokeAsync(StateHasChanged);

}
Expand Down
5 changes: 2 additions & 3 deletions BLAZAM/Pages/OU/CreateOU.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@



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



<MudButton Disabled=@(newOU==null || newOUName.IsNullOrEmpty()) Color="Color.Primary" OnClick="CreateNewOU">Next</MudButton>
<MudButton Disabled=@(parentOU==null || newOUName.IsNullOrEmpty()) Color="Color.Primary" OnClick="CreateNewOU">Next</MudButton>
</MudText>
</ChildContent>
<TabContent>
Expand All @@ -43,7 +43,6 @@
</TabContent>
</MudTabPanel>
</MudTabs>
<MudText>@($"Active Index: {selectedStep}")</MudText>


</Row>
Expand Down
40 changes: 22 additions & 18 deletions BLAZAM/Pages/OU/ViewOU.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

<SetSubHeader>

<DirectoryEntryViewHeader DirectoryEntry="@OU"
<DirectoryEntryViewHeader EditMode="@EditMode"
DirectoryEntry="@OU"
OnDelete="@DeleteOU"
OnMove="@(()=>{MoveToModal?.Show();})"
OnRename="@(()=>{RenameModal?.Show();})"
Expand Down Expand Up @@ -33,7 +34,7 @@

@if (OU != null)
{


<MudDataGrid RowClass="cursor-pointer"
Dense=true
Expand All @@ -44,23 +45,23 @@
Items="@OU.Children.OrderBy(x=>x.CanonicalName).OrderByDescending(x=>x.ObjectType)"
T=IDirectoryEntryAdapter
RowClick="@ChildClicked">
<ToolBarContent>
<ToolBarContent>
<MudText>@AppLocalization["Current OU"]: @OU.CanonicalName</MudText>

<MudSpacer />
<MudButton StartIcon="@Icons.Material.Filled.DriveFolderUpload"
OnClick="@(()=>{Nav.NavigateTo(parentOU.SearchUri);})">@parentOU?.CanonicalName</MudButton>

</ToolBarContent>
<Columns>
<TemplateColumn Title=@AppLocalization["Type"]>
<CellTemplate>
<MudIcon Icon="@context.Item.TypeIcon()" />
</CellTemplate>
</TemplateColumn>
<PropertyColumn Title="@AppLocalization["Name"]" Property="x=>x.CanonicalName" />
</Columns>
</MudDataGrid>
<MudSpacer />
<MudButton StartIcon="@Icons.Material.Filled.DriveFolderUpload"
OnClick="@(()=>{Nav.NavigateTo(parentOU.SearchUri);})">@parentOU?.CanonicalName</MudButton>

</ToolBarContent>
<Columns>
<TemplateColumn Title=@AppLocalization["Type"]>
<CellTemplate>
<MudIcon Icon="@context.Item.TypeIcon()" />
</CellTemplate>
</TemplateColumn>
<PropertyColumn Title="@AppLocalization["Name"]" Property="x=>x.CanonicalName" />
</Columns>
</MudDataGrid>
}

@if (OU.HasUnsavedChanges)
Expand All @@ -75,7 +76,10 @@
await base.OnInitializedAsync();
await InvokeAsync(StateHasChanged);
await AuditLogger.Searched(OU);
parentOU = OU.GetParent();
if (OU != null)
{
parentOU = OU.GetParent();
}
LoadingData = false;
await RefreshEntryComponents();
}
Expand Down
19 changes: 10 additions & 9 deletions BLAZAM/Pages/Printers/ViewPrinter.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
string _fieldMudStackClasses = "flex-wrap gap-10";
}
<AppPageTitle>@Printer?.CanonicalName</AppPageTitle>
@if (Printer != null)
@if (Printer != null)
{
<EditForm OnValidSubmit=SaveChanges Context="editContext" Model="Printer">

<SetSubHeader>

<DirectoryEntryViewHeader DirectoryEntry="@Printer"
OnDelete="@DeleteComputer"
OnMove="@(()=>{MoveToModal?.Show();})"
OnRename="@(()=>{RenameModal?.Show();})"
OnToggleEditMode="ToggleEditMode"/>
<DirectoryEntryViewHeader EditMode="@EditMode"
DirectoryEntry="@Printer"
OnDelete="@DeleteComputer"
OnMove="@(()=>{MoveToModal?.Show();})"
OnRename="@(()=>{RenameModal?.Show();})"
OnToggleEditMode="ToggleEditMode" />
<MudOverlay Visible="SavingChanges" DarkBackground="false" Absolute="true">

</MudOverlay>
Expand All @@ -27,7 +28,7 @@
<FlexContainer>



<AppModal Color="Color.Dark" Title="Move To" @ref=@MoveToModal>
@if (MoveToModal?.IsShown == true)
{
Expand Down Expand Up @@ -58,7 +59,7 @@

</Section>




@if (Printer.CanReadAnyCustomFields)
Expand Down Expand Up @@ -117,7 +118,7 @@
}



protected override async void DiscardChanges()
{
if (await MessageService.Confirm("Are you sure you want to discard your changes?", "Discard Changes"))
Expand Down
Loading
Loading