From 46222f2a78f16dbd486646d82f183e0619606dbf Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Thu, 9 Nov 2023 20:48:16 +1100 Subject: [PATCH] hide decommissioned device profiles and batches by default when updating a devices batch or profile --- Disco.Models/UI/Device/DeviceShowModel.cs | 2 + Disco.Web/ClientSource/Style/Device.css | 4 + Disco.Web/ClientSource/Style/Device.less | 3 + Disco.Web/ClientSource/Style/Device.min.css | 2 +- Disco.Web/Controllers/DeviceController.cs | 24 +- Disco.Web/Models/Device/ShowModel.cs | 2 + .../Views/Device/DeviceParts/_Subject.cshtml | 52 +- .../Device/DeviceParts/_Subject.generated.cs | 492 +++++++++++------- 8 files changed, 375 insertions(+), 206 deletions(-) diff --git a/Disco.Models/UI/Device/DeviceShowModel.cs b/Disco.Models/UI/Device/DeviceShowModel.cs index b785b3a5..b6456ee4 100644 --- a/Disco.Models/UI/Device/DeviceShowModel.cs +++ b/Disco.Models/UI/Device/DeviceShowModel.cs @@ -10,9 +10,11 @@ namespace Disco.Models.UI.Device Repository.Device Device { get; set; } List DeviceProfiles { get; set; } + HashSet DecommissionedDeviceProfileIds { get; set; } OrganisationAddress DeviceProfileDefaultOrganisationAddress { get; set; } List DeviceBatches { get; set; } + HashSet DecommissionedDeviceBatchIds { get; set; } JobTableModel Jobs { get; set; } diff --git a/Disco.Web/ClientSource/Style/Device.css b/Disco.Web/ClientSource/Style/Device.css index 4a0887ac..80025d53 100644 --- a/Disco.Web/ClientSource/Style/Device.css +++ b/Disco.Web/ClientSource/Style/Device.css @@ -213,6 +213,10 @@ background-color: #cddbec; font-weight: 600; } +#Device_Show_Policies_Profile_Actions_Update_Dialog label, +#Device_Show_Policies_Batch_Actions_Update_Dialog label { + display: block; +} #DeviceDetailTab-JobsContainer div.jobTable { margin: -1px; border: 1px solid #ddd; diff --git a/Disco.Web/ClientSource/Style/Device.less b/Disco.Web/ClientSource/Style/Device.less index cead4c00..85cb9991 100644 --- a/Disco.Web/ClientSource/Style/Device.less +++ b/Disco.Web/ClientSource/Style/Device.less @@ -185,6 +185,9 @@ } } } + label { + display: block; + } } #DeviceDetailTab-JobsContainer { diff --git a/Disco.Web/ClientSource/Style/Device.min.css b/Disco.Web/ClientSource/Style/Device.min.css index db72a124..450e99c6 100644 --- a/Disco.Web/ClientSource/Style/Device.min.css +++ b/Disco.Web/ClientSource/Style/Device.min.css @@ -1 +1 @@ -.tableData{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableData>tbody>tr>td{border:solid 1px #f4f4f4;background-color:#fff;}.tableData>tbody>tr:nth-child(odd)>td{background-color:hsl(0,0%,98.5%);}.tableData>thead>tr>th,.tableData>tbody>tr>th{background-color:#f4f4f4;border:solid 1px #f4f4f4;}.tableData>tbody>tr:hover>td{background-color:hsl(0,0%,97.5%);}.tableData>tfoot>tr>th,.tableData>tfoot>tr>td{background-color:#f4f4f4;}.tableDataDark{border:solid 1px #d8d8d8;border-collapse:collapse;}.tableDataDark td{border:solid 1px #d8d8d8;background-color:#fff;}.tableDataDark th{background-color:#eee;border:solid 1px #d8d8d8;}.tableDataContainer{background-color:#fff;}.tableDataVertical{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableDataVertical>tbody>tr:nth-child(odd){background-color:#f4f4f4;margin:0;padding:0;}.tableDataVertical>tbody>tr>th.name{width:170px;text-align:right;}.tableDataVertical table.sub>tbody>tr:not(:first-child)>th,.tableDataVertical table.sub>tbody>tr:not(:first-child)>td{border-top:1px dashed #aaa;}.tableDataVertical table.sub>tbody>tr>th{font-weight:normal;text-align:right;}.tableDataVertical table.sub>tbody>tr>th.name{text-align:right;}.icon16{display:inline-block;height:16px;width:16px;margin-left:2px;cursor:pointer;}.subtleUntilHover{-moz-opacity:.3;opacity:.3;}.subtleUntilHover:hover{-moz-opacity:1;opacity:1;}#layout_PageHeading #Device_Show_Status{margin-left:20px;display:inline-block;height:50px;font-family:"Segoe UI",Arial,Verdana,Tahoma,sans-serif;font-weight:lighter;font-stretch:condensed;font-size:.7em;text-transform:uppercase;}#layout_PageHeading #Device_Show_Status span.icon{margin-right:6px;}#Device_Show #Device_Show_Subjects{table-layout:fixed;}#Device_Show #Device_Show_Subjects>tbody>tr>td{padding-top:0;height:100%;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div{position:relative;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div div.status{margin-top:2px;padding-top:2px;border-top:1px dashed #ddd;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div input.discreet{margin-left:-2px;}#Device_Show #Device_Show_Subjects>tbody>tr>td:not(:last-child){border-right:1px dashed #aaa;}#Device_Show #Device_Show_Subjects #Device_Show_Details table.verticalHeadings>tbody>tr>td:first-child{width:104px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Name{font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Enrolled_Trusted{display:inline-block;height:16px;padding-left:16px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACWUlEQVQ4y6XRXWiSURgHcJsXa4WNNuuyiy6CoAupixERoXXhmljuxaJiFrVA1i72cVFCOSMt8rNt2YfGO5g5Z1NstWW+c4ZBq4QpqMkEbZDSCObAMprjdf90sIjxsgUdODd/zvmd5zwPCwDrf/aGB7q6utgmk8ngdruzVqt10eVyTWu1Wuk/AXK5vMpoNPpjsRgGbU8/9fbdH/J4PAuRSARKpfLKhoBYLG595nTCaDSZVjPp6TPbHQ5H0mAwfBeJRHXrAp0dna9JcqCguX2H/Xd+S625aLFYQBDE8XWBd+8/TI6Njc+vzcfGX4nLX4FOp5OuC0wGAlS53NzaPPAm2Gi32+H3+5tYJEl+pigKoVAIPp+PnpqaosPhMF1uHB2Px2mv14vya6VgMKhhHGN3d/dSMplENptFIpHA3NwcCoUCSqUSKqvScZVKBbPZHGQEFApFMZ1OI5PJIBqNrkD5fB40Ta8AlcrUajVsNpufEbh+42YxHEkh+/UbUqlZpGd/lAH8WTMzMzDd64d7NMAMDOobi/OpHqh6rqK9jcCvBQncQzK0Xm5DPn0BJ4lz6GgVIkedYAaamxqK0dEDePl4FziczehTsZGLs7BnNwdiwRac4lejvp6La83VzABv/8FF/qG9oD/WQS/fhNptHEw8rEJiuAo7ubXACAtH9m0Fu2YHxQzweEuEVIYnaiFmvQ04f1aItksi5KaP4ZFGjDB5GG/7j4LL5YYYgZYW2c/yiJbv6h/A0EvC4RjGiOsFnK4J+KgABmyjsDufL0skki8CgYCoXOLz+TWrwG+kXMkgQ6yv+QAAAABJRU5ErkJggg==);background-repeat:no-repeat;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Photo_Container{float:left;padding-right:2px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Photo{max-width:48px;height:auto;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags{font-size:16px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i{cursor:default;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i>.details{display:none;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_GenerateDocument_Container{padding-top:4px;}#Device_Show #Device_Show_Subjects #Device_Show_Policies table.verticalHeadings>tbody>tr>td:first-child{width:120px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Aspects #Device_Show_Aspects_Model_Image{display:block;width:256px;height:256px;margin:0 auto;}#Device_Show #Device_Show_Subjects #Device_Show_Subjects_Actions>td{padding-top:4px;}#DeviceDetailTabs{margin-top:10px;border-radius:0;background-image:none;background-color:#fff;border:0;padding:0;}#DeviceDetailTabs #DeviceDetailTabItems{border-radius:0;border-top:1px solid #ddd;border-right:1px solid #ddd;border-left:1px solid #ddd;border-bottom:0;padding:2px 0 0 4px;background-image:none;background-color:#eee;display:table;}#DeviceDetailTabs #DeviceDetailTabItems>li{top:0;border-radius:0;margin:0 5px 0 0;padding:0;line-height:normal;margin-right:4px;}#DeviceDetailTabs #DeviceDetailTabItems>li>a{padding:5px 8px;}#DeviceDetailTabs div.ui-tabs-panel{border-radius:0;padding:4px;border-right:1px solid #ddd;border-bottom:1px solid #ddd;border-left:1px solid #ddd;border-top:0;background-color:#eee;}#Device_Show_Policies_Profile_Actions_Update_Dialog ul li,#Device_Show_Policies_Batch_Actions_Update_Dialog ul li{background-color:#fff;padding:2px 0 2px 4px;}#Device_Show_Policies_Profile_Actions_Update_Dialog ul li:nth-child(odd),#Device_Show_Policies_Batch_Actions_Update_Dialog ul li:nth-child(odd){background-color:hsl(0,0%,98.5%);}#Device_Show_Policies_Profile_Actions_Update_Dialog ul li.selected,#Device_Show_Policies_Batch_Actions_Update_Dialog ul li.selected{background-color:#cddbec;font-weight:600;}#DeviceDetailTab-JobsContainer div.jobTable{margin:-1px;border:1px solid #ddd;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_filter{margin-top:-24px;-moz-opacity:1;opacity:1;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_length{margin-top:-24px;-moz-opacity:1;opacity:1;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_showStatusClosed{right:220px;margin-top:-24px;}#DeviceDetailTab-DetailsContainer>table{border:solid 1px #f4f4f4;border-collapse:collapse;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>td{border:solid 1px #f4f4f4;background-color:#fff;}#DeviceDetailTab-DetailsContainer>table>tbody>tr:nth-child(odd)>td{background-color:hsl(0,0%,98.5%);}#DeviceDetailTab-DetailsContainer>table>thead>tr>th,#DeviceDetailTab-DetailsContainer>table>tbody>tr>th{background-color:#f4f4f4;border:solid 1px #f4f4f4;}#DeviceDetailTab-DetailsContainer>table>tbody>tr:hover>td{background-color:hsl(0,0%,97.5%);}#DeviceDetailTab-DetailsContainer>table>tfoot>tr>th,#DeviceDetailTab-DetailsContainer>table>tfoot>tr>td{background-color:#f4f4f4;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>th{width:150px;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>th,#DeviceDetailTab-DetailsContainer>table>tbody>tr>td.pad{padding:10px 6px;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition{position:relative;height:40px;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span{position:absolute;display:block;height:40px;box-sizing:border-box;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:#f4f4f4;padding:2px;line-height:18px;border:1px solid #cacaca;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span .details{position:relative;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span .freespace{position:absolute;top:0;height:40px;display:block;background-color:#fff;background:repeating-linear-gradient(45deg,#f4f4f4,#f4f4f4 10px,#fff 10px,#fff 20px);}#deviceShowResources #AttachmentsContainer{padding:0;}#deviceShowResources #Attachments{position:relative;border:1px solid #ccc;background-color:#fff;}#deviceShowResources #Attachments div.attachmentOutput{position:relative;height:115px;overflow:auto;}#deviceShowResources #Attachments div.attachmentOutput>a{display:block;float:left;height:48px;width:221px;padding:2px;margin:2px;font-size:.9em;border:1px solid #fff;color:#000;text-decoration:none;}#deviceShowResources #Attachments div.attachmentOutput>a span.comments,#deviceShowResources #Attachments div.attachmentOutput>a span.author,#deviceShowResources #Attachments div.attachmentOutput>a span.timestamp{display:block;float:left;width:168px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:16px;}#deviceShowResources #Attachments div.attachmentOutput>a span.author{color:#888;width:150px;}#deviceShowResources #Attachments div.attachmentOutput>a span.timestamp{color:#888;font-style:italic;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon{display:block;float:left;height:48px;width:48px;margin-right:2px;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon img{height:48px;width:48px;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon img.loading{display:none;}#deviceShowResources #Attachments div.attachmentOutput>a:hover{background-color:#ededed;border:1px solid #ccc;}#deviceShowResources #Attachments div.attachmentOutput>a:hover span.remove{opacity:.5;}#deviceShowResources #Attachments div.attachmentOutput>a span.remove{font-size:1.4em;color:#e51400;margin-left:6px;cursor:pointer;opacity:0;}#deviceShowResources #Attachments div.attachmentOutput>a span.remove:hover{opacity:1;}#deviceShowResources #Attachments div.attachmentInput{border-top:1px solid #ccc;height:40px;background-color:#fff;padding:3px;}#deviceShowResources #Attachments div.attachmentInput span.action{color:#333;display:block;margin:0 4px 0 0;font-size:1.5em;cursor:pointer;float:right;border:1px solid #fff;padding:.5em;}#deviceShowResources #Attachments div.attachmentInput span.action:hover{color:#335a87;background-color:#ededed;border:1px solid #ccc;}#deviceShowResources #Attachments div.attachmentInput span.action.disabled{color:rgba(51,51,51,.2);cursor:default;}#deviceShowResources #Attachments div.attachmentInput span.action.disabled:hover{color:rgba(51,51,51,.2);background-color:inherit;border:1px solid #fff;}#Devices_Export .Devices_Export_Type_Target{margin-top:10px;display:none;}#Devices_Export #Devices_Export_Fields #Devices_Export_Fields_Defaults{font-size:.75em;}#Devices_Export #Devices_Export_Fields th{font-size:1.05em;}#Devices_Export #Devices_Export_Fields th span{margin-top:4px;font-size:.8em;}#Devices_Export_Download_Dialog{padding-top:20px;text-align:center;}#Devices_Export_Download_Dialog h4{margin-bottom:30px;}#Devices_Export_Download_Dialog a{margin-bottom:20px;}#Devices_Export_Exporting{padding-top:50px;text-align:center;}#Devices_Export_Exporting i{margin-right:10px;color:#1e6dab;}#Devices_Import #ImportFile{width:96%;margin-bottom:8px;}#Devices_Import #Devices_Import_Documentation{width:700px;margin:20px auto;}#Devices_Import #Devices_Import_Documentation>table>tbody th:first-child{width:220px;}#Devices_Import_Completed_Dialog{padding:50px 0;text-align:center;}#Devices_Import_Completed_Dialog h3{margin-bottom:16px;}#Devices_Import_Completed_Dialog i{margin-right:10px;color:#60a917;}#Devices_Import_Loading_Dialog{padding-top:50px;text-align:center;}#Devices_Import_Loading_Dialog i{margin-right:10px;color:#1e6dab;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer{margin:18px 0;overflow-x:auto;border:1px solid #ccc;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead{white-space:nowrap;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead ul.importHeaderType>li>a>span:not(.ui-menu-icon){padding-right:16px;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead ul.importHeaderType ul{z-index:1000;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead td.headerIgnoreColumn{background-color:#fa6800;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead td:not(.headerIgnoreColumn){background-color:#1e6dab;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>tbody td.headerDeviceSerialNumber{border-top-color:#d1e6f7;border-bottom-color:#d1e6f7;background-color:#e2f0fa;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>tbody td.headerIgnoreColumn{max-width:150px;white-space:nowrap;overflow:hidden;-ms-text-overflow:ellipsis;-o-text-overflow:ellipsis;text-overflow:ellipsis;color:#ccc;}#Devices_Import_Parsing_Dialog{padding-top:50px;text-align:center;}#Devices_Import_Parsing_Dialog i{margin-right:10px;color:#1e6dab;}#Devices_Import_Review #Devices_Import_Review_Navigation{margin-top:15px;text-align:right;}#Devices_Import_Review #Devices_Import_Review_Navigation ul{display:inline-block;padding:0;border:1px solid #bbb;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li{display:inline-block;padding:3px 10px;margin:0;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionDetached{background-color:#ffd0cc;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionModified{background-color:#e2f0fa;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionAdded{background-color:#e7f9d5;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionUnchanged{background-color:hsl(0,0%,98.5%);}#Devices_Import_Review #Devices_Import_Review_TableContainer{margin:18px 0;overflow-x:auto;border:1px solid #ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>thead{white-space:nowrap;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>thead tr:nth-child(2) th{padding-top:0;font-weight:normal;font-size:.9em;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.action{text-align:center;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionDetached td.action i:before{color:#e51400;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionDetached td{background-color:#ffe7e5;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td.action i:before{content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td{background-color:hsl(0,0%,98.5%);}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td:nth-child(n+3){color:#ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionModified td.action i:before{color:#1e6dab;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionModified td{background-color:#f4f9fd;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionAdded td.action i:before{color:#60a917;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionAdded td{background-color:#e7f9d5;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr:not(.actionUnchanged) td.actionUnchanged:nth-child(n+3):not(.headerDeviceSerialNumber){color:#ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionError{color:#e51400;background-color:#fff1ef;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionError span.errorMessage{display:none;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionModified{background-color:#e2f0fa!important;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceSerialNumber,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceDecommissionedDate,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceDecommissionedReason,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerModelId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerBatchId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerProfileId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerAssignedUserId{white-space:nowrap;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody span.smallMessage{color:inherit;} \ No newline at end of file +.tableData{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableData>tbody>tr>td{border:solid 1px #f4f4f4;background-color:#fff;}.tableData>tbody>tr:nth-child(odd)>td{background-color:hsl(0,0%,98.5%);}.tableData>thead>tr>th,.tableData>tbody>tr>th{background-color:#f4f4f4;border:solid 1px #f4f4f4;}.tableData>tbody>tr:hover>td{background-color:hsl(0,0%,97.5%);}.tableData>tfoot>tr>th,.tableData>tfoot>tr>td{background-color:#f4f4f4;}.tableDataDark{border:solid 1px #d8d8d8;border-collapse:collapse;}.tableDataDark td{border:solid 1px #d8d8d8;background-color:#fff;}.tableDataDark th{background-color:#eee;border:solid 1px #d8d8d8;}.tableDataContainer{background-color:#fff;}.tableDataVertical{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableDataVertical>tbody>tr:nth-child(odd){background-color:#f4f4f4;margin:0;padding:0;}.tableDataVertical>tbody>tr>th.name{width:170px;text-align:right;}.tableDataVertical table.sub>tbody>tr:not(:first-child)>th,.tableDataVertical table.sub>tbody>tr:not(:first-child)>td{border-top:1px dashed #aaa;}.tableDataVertical table.sub>tbody>tr>th{font-weight:normal;text-align:right;}.tableDataVertical table.sub>tbody>tr>th.name{text-align:right;}.icon16{display:inline-block;height:16px;width:16px;margin-left:2px;cursor:pointer;}.subtleUntilHover{-moz-opacity:.3;opacity:.3;}.subtleUntilHover:hover{-moz-opacity:1;opacity:1;}#layout_PageHeading #Device_Show_Status{margin-left:20px;display:inline-block;height:50px;font-family:"Segoe UI",Arial,Verdana,Tahoma,sans-serif;font-weight:lighter;font-stretch:condensed;font-size:.7em;text-transform:uppercase;}#layout_PageHeading #Device_Show_Status span.icon{margin-right:6px;}#Device_Show #Device_Show_Subjects{table-layout:fixed;}#Device_Show #Device_Show_Subjects>tbody>tr>td{padding-top:0;height:100%;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div{position:relative;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div div.status{margin-top:2px;padding-top:2px;border-top:1px dashed #ddd;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div input.discreet{margin-left:-2px;}#Device_Show #Device_Show_Subjects>tbody>tr>td:not(:last-child){border-right:1px dashed #aaa;}#Device_Show #Device_Show_Subjects #Device_Show_Details table.verticalHeadings>tbody>tr>td:first-child{width:104px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Name{font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Enrolled_Trusted{display:inline-block;height:16px;padding-left:16px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACWUlEQVQ4y6XRXWiSURgHcJsXa4WNNuuyiy6CoAupixERoXXhmljuxaJiFrVA1i72cVFCOSMt8rNt2YfGO5g5Z1NstWW+c4ZBq4QpqMkEbZDSCObAMprjdf90sIjxsgUdODd/zvmd5zwPCwDrf/aGB7q6utgmk8ngdruzVqt10eVyTWu1Wuk/AXK5vMpoNPpjsRgGbU8/9fbdH/J4PAuRSARKpfLKhoBYLG595nTCaDSZVjPp6TPbHQ5H0mAwfBeJRHXrAp0dna9JcqCguX2H/Xd+S625aLFYQBDE8XWBd+8/TI6Njc+vzcfGX4nLX4FOp5OuC0wGAlS53NzaPPAm2Gi32+H3+5tYJEl+pigKoVAIPp+PnpqaosPhMF1uHB2Px2mv14vya6VgMKhhHGN3d/dSMplENptFIpHA3NwcCoUCSqUSKqvScZVKBbPZHGQEFApFMZ1OI5PJIBqNrkD5fB40Ta8AlcrUajVsNpufEbh+42YxHEkh+/UbUqlZpGd/lAH8WTMzMzDd64d7NMAMDOobi/OpHqh6rqK9jcCvBQncQzK0Xm5DPn0BJ4lz6GgVIkedYAaamxqK0dEDePl4FziczehTsZGLs7BnNwdiwRac4lejvp6La83VzABv/8FF/qG9oD/WQS/fhNptHEw8rEJiuAo7ubXACAtH9m0Fu2YHxQzweEuEVIYnaiFmvQ04f1aItksi5KaP4ZFGjDB5GG/7j4LL5YYYgZYW2c/yiJbv6h/A0EvC4RjGiOsFnK4J+KgABmyjsDufL0skki8CgYCoXOLz+TWrwG+kXMkgQ6yv+QAAAABJRU5ErkJggg==);background-repeat:no-repeat;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Photo_Container{float:left;padding-right:2px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Photo{max-width:48px;height:auto;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags{font-size:16px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i{cursor:default;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i>.details{display:none;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_GenerateDocument_Container{padding-top:4px;}#Device_Show #Device_Show_Subjects #Device_Show_Policies table.verticalHeadings>tbody>tr>td:first-child{width:120px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Aspects #Device_Show_Aspects_Model_Image{display:block;width:256px;height:256px;margin:0 auto;}#Device_Show #Device_Show_Subjects #Device_Show_Subjects_Actions>td{padding-top:4px;}#DeviceDetailTabs{margin-top:10px;border-radius:0;background-image:none;background-color:#fff;border:0;padding:0;}#DeviceDetailTabs #DeviceDetailTabItems{border-radius:0;border-top:1px solid #ddd;border-right:1px solid #ddd;border-left:1px solid #ddd;border-bottom:0;padding:2px 0 0 4px;background-image:none;background-color:#eee;display:table;}#DeviceDetailTabs #DeviceDetailTabItems>li{top:0;border-radius:0;margin:0 5px 0 0;padding:0;line-height:normal;margin-right:4px;}#DeviceDetailTabs #DeviceDetailTabItems>li>a{padding:5px 8px;}#DeviceDetailTabs div.ui-tabs-panel{border-radius:0;padding:4px;border-right:1px solid #ddd;border-bottom:1px solid #ddd;border-left:1px solid #ddd;border-top:0;background-color:#eee;}#Device_Show_Policies_Profile_Actions_Update_Dialog ul li,#Device_Show_Policies_Batch_Actions_Update_Dialog ul li{background-color:#fff;padding:2px 0 2px 4px;}#Device_Show_Policies_Profile_Actions_Update_Dialog ul li:nth-child(odd),#Device_Show_Policies_Batch_Actions_Update_Dialog ul li:nth-child(odd){background-color:hsl(0,0%,98.5%);}#Device_Show_Policies_Profile_Actions_Update_Dialog ul li.selected,#Device_Show_Policies_Batch_Actions_Update_Dialog ul li.selected{background-color:#cddbec;font-weight:600;}#Device_Show_Policies_Profile_Actions_Update_Dialog label,#Device_Show_Policies_Batch_Actions_Update_Dialog label{display:block;}#DeviceDetailTab-JobsContainer div.jobTable{margin:-1px;border:1px solid #ddd;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_filter{margin-top:-24px;-moz-opacity:1;opacity:1;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_length{margin-top:-24px;-moz-opacity:1;opacity:1;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_showStatusClosed{right:220px;margin-top:-24px;}#DeviceDetailTab-DetailsContainer>table{border:solid 1px #f4f4f4;border-collapse:collapse;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>td{border:solid 1px #f4f4f4;background-color:#fff;}#DeviceDetailTab-DetailsContainer>table>tbody>tr:nth-child(odd)>td{background-color:hsl(0,0%,98.5%);}#DeviceDetailTab-DetailsContainer>table>thead>tr>th,#DeviceDetailTab-DetailsContainer>table>tbody>tr>th{background-color:#f4f4f4;border:solid 1px #f4f4f4;}#DeviceDetailTab-DetailsContainer>table>tbody>tr:hover>td{background-color:hsl(0,0%,97.5%);}#DeviceDetailTab-DetailsContainer>table>tfoot>tr>th,#DeviceDetailTab-DetailsContainer>table>tfoot>tr>td{background-color:#f4f4f4;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>th{width:150px;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>th,#DeviceDetailTab-DetailsContainer>table>tbody>tr>td.pad{padding:10px 6px;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition{position:relative;height:40px;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span{position:absolute;display:block;height:40px;box-sizing:border-box;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:#f4f4f4;padding:2px;line-height:18px;border:1px solid #cacaca;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span .details{position:relative;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span .freespace{position:absolute;top:0;height:40px;display:block;background-color:#fff;background:repeating-linear-gradient(45deg,#f4f4f4,#f4f4f4 10px,#fff 10px,#fff 20px);}#deviceShowResources #AttachmentsContainer{padding:0;}#deviceShowResources #Attachments{position:relative;border:1px solid #ccc;background-color:#fff;}#deviceShowResources #Attachments div.attachmentOutput{position:relative;height:115px;overflow:auto;}#deviceShowResources #Attachments div.attachmentOutput>a{display:block;float:left;height:48px;width:221px;padding:2px;margin:2px;font-size:.9em;border:1px solid #fff;color:#000;text-decoration:none;}#deviceShowResources #Attachments div.attachmentOutput>a span.comments,#deviceShowResources #Attachments div.attachmentOutput>a span.author,#deviceShowResources #Attachments div.attachmentOutput>a span.timestamp{display:block;float:left;width:168px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:16px;}#deviceShowResources #Attachments div.attachmentOutput>a span.author{color:#888;width:150px;}#deviceShowResources #Attachments div.attachmentOutput>a span.timestamp{color:#888;font-style:italic;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon{display:block;float:left;height:48px;width:48px;margin-right:2px;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon img{height:48px;width:48px;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon img.loading{display:none;}#deviceShowResources #Attachments div.attachmentOutput>a:hover{background-color:#ededed;border:1px solid #ccc;}#deviceShowResources #Attachments div.attachmentOutput>a:hover span.remove{opacity:.5;}#deviceShowResources #Attachments div.attachmentOutput>a span.remove{font-size:1.4em;color:#e51400;margin-left:6px;cursor:pointer;opacity:0;}#deviceShowResources #Attachments div.attachmentOutput>a span.remove:hover{opacity:1;}#deviceShowResources #Attachments div.attachmentInput{border-top:1px solid #ccc;height:40px;background-color:#fff;padding:3px;}#deviceShowResources #Attachments div.attachmentInput span.action{color:#333;display:block;margin:0 4px 0 0;font-size:1.5em;cursor:pointer;float:right;border:1px solid #fff;padding:.5em;}#deviceShowResources #Attachments div.attachmentInput span.action:hover{color:#335a87;background-color:#ededed;border:1px solid #ccc;}#deviceShowResources #Attachments div.attachmentInput span.action.disabled{color:rgba(51,51,51,.2);cursor:default;}#deviceShowResources #Attachments div.attachmentInput span.action.disabled:hover{color:rgba(51,51,51,.2);background-color:inherit;border:1px solid #fff;}#Devices_Export .Devices_Export_Type_Target{margin-top:10px;display:none;}#Devices_Export #Devices_Export_Fields #Devices_Export_Fields_Defaults{font-size:.75em;}#Devices_Export #Devices_Export_Fields th{font-size:1.05em;}#Devices_Export #Devices_Export_Fields th span{margin-top:4px;font-size:.8em;}#Devices_Export_Download_Dialog{padding-top:20px;text-align:center;}#Devices_Export_Download_Dialog h4{margin-bottom:30px;}#Devices_Export_Download_Dialog a{margin-bottom:20px;}#Devices_Export_Exporting{padding-top:50px;text-align:center;}#Devices_Export_Exporting i{margin-right:10px;color:#1e6dab;}#Devices_Import #ImportFile{width:96%;margin-bottom:8px;}#Devices_Import #Devices_Import_Documentation{width:700px;margin:20px auto;}#Devices_Import #Devices_Import_Documentation>table>tbody th:first-child{width:220px;}#Devices_Import_Completed_Dialog{padding:50px 0;text-align:center;}#Devices_Import_Completed_Dialog h3{margin-bottom:16px;}#Devices_Import_Completed_Dialog i{margin-right:10px;color:#60a917;}#Devices_Import_Loading_Dialog{padding-top:50px;text-align:center;}#Devices_Import_Loading_Dialog i{margin-right:10px;color:#1e6dab;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer{margin:18px 0;overflow-x:auto;border:1px solid #ccc;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead{white-space:nowrap;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead ul.importHeaderType>li>a>span:not(.ui-menu-icon){padding-right:16px;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead ul.importHeaderType ul{z-index:1000;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead td.headerIgnoreColumn{background-color:#fa6800;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead td:not(.headerIgnoreColumn){background-color:#1e6dab;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>tbody td.headerDeviceSerialNumber{border-top-color:#d1e6f7;border-bottom-color:#d1e6f7;background-color:#e2f0fa;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>tbody td.headerIgnoreColumn{max-width:150px;white-space:nowrap;overflow:hidden;-ms-text-overflow:ellipsis;-o-text-overflow:ellipsis;text-overflow:ellipsis;color:#ccc;}#Devices_Import_Parsing_Dialog{padding-top:50px;text-align:center;}#Devices_Import_Parsing_Dialog i{margin-right:10px;color:#1e6dab;}#Devices_Import_Review #Devices_Import_Review_Navigation{margin-top:15px;text-align:right;}#Devices_Import_Review #Devices_Import_Review_Navigation ul{display:inline-block;padding:0;border:1px solid #bbb;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li{display:inline-block;padding:3px 10px;margin:0;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionDetached{background-color:#ffd0cc;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionModified{background-color:#e2f0fa;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionAdded{background-color:#e7f9d5;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionUnchanged{background-color:hsl(0,0%,98.5%);}#Devices_Import_Review #Devices_Import_Review_TableContainer{margin:18px 0;overflow-x:auto;border:1px solid #ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>thead{white-space:nowrap;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>thead tr:nth-child(2) th{padding-top:0;font-weight:normal;font-size:.9em;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.action{text-align:center;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionDetached td.action i:before{color:#e51400;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionDetached td{background-color:#ffe7e5;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td.action i:before{content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td{background-color:hsl(0,0%,98.5%);}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td:nth-child(n+3){color:#ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionModified td.action i:before{color:#1e6dab;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionModified td{background-color:#f4f9fd;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionAdded td.action i:before{color:#60a917;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionAdded td{background-color:#e7f9d5;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr:not(.actionUnchanged) td.actionUnchanged:nth-child(n+3):not(.headerDeviceSerialNumber){color:#ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionError{color:#e51400;background-color:#fff1ef;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionError span.errorMessage{display:none;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionModified{background-color:#e2f0fa!important;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceSerialNumber,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceDecommissionedDate,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceDecommissionedReason,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerModelId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerBatchId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerProfileId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerAssignedUserId{white-space:nowrap;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody span.smallMessage{color:inherit;} \ No newline at end of file diff --git a/Disco.Web/Controllers/DeviceController.cs b/Disco.Web/Controllers/DeviceController.cs index 1ea1147f..57b4810c 100644 --- a/Disco.Web/Controllers/DeviceController.cs +++ b/Disco.Web/Controllers/DeviceController.cs @@ -245,10 +245,30 @@ namespace Disco.Web.Controllers //} if (Authorization.Has(Claims.Device.Properties.DeviceProfile)) - m.DeviceProfiles = Database.DeviceProfiles.ToList(); + { + var profiles = Database.DeviceProfiles.Select(dp => + new + { + Profile = dp, + DecommissionedCount = dp.Devices.Count(d => d.DecommissionedDate.HasValue), + DeviceCount = dp.Devices.Count(), + }).ToList(); + m.DeviceProfiles = profiles.Select(p => p.Profile).OrderBy(p => p.Name).ToList(); + m.DecommissionedDeviceProfileIds = new HashSet(profiles.Where(p => p.DeviceCount > 0 && p.DecommissionedCount == p.DeviceCount).Select(p => p.Profile.Id)); + } if (Authorization.Has(Claims.Device.Properties.DeviceBatch)) - m.DeviceBatches = Database.DeviceBatches.ToList(); + { + var batches = Database.DeviceBatches.Select(db => + new + { + Batch = db, + DecommissionedCount = db.Devices.Count(d => d.DecommissionedDate.HasValue), + DeviceCount = db.Devices.Count(), + }).ToList(); + m.DeviceBatches = batches.Select(b => b.Batch).OrderBy(b => b.Name).ToList(); + m.DecommissionedDeviceBatchIds = new HashSet(batches.Where(b => b.DeviceCount > 0 && b.DecommissionedCount == b.DeviceCount).Select(b => b.Batch.Id)); + } if (Authorization.Has(Claims.Device.ShowJobs)) { diff --git a/Disco.Web/Models/Device/ShowModel.cs b/Disco.Web/Models/Device/ShowModel.cs index 22cc971a..92f25923 100644 --- a/Disco.Web/Models/Device/ShowModel.cs +++ b/Disco.Web/Models/Device/ShowModel.cs @@ -14,11 +14,13 @@ namespace Disco.Web.Models.Device public Disco.Models.Repository.Device Device { get; set; } public List DeviceProfiles { get; set; } + public HashSet DecommissionedDeviceProfileIds { get; set; } public Disco.Models.BI.Config.OrganisationAddress DeviceProfileDefaultOrganisationAddress { get; set; } public List DeviceProfileCertificateProviders { get; set; } public List DeviceProfileWirelessProfileProviders { get; set; } public List DeviceBatches { get; set; } + public HashSet DecommissionedDeviceBatchIds { get; set; } public JobTableModel Jobs { get; set; } public List Certificates { get; set; } diff --git a/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml b/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml index ab223811..1bcc55ce 100644 --- a/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml +++ b/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml @@ -393,11 +393,23 @@
    @foreach (var dp in Model.DeviceProfiles.OrderBy(i => i.Name)) { -
  • - + var isDecommissioned = Model.DecommissionedDeviceProfileIds.Contains(dp.Id); +
  • +
  • + if (isDecommissioned) + { + + } }
