Files
IntuneManagement/UI/Avalonia/XAML/BulkImportForm.axaml
T

189 lines
10 KiB
XML

<Grid xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Margin="5">
<!--
Avalonia port of UI/WPF/XAML/BulkImportForm.xaml. Hosted via Show-ModalForm
— Save / Import / Close live in this Grid and call back into
Show-GraphBulkImportForm.
WPF -> Avalonia translations applied (same set as BulkExportForm.axaml):
- Window/UserControl host -> Grid (modal-form host owns the chrome).
- Grid.IsSharedSizeScope / SharedSizeGroup dropped — single grid
ColumnDefinition Width="Auto"/"*" keeps rows aligned.
- InfoIcon Rectangles are rendered as the info-icon glyph (Themes/Styles.axaml);
the description sits on the wrapping StackPanel so hovering the label shows it too.
- chkAddObjectType is forced IsChecked=true and IsEnabled=false
(matches WPF — bulk import always reads per-type subfolders).
- cbImportType + lblImportType are visible by default here (WPF
XAML had them Collapsed and the PS code flipped them visible —
we just start visible).
- DataGrid Columns are declared inline. WPF's
Get-GridCheckboxColumn header-checkbox toggle-all has no
Avalonia bindable equivalent — the chkSelectAll toolbar
checkbox under spImportSubMenu replaces it (same convention
as ImportForm.axaml / BulkExportForm.axaml).
- Per-type AddUIImportExtensions (per-policy-type checkboxes)
NOT wired — same constraint as Slice 3e / 4a.
- DataContext two-way bindings dropped — IntuneManagerImportSettings
has no INotifyPropertyChanged so two-way bindings would render
but never round-trip. Same imperative round-trip as the rest
of the port.
-->
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Name="grdImportProperties">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" Margin="0,0,5,0" VerticalAlignment="Center" ToolTip.Tip="The root folder where exported files are stored">
<Label Content="Import root"/>
<TextBlock Classes="info-icon"/>
</StackPanel>
<Grid Grid.Row="0" Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBox Name="txtImportPath" Grid.Column="0"/>
<Button Name="browseImportPath" Grid.Column="2" Content="..."
Padding="5,0,5,0" Width="50"
ToolTip.Tip="Browse for folder"/>
</Grid>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" Margin="0,5,5,0" VerticalAlignment="Center" ToolTip.Tip="Specify name filter for the objects to import">
<Label Content="Name filter"/>
<TextBlock Classes="info-icon"/>
</StackPanel>
<TextBox Name="txtImportNameFilter" Grid.Row="1" Grid.Column="1"
Margin="0,5,0,0"/>
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" Margin="0,5,5,0" VerticalAlignment="Center" ToolTip.Tip="This contains information about the exported environment e.g. Groups, ScopeTags etc. Note: This is only used when importing objects from a different tenant">
<Label Content="Migration Table"/>
<TextBlock Classes="info-icon"/>
</StackPanel>
<TextBlock Name="lblMigrationTableInfo" Grid.Row="2" Grid.Column="1"
Margin="0,5,0,0" VerticalAlignment="Center" TextWrapping="Wrap"/>
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Horizontal" Margin="0,5,5,0" VerticalAlignment="Center" ToolTip.Tip="This will import objects from a sub-directory of the import path with name based on object type">
<Label Content="Add object name to path"/>
<TextBlock Classes="info-icon"/>
</StackPanel>
<CheckBox Name="chkAddObjectType" Grid.Row="3" Grid.Column="1"
Margin="0,5,0,0" VerticalAlignment="Center"
IsChecked="True" IsEnabled="False"/>
<StackPanel Grid.Row="4" Grid.Column="0" Orientation="Horizontal" Margin="0,5,5,0" VerticalAlignment="Center" ToolTip.Tip="This will import ScopeTags. The ScopeTags must exist in the target environment before they can be assigned during import of an object">
<Label Content="Assign Scope (Tags)"/>
<TextBlock Classes="info-icon"/>
</StackPanel>
<CheckBox Name="chkImportScopes" Grid.Row="4" Grid.Column="1"
Margin="0,5,0,0" VerticalAlignment="Center"
IsChecked="True"/>
<StackPanel Grid.Row="5" Grid.Column="0" Orientation="Horizontal" Margin="0,5,5,0" VerticalAlignment="Center" ToolTip.Tip="Import object assignments. Note: This will create groups that don't exist in the target environment">
<Label Content="Import Assignments"/>
<TextBlock Classes="info-icon"/>
</StackPanel>
<CheckBox Name="chkImportAssignments" Grid.Row="5" Grid.Column="1"
Margin="0,5,0,0" VerticalAlignment="Center"
IsChecked="True"/>
<StackPanel Grid.Row="6" Grid.Column="0" Orientation="Horizontal" Margin="0,5,5,0" VerticalAlignment="Center" ToolTip.Tip="Replaces IDs of dependency objects e.g. App Config references Applications. Increases import time but makes sure objects are imported correctly. Note: Referenced objects must exist!">
<Label Content="Replace Dependency IDs"/>
<TextBlock Classes="info-icon"/>
</StackPanel>
<CheckBox Name="chkReplaceDependencyIDs" Grid.Row="6" Grid.Column="1"
Margin="0,5,0,0" VerticalAlignment="Center"
IsChecked="True"/>
<Label Grid.Row="7" Grid.Column="0" Content="Import Type" Margin="0,5,5,0"
VerticalAlignment="Center">
<ToolTip.Tip>
<TextBlock>
Specify how files are imported.
Always import: always try to import the object (no detection of existing objects, default).
Skip if object exists: skip import if there is an existing object with the same name and type.
Replace: if an object is detected it will be deleted and the assignments copied to the new imported object.
Replace with assignments: if an object is detected it will be deleted and the assignments come from the import file.
Update: if an object is detected, settings will be replaced from the import file.
</TextBlock>
</ToolTip.Tip>
</Label>
<ComboBox Name="cbImportType" DisplayMemberBinding="{Binding Name}" Grid.Row="7" Grid.Column="1"
Margin="0,5,0,0" MinWidth="250" HorizontalAlignment="Left"/>
</Grid>
<Grid Grid.Row="1" Margin="0,5,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" Margin="0,5,5,0" VerticalAlignment="Center" ToolTip.Tip="Select the object types that should be imported">
<Label Content="Objects to import"/>
<TextBlock Classes="info-icon"/>
</StackPanel>
<DataGrid CanUserResizeColumns="True" Grid.Row="1" Grid.Column="1" Name="dgObjectsToImport"
AutoGenerateColumns="False"
CanUserReorderColumns="True"
CanUserSortColumns="True"
Margin="0,0,0,5">
<DataGrid.Columns>
<DataGridTemplateColumn Width="Auto" CanUserSort="False">
<DataGridTemplateColumn.Header>
<CheckBox IsChecked="True"
HorizontalAlignment="Left" VerticalAlignment="Center"
ToolTip.Tip="Select/deselect all listed items"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding Selected, Mode=TwoWay}"
HorizontalAlignment="Left" VerticalAlignment="Center" Margin="12,0,0,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="Object type" Binding="{Binding Title}" IsReadOnly="True" Width="*"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
</StackPanel>
<StackPanel Name="spImportSubMenu" Grid.Column="1" Orientation="Horizontal"
HorizontalAlignment="Right">
<Button Name="btnImport" Content="Import" Width="100" Margin="5,0,0,0"/>
<Button Name="btnClose" Content="Close" Width="100" Margin="5,0,0,0"/>
</StackPanel>
</Grid>
</Grid>