Dropped Ledger Tables Folder (#1625)

* support and testing for Dropped Ledger Table folder

* appending DroppedLedgerTables nodetype

* fixing unit tests

* undoing string.Empty
This commit is contained in:
Jordan Hays
2022-08-09 14:17:51 -07:00
committed by GitHub
parent 091f2c942e
commit 485786f49e
11 changed files with 150 additions and 13 deletions

View File

@@ -797,6 +797,13 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{ LedgerTableType.UpdatableLedgerTable }
}
});
filters.Add(new NodePropertyFilter
{
Property = "IsDroppedLedgerTable",
Type = typeof(bool),
ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12,
Values = new List<object> { 0 },
});
return filters;
}
}
@@ -845,6 +852,14 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
IsMsShippedOwned = true,
SortPriority = SmoTreeNode.NextSortPriority,
});
currentChildren.Add(new FolderNode {
NodeValue = SR.SchemaHierarchy_DroppedLedgerTables,
NodeType = "Folder",
NodeTypeId = NodeTypes.DroppedLedgerTables,
IsSystemObject = false,
ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12,
SortPriority = SmoTreeNode.NextSortPriority,
});
}
internal override Type[] ChildQuerierTypes
@@ -1318,6 +1333,57 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
}
}
[Export(typeof(ChildFactory))]
[Shared]
internal partial class DroppedLedgerTablesChildFactory : SmoChildFactoryBase
{
public override IEnumerable<string> ApplicableParents() { return new[] { "DroppedLedgerTables" }; }
public override IEnumerable<INodeFilter> Filters
{
get
{
var filters = new List<INodeFilter>();
filters.Add(new NodePropertyFilter
{
Property = "IsDroppedLedgerTable",
Type = typeof(bool),
Values = new List<object> { 1 },
});
return filters;
}
}
public override IEnumerable<NodeSmoProperty> SmoProperties
{
get
{
var properties = new List<NodeSmoProperty>();
properties.Add(new NodeSmoProperty
{
Name = "IsDroppedLedgerTable",
ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12
});
return properties;
}
}
internal override Type[] ChildQuerierTypes
{
get
{
return new [] { typeof(SqlTableQuerier), };
}
}
public override TreeNode CreateChild(TreeNode parent, object context)
{
var child = new TableTreeNode();
InitializeChild(parent, child, context);
return child;
}
}
[Export(typeof(ChildFactory))]
[Shared]
internal partial class TableChildFactory : SmoChildFactoryBase