Skip to content

Commit

Permalink
Merge pull request #711 from Blazam-App/v1-Nightly
Browse files Browse the repository at this point in the history
V1.2.3 update
  • Loading branch information
jacobsen9026 authored Dec 21, 2024
2 parents 9ddfb68 + 7d1e4cc commit 0d0dada
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 41 deletions.
6 changes: 3 additions & 3 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>1.2.2</AssemblyVersion>
<Version>2024.12.14.0307</Version>
<AssemblyVersion>1.2.3</AssemblyVersion>
<Version>2024.12.19.2303</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<RootNamespace>BLAZAM</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
Expand Down Expand Up @@ -67,7 +67,7 @@
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.11" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
<PackageReference Include="MudBlazor" Version="7.15.0" />
Expand Down
3 changes: 2 additions & 1 deletion BLAZAM/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
{
if (Monitor.AppReady == ServiceConnectionState.Up)
{
waitingForLoadToComplete = false;
await Task.Delay(2500); // Initial delay
Nav.NavigateTo("/install", true);
}
Expand All @@ -95,7 +96,7 @@
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
Monitor.OnAppReadyChanged += AppReady;
//Monitor.OnAppReadyChanged += AppReady;
}
private void AppReady(ServiceConnectionState newStatus)
Expand Down
2 changes: 1 addition & 1 deletion BLAZAMActiveDirectory/BLAZAMActiveDirectory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="System.Management" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion BLAZAMCommon/BLAZAMCommon.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<PackageReference Include="System.DirectoryServices" Version="9.0.0" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.1" />
<PackageReference Include="System.DirectoryServices.Protocols" Version="9.0.0" />
<PackageReference Include="System.Management" Version="8.0.0" />
<PackageReference Include="System.Management" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions BLAZAMEmailMessage/Email/Base/EmailHeaderIcon.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<div class="v-container-padding-padding" style="max-width: 50px;min-width: 25px; overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:'Open Sans',sans-serif;" align="left">
{{ApplicationLogo}}
</div>
<div class="v-container-padding-padding" style="width: 1px;height:1px;">
@* <div class="v-container-padding-padding" style="width: 1px;height:1px;">
{{TrackingImgLink}}
</div>
</div> *@


@code {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</EmailTemplateHeader>

<EmailTemplateBody>
@EntryName @AppLocalization["has been assigned to"])
@EntryName @AppLocalization["has been assigned to"] @GroupName
<br/>


Expand All @@ -17,11 +17,15 @@
@code{
[Parameter]
public string EntryName { get; set; }

public override string Render() => new ComponentRenderer<EntryUnassignedEmailMessage>()

[Parameter]
public string GroupName { get; set; }
public override string Render() => new ComponentRenderer<EntryAssignedEmailMessage>()
.UseLayout<DefaultEmailLayout>()
.AddServiceProvider(ApplicationInfo.services)
.Set(c => c.EntryName, EntryName).Render();
.Set(c => c.EntryName, EntryName)

.Set(c => c.GroupName, GroupName).Render();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</EmailTemplateHeader>

<EmailTemplateBody>
EntryName + AppLocalization[" has been created."])
@EntryName @AppLocalization[" has been created."]
<br/>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</EmailTemplateHeader>

<EmailTemplateBody>
@EntryName @AppLocalization["has been unassigned from"])
@EntryName @AppLocalization["has been unassigned from"] @GroupName
<br/>


Expand All @@ -17,11 +17,15 @@
@code{
[Parameter]
public string EntryName { get; set; }
[Parameter]
public string GroupName { get; set; }

public override string Render() => new ComponentRenderer<EntryUnassignedEmailMessage>()
.UseLayout<DefaultEmailLayout>()
.AddServiceProvider(ApplicationInfo.services)
.Set(c => c.EntryName, EntryName).Render();
.Set(c => c.EntryName, EntryName)
.Set(c => c.GroupName, GroupName)
.Render();
}


Expand Down
4 changes: 3 additions & 1 deletion BLAZAMGui/UI/Inputs/TreeViews/OUTreeView.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<MudTreeView T="IDirectoryEntryAdapter"
ServerData="GetOUChildrenAsync"
Items="RootOU"
@ref=treeView
Dense="true"
SelectionMode="SelectionMode.SingleSelection"
Hover="true"
MaxHeight="400px"
Color="Color.Primary"
Expand All @@ -18,7 +20,7 @@
@bind-Activated=context.Selected
Text="@context.Value?.CanonicalName"
Icon="@Icons.Material.Filled.Folder"
IconColor="@(context.Selected==true?Color.Primary:Color.Default)"
IconColor=@(GetIconColor(context))
Class="minw-max w-100"
CanExpand=@(context.Value is IADOrganizationalUnit)
Context="treeContext"
Expand Down
36 changes: 16 additions & 20 deletions BLAZAMGui/UI/Inputs/TreeViews/OUTreeViewBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class OUTreeViewBase : AppComponentBase
protected ADOrganizationalUnit TopLevel;
private IADOrganizationalUnit? _startingSelectedNode;
private IDirectoryEntryAdapter? _selectedEntry;