+ @if (Model.DecommissionedDeviceProfileIds.Count > 0) + { + Show Decommissioned + } \r\n"); - #line 455 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 477 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -1818,13 +1865,13 @@ WriteLiteral(" class=\"status\""); WriteLiteral(">\r\n"); - #line 458 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 480 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 458 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 480 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.DeviceBatchId.HasValue) { @@ -1838,13 +1885,13 @@ WriteLiteral(" title=\"Device Batch\""); WriteLiteral(">\r\n"); - #line 461 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 483 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 461 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 483 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Authorization.Has(Claims.Config.DeviceBatch.Show)) { @@ -1852,14 +1899,14 @@ WriteLiteral(">\r\n"); #line default #line hidden - #line 463 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 485 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLink(Model.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Device.DeviceBatchId.Value))); #line default #line hidden - #line 463 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 485 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } else @@ -1869,14 +1916,14 @@ WriteLiteral(">\r\n"); #line default #line hidden - #line 467 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 489 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Model.Device.DeviceBatch.Name); #line default #line hidden - #line 467 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 489 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -1900,7 +1947,7 @@ WriteLiteral(">Purchased:\r\n \r\n WriteLiteral(" "); - #line 476 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 498 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.PurchaseDate)); @@ -1918,7 +1965,7 @@ WriteLiteral(">Supplier:\r\n \r\n WriteLiteral(" "); - #line 484 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 506 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Model.Device.DeviceBatch.Supplier ?? "Unknown"); @@ -1933,14 +1980,14 @@ WriteLiteral(" title=\"Warranty Valid Until\""); WriteLiteral(">Warranty Until:\r\n \r\n " + " (Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null + #line 513 "..\..\Views\Device\DeviceParts\_Subject.cshtml" +, Tuple.Create(Tuple.Create("", 32549), Tuple.Create(Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null #line default #line hidden -, 31049), false) +, 32549), false) ); WriteLiteral(">\r\n"); @@ -1948,7 +1995,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 492 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 514 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.WarrantyValidUntil, "Unknown", null)); @@ -1966,7 +2013,7 @@ WriteLiteral(">Insurance Supplier:\r\n Insured Until:\r\n \r\n " + " (Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null + #line 529 "..\..\Views\Device\DeviceParts\_Subject.cshtml" +, Tuple.Create(Tuple.Create("", 33551), Tuple.Create(Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null #line default #line hidden -, 32051), false) +, 33551), false) ); WriteLiteral(">\r\n"); @@ -1996,7 +2043,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 508 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 530 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.InsuredUntil, "Unknown", null)); @@ -2006,7 +2053,7 @@ WriteLiteral("\r\n \r\n " \r\n"); - #line 512 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 534 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } else { @@ -2017,7 +2064,7 @@ WriteLiteral("\r\n \r\n WriteLiteral("

