Browse Source

Merge pull request #597 from nextcloud/fix/capabilities

Fix/capabilities
pull/599/head
Kate 1 year ago committed by GitHub
parent
commit
86bb58d813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      external/nextcloud-openapi-extractor
  2. 2
      external/nextcloud-server
  3. 2
      packages/neon/neon/lib/src/app.dart
  4. 4
      packages/neon/neon/lib/src/blocs/apps.dart
  5. 2
      packages/neon/neon/lib/src/theme/theme.dart
  6. 2
      packages/neon/neon/lib/src/widgets/drawer.dart
  7. 1179
      packages/nextcloud/lib/src/api/core.openapi.dart
  8. 14929
      packages/nextcloud/lib/src/api/core.openapi.g.dart
  9. 1413
      packages/nextcloud/lib/src/api/core.openapi.json
  10. 2
      packages/nextcloud/lib/src/version_supported.dart
  11. 17
      packages/nextcloud/test/core_test.dart
  12. 2
      tool/generate-specs.sh

2
external/nextcloud-openapi-extractor vendored

@ -1 +1 @@
Subproject commit 5940a175e352d3cf7780e1c50dd572dfe04523b3
Subproject commit 85b552a0c82ac71e1f5660109113b6235156e92e

2
external/nextcloud-server vendored

@ -1 +1 @@
Subproject commit 8606f162c5b5b5d6a355e7e2f27e05585b3d0360
Subproject commit 020401b6c82930783188fd428b961ddd4a296656

2
packages/neon/neon/lib/src/app.dart

@ -291,7 +291,7 @@ class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver, tray.Tra
: null,
builder: (final context, final capabilitiesSnapshot) {
final appTheme = AppTheme(
capabilitiesSnapshot.data?.capabilities.theming,
capabilitiesSnapshot.data?.capabilities.themingPublicCapabilities?.theming,
keepOriginalAccentColor: themeKeepOriginalAccentColor,
oledAsDark: themeOLEDAsDark,
appThemes: _appImplementations.map((final a) => a.theme).whereNotNull(),

4
packages/neon/neon/lib/src/blocs/apps.dart

@ -69,7 +69,9 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates
_capabilitiesBloc.capabilities.listen((final result) {
notificationsAppImplementation.add(
result.transform(
(final data) => data.capabilities.notifications != null ? _findAppImplementation(AppIDs.notifications) : null,
(final data) => data.capabilities.notificationsCapabilities?.notifications != null
? _findAppImplementation(AppIDs.notifications)
: null,
),
);

2
packages/neon/neon/lib/src/theme/theme.dart

@ -16,7 +16,7 @@ class AppTheme {
this.appThemes,
}) : keepOriginalAccentColor = nextcloudTheme == null || keepOriginalAccentColor;
final CoreOcsGetCapabilitiesResponse200ApplicationJson_Ocs_Data_Capabilities_Theming? nextcloudTheme;
final CoreThemingPublicCapabilities_Theming? nextcloudTheme;
final bool keepOriginalAccentColor;
final bool oledAsDark;
final Iterable<ThemeExtension>? appThemes;

2
packages/neon/neon/lib/src/widgets/drawer.dart

@ -137,7 +137,7 @@ class NeonDrawerHeader extends StatelessWidget {
);
}
final theme = capabilities.requireData.capabilities.theming;
final theme = capabilities.requireData.capabilities.themingPublicCapabilities?.theming;
if (theme == null) {
return const SizedBox();

1179
packages/nextcloud/lib/src/api/core.openapi.dart

File diff suppressed because it is too large Load Diff

14929
packages/nextcloud/lib/src/api/core.openapi.g.dart

File diff suppressed because it is too large Load Diff

1413
packages/nextcloud/lib/src/api/core.openapi.json

File diff suppressed because it is too large Load Diff

2
packages/nextcloud/lib/src/version_supported.dart

@ -49,7 +49,7 @@ extension NotesVersionSupported on NotesClient {
///
/// Also returns the supported API version number
(bool, int) isSupported(final CoreOcsGetCapabilitiesResponse200ApplicationJson_Ocs_Data capabilities) => (
capabilities.capabilities.notes?.apiVersion
capabilities.capabilities.notesCapabilities?.notes.apiVersion
?.map(Version.parse)
.where((final version) => version.major == notesSupportedVersion)
.isNotEmpty ??

17
packages/nextcloud/test/core_test.dart

@ -45,17 +45,12 @@ void main() {
final capabilities = await client.core.ocs.getCapabilities();
expect(capabilities.ocs.data.version.major, coreSupportedVersion);
expect(capabilities.ocs.data.version.string, startsWith('$coreSupportedVersion.'));
expect(capabilities.ocs.data.capabilities.theming!.name, 'Nextcloud');
expect(capabilities.ocs.data.capabilities.theming!.url, 'https://nextcloud.com');
expect(capabilities.ocs.data.capabilities.theming!.slogan, 'a safe home for all your data');
expect(capabilities.ocs.data.capabilities.theming!.color, '#0082c9');
expect(capabilities.ocs.data.capabilities.theming!.colorText, '#ffffff');
expect(capabilities.ocs.data.capabilities.theming!.logo, isNotEmpty);
expect(capabilities.ocs.data.capabilities.theming!.background, isNotEmpty);
expect(capabilities.ocs.data.capabilities.theming!.backgroundPlain, false);
expect(capabilities.ocs.data.capabilities.theming!.backgroundDefault, true);
expect(capabilities.ocs.data.capabilities.theming!.logoheader, isNotEmpty);
expect(capabilities.ocs.data.capabilities.theming!.favicon, isNotEmpty);
expect(capabilities.ocs.data.capabilities.filesSharingCapabilities, isNotNull);
expect(capabilities.ocs.data.capabilities.notesCapabilities, isNotNull);
expect(capabilities.ocs.data.capabilities.notificationsCapabilities, isNotNull);
expect(capabilities.ocs.data.capabilities.provisioningApiCapabilities, isNotNull);
expect(capabilities.ocs.data.capabilities.themingPublicCapabilities, isNotNull);
expect(capabilities.ocs.data.capabilities.userStatusCapabilities, isNotNull);
});
test('Get navigation apps', () async {

2
tool/generate-specs.sh

@ -23,7 +23,7 @@ done
jq \
-s \
'.[0] * {paths: {"/ocs/v2.php/cloud/capabilities": {get: {responses: .[1].paths."/ocs/v2.php/cloud/capabilities".get.responses}}}}' \
'.[0] * {components: {schemas: .[1].components.schemas | with_entries(select(.key | endswith("Capabilities")))}, paths: {"/ocs/v2.php/cloud/capabilities": {get: {responses: .[1].paths."/ocs/v2.php/cloud/capabilities".get.responses}}}}' \
packages/nextcloud/lib/src/api/core.openapi.json \
/tmp/nextcloud-neon/merged.json \
> /tmp/nextcloud-neon/core.json

Loading…
Cancel
Save