protected MudTreeView<IDirectoryEntryAdapter>? treeView;
[Parameter]
public bool StartRootExpanded { get; set; } = true;

Expand Down Expand Up @@ -60,26 +60,31 @@ public IDirectoryEntryAdapter? SelectedEntry
if (value == _selectedEntry) return;
if (value != null)
{
var firstSet = true;
if (_selectedEntry != null)
firstSet = false;

var cache = _selectedEntry;

_selectedEntry = value;
if (cache == null && RootOU.Count > 0 && value == RootOU.First()) return;


InvokeAsync(() => { SelectedEntryChanged.InvokeAsync(value); });



//if (TopLevel == null)
// OnInitializedAsync();

if (RootOU.Count > 0)
OpenToSelected();

//if (RootOU.Count > 0 && firstSet)
// OpenToSelected();

}
}

}

protected Color GetIconColor(TreeItemData<IDirectoryEntryAdapter>context)
{
return context.Selected == true ? Color.Primary : Color.Default;
}
[Parameter]
public EventCallback<IDirectoryEntryAdapter> SelectedEntryChanged { get; set; }
/// <summary>
Expand Down Expand Up @@ -124,24 +129,14 @@ protected async Task InitializeTreeView()
{
await Task.Run(() =>
{

//ApplicationBaseOUs = Directory.OUs.FindSubOusByDN(null);


if (RootOU is null || RootOU.Count < 1)
{
TopLevel = new ADOrganizationalUnit();
TopLevel.Parse(directory: Directory, directoryEntry: Directory.GetDirectoryEntry());
_ = TopLevel.SubOUs;
var TopLevelList = new List<IDirectoryEntryAdapter>() { TopLevel };
// RootOU = new HashSet<IDirectoryEntryAdapter>() { TopLevel as IDirectoryEntryAdapter };
RootOU = TopLevelList.ToTreeItemData();
}
if (StartingSelectedOU == null)
{
//StartingSelectedOU = TopLevel;

}

OpenToSelected();
LoadingData = false;
Expand Down Expand Up @@ -186,14 +181,15 @@ protected void OpenToSelected()

while (openThis != null)
{

openThis.Children = GetChildren(openThis);
var child = openThis.Children.Where(
c => SelectedEntry.DN.Contains(c.Value.DN)
&& !SelectedEntry.DN.Equals(c.Value.DN)
).FirstOrDefault();
if (child != null)
{

child.Expanded = true;

openThis = child;
Expand Down
4 changes: 2 additions & 2 deletions BLAZAMServices/BLAZAMServices.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<PackageReference Include="DuoUniversal" Version="1.2.5" />
<PackageReference Include="MailKit" Version="4.8.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.11" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.11" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageReference Include="PreMailer.Net" Version="2.6.0" />
</ItemGroup>
Expand Down
7 changes: 5 additions & 2 deletions BLAZAMServices/Background/NotificationGenerationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ public void PackageNotification(IDirectoryEntryAdapter source, NotificationType
notificationBody += _appLocalization["was removed from"] + " <a href=\"" + target.SearchUri + "\" class=\"mud-typography mud-link mud-primary-text mud-link-underline-hover mud-typography-caption\">" + target.CanonicalName + "</a> " + _appLocalization[" at "] + time;

var groupMemberRemovedMessage = NotificationType.Unassign.ToNotification<EntryUnassignedEmailMessage>();
groupMemberRemovedMessage.EntryName = source.CanonicalName;
groupMemberRemovedMessage.EntryName = source?.CanonicalName;
groupMemberRemovedMessage.GroupName = target?.CanonicalName;
emailMessage = groupMemberRemovedMessage;
break;
case NotificationType.Assign:
Expand All @@ -201,7 +202,9 @@ public void PackageNotification(IDirectoryEntryAdapter source, NotificationType
notificationBody += _appLocalization["was assigned to"] + " <a href=\"" + target.SearchUri + "\" class=\"mud-typography mud-link mud-primary-text mud-link-underline-hover mud-typography-caption\">" + target.CanonicalName + "</a> " + _appLocalization[" at "] + time;

var groupMemberAssignedMessage = NotificationType.Assign.ToNotification<EntryAssignedEmailMessage>();
groupMemberAssignedMessage.EntryName = source.CanonicalName;
groupMemberAssignedMessage.EntryName = source?.CanonicalName;
groupMemberAssignedMessage.GroupName = target?.CanonicalName;

emailMessage = groupMemberAssignedMessage;
break;
case NotificationType.PasswordChange:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BLAZAM
Proudly serving

![image](https://github.com/user-attachments/assets/32c47f17-cd57-47a1-b029-b3c19900d429)
![image](https://github.com/user-attachments/assets/cae7fc08-2036-4f44-a948-11a8f74fa929)


## Version 1.0.0 Release Notice
Expand Down

0 comments on commit 0d0dada

Please sign in to comment.