Feature: Quick Search
Device/Job/User Search refactoring. Quick-Search implemented.
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
|
||||
namespace Disco.Models.BI.Search
|
||||
{
|
||||
public class UserSearchResultItem
|
||||
{
|
||||
public int AssignedDevicesCount { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string GivenName { get; set; }
|
||||
public string Id { get; set; }
|
||||
public int JobCount { get; set; }
|
||||
public string Surname { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -63,8 +63,6 @@
|
||||
<Compile Include="BI\Interop\Community\UpdateRequestV1.cs" />
|
||||
<Compile Include="BI\Interop\Community\UpdateResponse.cs" />
|
||||
<Compile Include="BI\Job\Statistics\DailyOpenedClosedItem.cs" />
|
||||
<Compile Include="BI\Search\DeviceSearchResultItem.cs" />
|
||||
<Compile Include="BI\Search\UserSearchResultItem.cs" />
|
||||
<Compile Include="ClientServices\EnrolResponse.cs" />
|
||||
<Compile Include="ClientServices\MacEnrol.cs" />
|
||||
<Compile Include="ClientServices\MacEnrolResponse.cs" />
|
||||
@@ -111,6 +109,10 @@
|
||||
<Compile Include="Services\Jobs\JobLists\JobTableStatusItemModel.cs" />
|
||||
<Compile Include="Services\Jobs\JobLists\JobTableStatusQueueItemModel.cs" />
|
||||
<Compile Include="Services\Jobs\JobQueues\IJobQueueToken.cs" />
|
||||
<Compile Include="Services\Searching\DeviceSearchResultItem.cs" />
|
||||
<Compile Include="Services\Searching\ISearchResultItem.cs" />
|
||||
<Compile Include="Services\Searching\JobSearchResultItem.cs" />
|
||||
<Compile Include="Services\Searching\UserSearchResultItem.cs" />
|
||||
<Compile Include="UI\BaseUIModel.cs" />
|
||||
<Compile Include="UI\Config\AuthorizationRole\ConfigAuthorizationRoleCreateModel.cs" />
|
||||
<Compile Include="UI\Config\AuthorizationRole\ConfigAuthorizationRoleIndexModel.cs" />
|
||||
@@ -165,7 +167,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
|
||||
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -1,22 +1,34 @@
|
||||
using System;
|
||||
using Disco.Models.Services.Searching;
|
||||
using System;
|
||||
|
||||
namespace Disco.Models.Services.Jobs.JobLists
|
||||
{
|
||||
public class JobTableItemModel
|
||||
public class JobTableItemModel : JobSearchResultItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int JobId { get; set; }
|
||||
|
||||
[Obsolete("Use [int] JobId instead")]
|
||||
public override string Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.JobId.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Id = value;
|
||||
this.JobId = int.Parse(value);
|
||||
}
|
||||
}
|
||||
public DateTime OpenedDate { get; set; }
|
||||
public DateTime? ClosedDate { get; set; }
|
||||
public string JobTypeId { get; set; }
|
||||
public string JobTypeDescription { get; set; }
|
||||
public string DeviceSerialNumber { get; set; }
|
||||
public int? DeviceModelId { get; set; }
|
||||
public string DeviceModelDescription { get; set; }
|
||||
public int? DeviceProfileId { get; set; }
|
||||
public int? DeviceAddressId { get; set; }
|
||||
public string DeviceAddress { get; set; }
|
||||
public string UserId { get; set; }
|
||||
public string UserDisplayName { get; set; }
|
||||
public string OpenedTechUserId { get; set; }
|
||||
public string OpenedTechUserDisplayName { get; set; }
|
||||
public string StatusDescription { get; set; }
|
||||
|
||||
+13
-3
@@ -1,9 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.BI.Search
|
||||
namespace Disco.Models.Services.Searching
|
||||
{
|
||||
public class DeviceSearchResultItem
|
||||
public class DeviceSearchResultItem : ISearchResultItem
|
||||
{
|
||||
private const string type = "Device";
|
||||
|
||||
public string Id { get; set; }
|
||||
public string Type { get { return type; } }
|
||||
public string Description { get { return string.Format("{0} ({1})", this.Id, this.ComputerName); } }
|
||||
public string ScoreValue { get { return string.Format("{0} {1} {2} {3}", this.Id, this.AssignedUserId, this.AssignedUserDisplayName, this.AssetNumber); } }
|
||||
|
||||
public string AssetNumber { get; set; }
|
||||
public string AssignedUserDescription
|
||||
{
|
||||
@@ -26,6 +37,5 @@ namespace Disco.Models.BI.Search
|
||||
public string DeviceProfileDescription { get; set; }
|
||||
public int JobCount { get; set; }
|
||||
public DateTime? DecommissionedDate { get; set; }
|
||||
public string SerialNumber { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.Services.Searching
|
||||
{
|
||||
public interface ISearchResultItem
|
||||
{
|
||||
string Id { get; set; }
|
||||
string Type { get; }
|
||||
string Description { get; }
|
||||
string ScoreValue { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.Services.Searching
|
||||
{
|
||||
public class JobSearchResultItem : ISearchResultItem
|
||||
{
|
||||
private const string type = "Job";
|
||||
|
||||
public virtual string Id { get; set; }
|
||||
public string Type { get { return type; } }
|
||||
public string Description { get { return string.Format("{0} ({1}; {2})", this.Id, this.UserId, this.DeviceSerialNumber); } }
|
||||
public string ScoreValue { get { return string.Format("{0} {1} {2} {3}", this.Id, this.UserId, this.DeviceSerialNumber, this.UserDisplayName); } }
|
||||
|
||||
public string DeviceSerialNumber { get; set; }
|
||||
|
||||
public string UserId { get; set; }
|
||||
public string UserDisplayName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.Services.Searching
|
||||
{
|
||||
public class UserSearchResultItem : ISearchResultItem
|
||||
{
|
||||
private const string type = "User";
|
||||
|
||||
public string Id { get; set; }
|
||||
public string Type { get { return type; } }
|
||||
public string Description { get { return string.Format("{0} ({1})", this.DisplayName, this.Id); } }
|
||||
public string ScoreValue { get { return string.Format("{0} {1}", this.Id, this.DisplayName); } }
|
||||
|
||||
public int AssignedDevicesCount { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string GivenName { get; set; }
|
||||
public int JobCount { get; set; }
|
||||
public string Surname { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using Disco.Models.BI.Search;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Models.Services.Searching;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Models.UI.Search
|
||||
|
||||
Reference in New Issue
Block a user