Skip to content

Commit 36a5b01

Browse files
authored
Create region headings & Audit Sources is collapsed until needed in VS Options (#7010)
1 parent a99b70c commit 36a5b01

31 files changed

Lines changed: 230 additions & 42 deletions

src/NuGet.Clients/NuGet.PackageManagement.VisualStudio/Options/PackageSourcesPage.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ namespace NuGet.PackageManagement.VisualStudio.Options
1818
public class PackageSourcesPage : NuGetExternalSettingsProvider, IExternalSettingValidator
1919
{
2020
internal const bool DefaultNuGetAudit = false;
21-
internal const string MonikerPackageSources = "packageSources";
22-
internal const string MonikerAuditSources = "auditSources";
23-
internal const string MonikerMachineWideSources = "machineWidePackageSources";
21+
internal const string MonikerPackageSources = "packageSources.notMachineWide";
22+
internal const string MonikerAuditSources = "nuGetAudit.auditSources";
23+
internal const string MonikerNuGetAudit = "nuGetAudit.enableCheckbox";
24+
internal const string MonikerMachineWideSources = "machineWide.machineWidePackageSources";
2425
internal const string MonikerPackageSourceId = "packageSourceId"; // Unique identifier for the package source
2526
internal const string MonikerSourceName = "sourceName";
2627
internal const string MonikerSourceUrl = "sourceUrl";
@@ -69,6 +70,17 @@ public override async Task<ExternalSettingOperationResult<T>> GetValueAsync<T>(s
6970

7071
return GetValuePackageSources<T>(packageSources);
7172
}
73+
case MonikerNuGetAudit:
74+
{
75+
var auditSources = await Task.Run(
76+
() => LoadAuditSources(),
77+
cancellationToken);
78+
if (auditSources.Count > 0)
79+
{
80+
return await ConvertValueOrThrow<T>(true);
81+
}
82+
return await ConvertValueOrThrow<T>(DefaultNuGetAudit);
83+
}
7284
case MonikerAuditSources:
7385
{
7486
var auditSources = await Task.Run(
@@ -103,6 +115,8 @@ public override async Task<ExternalSettingOperationResult> SetValueAsync<T>(stri
103115

104116
switch (moniker)
105117
{
118+
case MonikerNuGetAudit:
119+
return (ExternalSettingOperationResult)ExternalSettingOperationResult.Success.Instance;
106120
case MonikerPackageSources:
107121
var packageSourcesList = (IReadOnlyList<IDictionary<string, object>>)value;
108122
return await Task.Run(

src/NuGet.Clients/NuGet.Tools/Resources.Designer.cs

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/NuGet.Clients/NuGet.Tools/Resources.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,10 @@
261261
<data name="Text_AuditSources_Title" xml:space="preserve">
262262
<value>Audit sources</value>
263263
</data>
264+
<data name="Text_AuditSources_Checkbox" xml:space="preserve">
265+
<value>Use separate sources for vulnerability audit</value>
266+
</data>
267+
<data name="Text_MachineWidePackageSource_Description" xml:space="preserve">
268+
<value>Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</value>
269+
</data>
264270
</root>

src/NuGet.Clients/NuGet.Tools/VSPackage.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
<value>NuGet Package Manager</value>
131131
</data>
132132
<data name="114" xml:space="preserve">
133-
<value>Package Sources</value>
133+
<value>Sources</value>
134134
</data>
135135
<data name="115" xml:space="preserve">
136136
<value>General</value>
@@ -156,4 +156,4 @@
156156
<data name="4" xml:space="preserve">
157157
<value>plk</value>
158158
</data>
159-
</root>
159+
</root>

src/NuGet.Clients/NuGet.Tools/xlf/Resources.cs.xlf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@
132132
<target state="translated">Povolit nezabezpečená připojení</target>
133133
<note />
134134
</trans-unit>
135+
<trans-unit id="Text_AuditSources_Checkbox">
136+
<source>Use separate sources for vulnerability audit</source>
137+
<target state="new">Use separate sources for vulnerability audit</target>
138+
<note />
139+
</trans-unit>
135140
<trans-unit id="Text_AuditSources_Description">
136141
<source>Audit sources provide vulnerability data during restore without acting as package sources. If no audit sources are configured, NuGet Audit uses package sources. [Learn more about audit sources](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</source>
137142
<target state="translated">Zdroje auditu poskytují během obnovování data ohrožení zabezpečení, aniž by se chovaly jako zdroje balíčků. Pokud nejsou nakonfigurované žádné zdroje auditu, NuGet Audit použije zdroje balíčků. [Další informace o zdrojích auditu](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</target>
@@ -172,6 +177,11 @@
172177
<target state="translated">Zdroje HTTP nejsou bezpečné. Zvažte místo toho použití protokolu HTTPS. Možnost AllowInsecureConnections je povolená a umožňuje přístup HTTP. Pro bezpečnější možnosti navštivte [https://aka.ms/nuget-https-everywhere](https://aka.ms/nuget-https-everywhere).</target>
173178
<note />
174179
</trans-unit>
180+
<trans-unit id="Text_MachineWidePackageSource_Description">
181+
<source>Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</source>
182+
<target state="new">Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</target>
183+
<note />
184+
</trans-unit>
175185
<trans-unit id="Text_PackageSourceEnabled_Header">
176186
<source>Enabled</source>
177187
<target state="translated">Povoleno</target>

src/NuGet.Clients/NuGet.Tools/xlf/Resources.de.xlf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@
132132
<target state="translated">Unsichere Verbindungen zulassen</target>
133133
<note />
134134
</trans-unit>
135+
<trans-unit id="Text_AuditSources_Checkbox">
136+
<source>Use separate sources for vulnerability audit</source>
137+
<target state="new">Use separate sources for vulnerability audit</target>
138+
<note />
139+
</trans-unit>
135140
<trans-unit id="Text_AuditSources_Description">
136141
<source>Audit sources provide vulnerability data during restore without acting as package sources. If no audit sources are configured, NuGet Audit uses package sources. [Learn more about audit sources](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</source>
137142
<target state="translated">Überwachungsquellen liefern während der Wiederherstellung Sicherheitsrisikodaten, ohne als Paketquellen zu fungieren. Wenn keine Überwachungsquellen konfiguriert sind, verwendet NuGet Audit Paketquellen. [Weitere Informationen zu Überwachungsquellen](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</target>
@@ -172,6 +177,11 @@
172177
<target state="translated">HTTP-Quellen sind unsicher. Erwägen Sie stattdessen die Verwendung von HTTPS. „AllowInsecureConnections“ ist aktiviert und erlaubt den HTTP-Zugriff. Sicherere Optionen finden Sie unter [https://aka.ms/nuget-https-everywhere](https://aka.ms/nuget-https-everywhere).</target>
173178
<note />
174179
</trans-unit>
180+
<trans-unit id="Text_MachineWidePackageSource_Description">
181+
<source>Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</source>
182+
<target state="new">Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</target>
183+
<note />
184+
</trans-unit>
175185
<trans-unit id="Text_PackageSourceEnabled_Header">
176186
<source>Enabled</source>
177187
<target state="translated">Aktiviert</target>

src/NuGet.Clients/NuGet.Tools/xlf/Resources.es.xlf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@
132132
<target state="translated">Permitir conexiones no seguras</target>
133133
<note />
134134
</trans-unit>
135+
<trans-unit id="Text_AuditSources_Checkbox">
136+
<source>Use separate sources for vulnerability audit</source>
137+
<target state="new">Use separate sources for vulnerability audit</target>
138+
<note />
139+
</trans-unit>
135140
<trans-unit id="Text_AuditSources_Description">
136141
<source>Audit sources provide vulnerability data during restore without acting as package sources. If no audit sources are configured, NuGet Audit uses package sources. [Learn more about audit sources](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</source>
137142
<target state="translated">Los orígenes de auditoría proporcionan datos sobre vulnerabilidades durante la restauración sin actuar como orígenes de paquetes. Si no se configuran orígenes de auditoría, NuGet Audit utiliza orígenes de paquetes. [Más información sobre los orígenes de auditoría](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</target>
@@ -172,6 +177,11 @@
172177
<target state="translated">Las fuentes HTTP no son seguras. Considere utilizar HTTPS en su lugar. 'AllowInsecureConnections' está habilitado, lo que permite el acceso HTTP. Para obtener opciones más seguras, consulte [https://aka.ms/nuget-https-everywhere](https://aka.ms/nuget-https-everywhere).</target>
173178
<note />
174179
</trans-unit>
180+
<trans-unit id="Text_MachineWidePackageSource_Description">
181+
<source>Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</source>
182+
<target state="new">Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</target>
183+
<note />
184+
</trans-unit>
175185
<trans-unit id="Text_PackageSourceEnabled_Header">
176186
<source>Enabled</source>
177187
<target state="translated">Habilitado</target>

src/NuGet.Clients/NuGet.Tools/xlf/Resources.fr.xlf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@
132132
<target state="translated">Autorisez les connexions non sécurisées</target>
133133
<note />
134134
</trans-unit>
135+
<trans-unit id="Text_AuditSources_Checkbox">
136+
<source>Use separate sources for vulnerability audit</source>
137+
<target state="new">Use separate sources for vulnerability audit</target>
138+
<note />
139+
</trans-unit>
135140
<trans-unit id="Text_AuditSources_Description">
136141
<source>Audit sources provide vulnerability data during restore without acting as package sources. If no audit sources are configured, NuGet Audit uses package sources. [Learn more about audit sources](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</source>
137142
<target state="translated">Les sources d’audit fournissent des données de vulnérabilité lors de la restauration sans agir comme sources de package. Si aucune source d’audit n’est configurée, NuGet Audit utilise les sources de package. [En savoir plus sur les sources d’audit](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</target>
@@ -172,6 +177,11 @@
172177
<target state="translated">Les sources HTTP ne sont pas sécurisées. Envisagez d'utiliser HTTPS à la place. L'option « AllowInsecureConnections » est activée, ce qui permet l'accès au protocole HTTP. Pour des options plus sécurisées, consultez [https://aka.ms/nuget-https-everywhere](https://aka.ms/nuget-https-everywhere).</target>
173178
<note />
174179
</trans-unit>
180+
<trans-unit id="Text_MachineWidePackageSource_Description">
181+
<source>Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</source>
182+
<target state="new">Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</target>
183+
<note />
184+
</trans-unit>
175185
<trans-unit id="Text_PackageSourceEnabled_Header">
176186
<source>Enabled</source>
177187
<target state="translated">Activé</target>

src/NuGet.Clients/NuGet.Tools/xlf/Resources.it.xlf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@
132132
<target state="translated">Consentire connessioni non sicure</target>
133133
<note />
134134
</trans-unit>
135+
<trans-unit id="Text_AuditSources_Checkbox">
136+
<source>Use separate sources for vulnerability audit</source>
137+
<target state="new">Use separate sources for vulnerability audit</target>
138+
<note />
139+
</trans-unit>
135140
<trans-unit id="Text_AuditSources_Description">
136141
<source>Audit sources provide vulnerability data during restore without acting as package sources. If no audit sources are configured, NuGet Audit uses package sources. [Learn more about audit sources](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</source>
137142
<target state="translated">Le origini di controllo forniscono dati sulle vulnerabilità durante il ripristino senza svolgere la funzione di origini di pacchetti. Se non sono configurate origini di controllo, NuGet Audit usa origini di pacchetti. [Altre informazioni sulle origini di controllo](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</target>
@@ -172,6 +177,11 @@
172177
<target state="translated">Le origini HTTP non sono sicure. Prendere in considerazione l’uso di HTTPS. ‘AllowInsecureConnections’ è abilitato e consente l’accesso HTTP. Per opzioni più sicure, vedere [https://aka.ms/nuget-https-everywhere](https://aka.ms/nuget-https-everywhere).</target>
173178
<note />
174179
</trans-unit>
180+
<trans-unit id="Text_MachineWidePackageSource_Description">
181+
<source>Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</source>
182+
<target state="new">Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</target>
183+
<note />
184+
</trans-unit>
175185
<trans-unit id="Text_PackageSourceEnabled_Header">
176186
<source>Enabled</source>
177187
<target state="translated">Abilitato</target>

src/NuGet.Clients/NuGet.Tools/xlf/Resources.ja.xlf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@
132132
<target state="translated">安全ではない接続を許可する</target>
133133
<note />
134134
</trans-unit>
135+
<trans-unit id="Text_AuditSources_Checkbox">
136+
<source>Use separate sources for vulnerability audit</source>
137+
<target state="new">Use separate sources for vulnerability audit</target>
138+
<note />
139+
</trans-unit>
135140
<trans-unit id="Text_AuditSources_Description">
136141
<source>Audit sources provide vulnerability data during restore without acting as package sources. If no audit sources are configured, NuGet Audit uses package sources. [Learn more about audit sources](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</source>
137142
<target state="translated">監査ソースは、パッケージ ソースとして機能することなく、復元中に脆弱性データを提供します。監査ソースが構成されていない場合、NuGet Audit はパッケージ ソースを使用します。[監査ソースに関する詳細情報](https://learn.microsoft.com/nuget/reference/nuget-config-file#auditsources)</target>
@@ -172,6 +177,11 @@
172177
<target state="translated">HTTP ソースは安全ではありません。代わりに HTTPS の使用を検討してください。'AllowInsecureConnections' が有効になっており、HTTP アクセスが許可されています。より安全なオプションについては、[https://aka.ms/nuget-https-everywhere](https://aka.ms/nuget-https-everywhere) を参照してください。</target>
173178
<note />
174179
</trans-unit>
180+
<trans-unit id="Text_MachineWidePackageSource_Description">
181+
<source>Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</source>
182+
<target state="new">Machine‑wide package sources are provisioned by Visual Studio workloads and can only be enabled or disabled.</target>
183+
<note />
184+
</trans-unit>
175185
<trans-unit id="Text_PackageSourceEnabled_Header">
176186
<source>Enabled</source>
177187
<target state="translated">有効</target>

0 commit comments

Comments
 (0)