Batch: Not Associated

\r\n"); - #line 516 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 538 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2026,7 +2073,7 @@ WriteLiteral("

Batch: Not Associated

\r\ WriteLiteral(" "); - #line 517 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 539 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanUpdateDeviceBatch()) { @@ -2034,14 +2081,14 @@ WriteLiteral(" "); #line default #line hidden - #line 519 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 541 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Update Batch", MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber, null, true), "Device_Show_Policies_Batch_Actions_Update_Button")); #line default #line hidden - #line 519 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 541 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -2063,29 +2110,54 @@ WriteLiteral(" class=\"none\""); WriteLiteral(">\r\n"); - #line 524 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 546 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 524 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 546 "..\..\Views\Device\DeviceParts\_Subject.cshtml" foreach (var db in Model.DeviceBatches.OrderBy(i => i.Name)) { + var isDecommissioned = Model.DecommissionedDeviceBatchIds.Contains(db.Id); #line default #line hidden -WriteLiteral("
  • \r\n " + -" (isDecommissioned ? "hidden" : null + + #line default + #line hidden +, 34878), false) +); + +WriteLiteral(">\r\n (db.PurchaseDate.ToLongDateString() + + #line default + #line hidden +, 34988), false) +); + +WriteLiteral(">\r\n (db.Id - - #line default - #line hidden -, 33384), false) -); +WriteLiteral(" />\r\n"); -WriteLiteral(" />(db.Id - - #line default - #line hidden -, 33420), false) -); - -WriteAttribute("title", Tuple.Create(" title=\"", 33429), Tuple.Create("\"", 33485) -, Tuple.Create(Tuple.Create("", 33437), Tuple.Create("Purchased:", 33437), true) - - #line 527 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create(" ", 33447), Tuple.Create(db.PurchaseDate.ToLongDateString() - - #line default - #line hidden -, 33448), false) -); - -WriteLiteral(">"); +WriteLiteral(" "); - #line 527 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - Write(db.Name); + #line 552 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + Write(db.Name); #line default #line hidden -WriteLiteral("\r\n
  • \r\n"); +WriteLiteral("\r\n \r\n " + +" \r\n"); - #line 529 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 555 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + if (isDecommissioned) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + #line 558 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + } } #line default #line hidden -WriteLiteral(" \r\n \r\n " + -" \r\n"); +WriteLiteral(" \r\n"); + + + #line 561 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + + + #line default + #line hidden + + #line 561 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + if (Model.DecommissionedDeviceBatchIds.Count > 0) + { + + + #line default + #line hidden +WriteLiteral(" Show Decommissioned\r\n"); + + + #line 564 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + } + + + #line default + #line hidden +WriteLiteral(" \r\n \r\n"); WriteLiteral(" \r\n"); - #line 587 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 631 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2234,13 +2328,13 @@ WriteLiteral(" title=\"Model Description\""); WriteLiteral(">\r\n"); - #line 595 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 639 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 595 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 639 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Authorization.Has(Claims.Config.DeviceModel.Show)) { @@ -2248,14 +2342,14 @@ WriteLiteral(">\r\n"); #line default #line hidden - #line 597 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 641 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLink(Model.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId))); #line default #line hidden - #line 597 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 641 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } else @@ -2265,14 +2359,14 @@ WriteLiteral(">\r\n"); #line default #line hidden - #line 601 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 645 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Model.Device.DeviceModel.ToString()); #line default #line hidden - #line 601 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 645 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2285,14 +2379,14 @@ WriteLiteral(" id=\"Device_Show_Aspects_Model_Image\""); WriteLiteral(" alt=\"Model Image\""); -WriteAttribute("src", Tuple.Create(" src=\"", 38232), Tuple.Create("\"", 38342) +WriteAttribute("src", Tuple.Create(" src=\"", 41232), Tuple.Create("\"", 41342) - #line 604 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 38238), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash())) + #line 648 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + , Tuple.Create(Tuple.Create("", 41238), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash())) #line default #line hidden -, 38238), false) +, 41238), false) ); WriteLiteral(" />\r\n \r\n \r\n \r\n \r\n \r\n"); - #line 611 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 655 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 611 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 655 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanCreateJob()) { Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob"); @@ -2322,14 +2416,14 @@ WriteLiteral(">\r\n"); #line default #line hidden - #line 614 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 658 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.Device.SerialNumber, Model.Device.AssignedUserId), "buttonCreateJob")); #line default #line hidden - #line 614 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 658 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2339,7 +2433,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 616 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 660 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanUpdateAssignment()) { @@ -2371,13 +2465,13 @@ WriteLiteral(" class=\"fa fa-info-circle information\""); WriteLiteral("> Assign to User:\r\n
    \r\n"); - #line 622 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 666 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 622 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 666 "..\..\Views\Device\DeviceParts\_Subject.cshtml" using (Html.BeginForm(MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber, redirect: true))) { @@ -2395,7 +2489,7 @@ WriteLiteral(" type=\"text\""); WriteLiteral(" />\r\n"); - #line 625 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 669 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2417,13 +2511,13 @@ WriteLiteral(@"> "); - #line 634 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 678 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 634 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 678 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (assignedUser != null) { @@ -2447,7 +2541,7 @@ WriteLiteral(@" WriteLiteral("\r\n"); - #line 647 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 691 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2478,7 +2572,7 @@ WriteLiteral("\r\n \"Assign\": function () {\r\n " \'"); - #line 678 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 722 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Url.Action(MVC.API.Search.UsersUpstream())); @@ -2508,7 +2602,7 @@ WriteLiteral(@"', "); - #line 699 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 743 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2517,7 +2611,7 @@ WriteLiteral(@"', WriteLiteral(" "); - #line 700 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 744 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanUpdateTrustEnrol()) { @@ -2525,14 +2619,14 @@ WriteLiteral(" "); #line default #line hidden - #line 702 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 746 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Trust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, true.ToString(), true), "Device_Show_Device_Actions_TrustEnrol_Button")); #line default #line hidden - #line 702 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 746 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -2573,7 +2667,7 @@ WriteLiteral(">This action will allow a device claiming to have the "\'"); - #line 712 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 756 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Model.Device.SerialNumber); @@ -2615,7 +2709,7 @@ WriteLiteral(">\r\n $(function () {\r\n " });\r\n \r\n"); - #line 752 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 796 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2624,7 +2718,7 @@ WriteLiteral(">\r\n $(function () {\r\n WriteLiteral(" "); - #line 753 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 797 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanUpdateUntrustEnrol()) { @@ -2632,14 +2726,14 @@ WriteLiteral(" "); #line default #line hidden - #line 755 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 799 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Untrust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, false.ToString(), true), "Device_Show_Device_Actions_UntrustEnrol_Button")); #line default #line hidden - #line 755 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 799 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -2710,7 +2804,7 @@ WriteLiteral(@"> "); - #line 795 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 839 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2719,7 +2813,7 @@ WriteLiteral(@"> WriteLiteral(" "); - #line 796 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 840 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanDecommission()) { @@ -2727,14 +2821,14 @@ WriteLiteral(" "); #line default #line hidden - #line 798 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 842 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(), "Device_Show_Device_Actions_Decommission_Button")); #line default #line hidden - #line 798 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 842 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -2766,13 +2860,13 @@ WriteLiteral(" class=\"none\""); WriteLiteral(">\r\n"); - #line 805 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 849 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 805 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 849 "..\..\Views\Device\DeviceParts\_Subject.cshtml" foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast().OrderBy(r => r.ToString())) { @@ -2783,34 +2877,34 @@ WriteLiteral("
  • \r\n WriteLiteral(" type=\"radio\""); -WriteAttribute("id", Tuple.Create(" id=\"", 49907), Tuple.Create("\"", 49985) -, Tuple.Create(Tuple.Create("", 49912), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 49912), true) +WriteAttribute("id", Tuple.Create(" id=\"", 52907), Tuple.Create("\"", 52985) +, Tuple.Create(Tuple.Create("", 52912), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 52912), true) - #line 808 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 49959), Tuple.Create((int)decommissionReason + #line 852 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + , Tuple.Create(Tuple.Create("", 52959), Tuple.Create((int)decommissionReason #line default #line hidden -, 49959), false) +, 52959), false) ); WriteLiteral("\r\n name=\"Device_Show_Device_Actions_Dec" + "ommission_Reason\""); -WriteAttribute("value", Tuple.Create(" value=\"", 50084), Tuple.Create("\"", 50118) +WriteAttribute("value", Tuple.Create(" value=\"", 53084), Tuple.Create("\"", 53118) - #line 809 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 50092), Tuple.Create((int)decommissionReason + #line 853 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + , Tuple.Create(Tuple.Create("", 53092), Tuple.Create((int)decommissionReason #line default #line hidden -, 50092), false) +, 53092), false) ); WriteLiteral(" "); - #line 809 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 853 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty); @@ -2818,21 +2912,21 @@ WriteLiteral(" "); #line hidden WriteLiteral(" />\r\n ((int)decommissionReason + #line 854 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + , Tuple.Create(Tuple.Create("", 53315), Tuple.Create((int)decommissionReason #line default #line hidden -, 50315), false) +, 53315), false) ); WriteLiteral(">"); - #line 810 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 854 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(decommissionReason.ReasonMessage()); @@ -2841,7 +2935,7 @@ WriteLiteral(">"); WriteLiteral("\r\n
  • \r\n"); - #line 812 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 856 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2859,7 +2953,7 @@ WriteLiteral(">\r\n $(function () {\r\n "uttonDialog = null;\r\n var deviceSerialNumber = \'"); - #line 820 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 864 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Model.Device.SerialNumber); @@ -2892,7 +2986,7 @@ WriteLiteral("\';\r\n\r\n button.click(function () {\r\n\ " });\r\n \r\n"); - #line 856 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 900 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2901,7 +2995,7 @@ WriteLiteral("\';\r\n\r\n button.click(function () {\r\n\ WriteLiteral(" "); - #line 857 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 901 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanRecommission()) { @@ -2909,14 +3003,14 @@ WriteLiteral(" "); #line default #line hidden - #line 859 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 903 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Recommission", MVC.API.Device.Recommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Recommission_Button")); #line default #line hidden - #line 859 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 903 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -2970,7 +3064,7 @@ WriteLiteral(@"> "); - #line 894 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 938 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2979,7 +3073,7 @@ WriteLiteral(@"> WriteLiteral(" "); - #line 895 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 939 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanDelete()) { @@ -2987,14 +3081,14 @@ WriteLiteral(" "); #line default #line hidden - #line 897 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 941 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Delete Device", MVC.API.Device.Delete(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Delete_Button")); #line default #line hidden - #line 897 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 941 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -3054,7 +3148,7 @@ WriteLiteral(@"> "); - #line 935 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 979 "..\..\Views\Device\DeviceParts\_Subject.cshtml" }