Skip to content

Commit

Permalink
feat: add changelogs, update old changelogs, update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
astubenbord committed Oct 10, 2023
1 parent 162d50b commit 2484bd2
Show file tree
Hide file tree
Showing 34 changed files with 413 additions and 54 deletions.
1 change: 1 addition & 0 deletions .github/workflows/create-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
- name: Get packages and run codegen
run: |
bash install_dependencies.sh
bash update_changelogs.sh
working-directory: scripts

- name: Setup Fastlane
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
- name: Get packages and run codegen
run: |
bash install_dependencies.sh
bash update_changelogs.sh
working-directory: scripts

- name: Setup Fastlane
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-deploy-play-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
- name: Get packages and run codegen
run: |
bash install_dependencies.sh
bash update_changelogs.sh
working-directory: scripts

- name: Setup Fastlane
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@ docker/

crowdin_credentials.yml

# Changelogs
assets/changelogs/*.md
2 changes: 1 addition & 1 deletion android/fastlane/metadata/android/de-DE/changelogs/28.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Diese Version ist eine Betaversion und enthält neue Features und Umstrukturierungen. Deshalb wird empfohlen, die App neu zu installieren!
### Diese Version ist eine Betaversion und enthält neue Features und Umstrukturierungen. Deshalb wird empfohlen, die App neu zu installieren!
* Neues Feature: Massenbearbeitung von Dokumenten.
* Neues Feature: Unterstützung für mehrere Accounts und mehrere Instanzen mit schnellem Wechsel zwischen diesen (Achtung: Die in paperless-ngx 1.14.0 neu hinzugefügten Berechtigungen sind hier noch nicht enthalten!)
* Bugfixes
2 changes: 1 addition & 1 deletion android/fastlane/metadata/android/de-DE/changelogs/33.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Dies ist eine Beta Version und noch work in progress! Diese Version wurde mit paperless-ngx 1.13.0 sowie 1.14.2 getestet.
### Dies ist eine Beta Version und noch work in progress! Diese Version wurde mit paperless-ngx 1.13.0 sowie 1.14.2 getestet.
* Beheben einiger Fehler, die durch API-Update zustande kamen
* Berechtigungs-Checks bei wichtigen Funktionen (noch nicht vollständig)
* Neue Einstellungen für den Standard Dateityp beim Downloaden/Teilen
3 changes: 1 addition & 2 deletions android/fastlane/metadata/android/de-DE/changelogs/47.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
DISCLAIMER: Major Update mit potentiellen breaking changes - eine Neuinstallation wird dringend empfohlen!

### DISCLAIMER: Major Update mit potentiellen breaking changes - eine Neuinstallation wird dringend empfohlen!
* Neue Startseite hinzugefügt
* Viele Fehlerbehebungen
* Verbesserte Unterstützung für mehrere Accounts/Benutzer
Expand Down
2 changes: 1 addition & 1 deletion android/fastlane/metadata/android/de-DE/changelogs/49.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Beheben eines Fehlers, durch welchen die App bei Paperless Versionen vor 1.14.0 nicht mehr startete
### Beheben eines Fehlers, durch welchen die App bei Paperless Versionen vor 1.14.0 nicht mehr startete
2 changes: 2 additions & 0 deletions android/fastlane/metadata/android/de-DE/changelogs/53.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Neu: Anzeigen von Changelogs beim ersten Appstart mit neuer Version
* Kleinere Fixes
2 changes: 1 addition & 1 deletion android/fastlane/metadata/android/en-US/changelogs/28.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This version is a beta and contains new features and some restructurings. Therefore it is highly recommended to perform a fresh installation of the app.
### This version is a beta and contains new features and some restructurings. Therefore it is highly recommended to perform a fresh installation of the app.
* New feature: Document bulk edits
* New feature: Support for multiple accounts and multiple instances with quick switching between them (Note: This does not yet include the new multi-user features introduced in paperless-ngx 1.14.0!)
* Bugfixes
2 changes: 1 addition & 1 deletion android/fastlane/metadata/android/en-US/changelogs/33.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is a beta version and still work in progress! This version was tested with paperless-ngx 1.3.0 as well as 1.14.2.
### This is a beta version and still work in progress! This version was tested with paperless-ngx 1.3.0 as well as 1.14.2.
* Fixes some bugs which were caused by breaking changes to the Paperless API.
* Permission checks for major features (upload, edit, view documents etc., not complete yet)
* Add setting to set default download/share file type
3 changes: 1 addition & 2 deletions android/fastlane/metadata/android/en-US/changelogs/47.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
DISCLAIMER: Major update with possibly breaking changes - a fresh install is highly recommended!

### DISCLAIMER: Major update with possibly breaking changes - a fresh install is highly recommended!
* Added new home page
* Tons of bugfixes
* Improved support for multiple accounts/users
Expand Down
2 changes: 1 addition & 1 deletion android/fastlane/metadata/android/en-US/changelogs/49.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Fix bug where app would not login with paperless versions before 1.14.0
* Fix bug where app would not login with paperless versions before 1.14.0
2 changes: 2 additions & 0 deletions android/fastlane/metadata/android/en-US/changelogs/53.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* New: Show changelogs the first time the app is opened
* Some minor fixes
22 changes: 12 additions & 10 deletions lib/core/widgets/paperless_logo.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:paperless_mobile/generated/assets.gen.dart';

class PaperlessLogo extends StatelessWidget {
static const _paperlessGreen = Color(0xFF18541F);
Expand All @@ -25,15 +26,16 @@ class PaperlessLogo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
constraints: BoxConstraints(
maxHeight: height ?? Theme.of(context).iconTheme.size ?? 32,
maxWidth: width ?? Theme.of(context).iconTheme.size ?? 32,
),
padding: const EdgeInsets.only(right: 8),
child: SvgPicture.asset(
"assets/logos/paperless_logo_white.svg",
color: _color,
),
);
constraints: BoxConstraints(
maxHeight: height ?? Theme.of(context).iconTheme.size ?? 32,
maxWidth: width ?? Theme.of(context).iconTheme.size ?? 32,
),
padding: const EdgeInsets.only(right: 8),
child: Assets.logos.paperlessLogoWhiteSvg.svg(
colorFilter: ColorFilter.mode(
_color,
BlendMode.srcIn,
),
));
}
}
25 changes: 19 additions & 6 deletions lib/features/app_drawer/view/app_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:paperless_mobile/constants.dart';
import 'package:paperless_mobile/core/database/tables/local_user_account.dart';
import 'package:paperless_mobile/core/global/asset_images.dart';
import 'package:paperless_mobile/core/widgets/hint_card.dart';
import 'package:paperless_mobile/core/widgets/paperless_logo.dart';
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
import 'package:paperless_mobile/features/documents/cubit/documents_cubit.dart';
import 'package:paperless_mobile/features/saved_view/cubit/saved_view_cubit.dart';
import 'package:paperless_mobile/features/sharing/cubit/receive_share_cubit.dart';
import 'package:paperless_mobile/generated/assets.gen.dart';
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
import 'package:paperless_mobile/routes/typed/branches/documents_route.dart';
import 'package:paperless_mobile/routes/typed/branches/saved_views_route.dart';
import 'package:paperless_mobile/routes/typed/branches/upload_queue_route.dart';
import 'package:paperless_mobile/routes/typed/shells/authenticated_route.dart';
import 'package:paperless_mobile/routes/typed/top_level/changelog_route.dart';
import 'package:paperless_mobile/routes/typed/top_level/settings_route.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher_string.dart';
Expand Down Expand Up @@ -95,7 +98,7 @@ class AppDrawer extends StatelessWidget {
),
actionsAlignment: MainAxisAlignment.spaceBetween,
actions: [
Text("~ Anton"),
const Text("~ Anton"),
TextButton(
onPressed: Navigator.of(context).pop,
child: Text(S.of(context)!.gotIt),
Expand All @@ -105,6 +108,14 @@ class AppDrawer extends StatelessWidget {
);
},
),
ListTile(
dense: true,
leading: const Icon(Icons.history),
title: Text(S.of(context)!.changelog),
onTap: () {
ChangelogRoute().push(context);
},
),
ListTile(
dense: true,
leading: const Icon(Icons.bug_report_outlined),
Expand All @@ -127,9 +138,11 @@ class AppDrawer extends StatelessWidget {
),
ListTile(
dense: true,
leading: SvgPicture.asset(
"assets/images/github-mark.svg",
color: Theme.of(context).colorScheme.onBackground,
leading: Assets.images.githubMark.svg(
colorFilter: ColorFilter.mode(
Theme.of(context).colorScheme.onBackground,
BlendMode.srcIn,
),
height: 24,
width: 24,
),
Expand Down Expand Up @@ -215,7 +228,7 @@ class AppDrawer extends StatelessWidget {
const CreateSavedViewRoute(showInSidebar: true)
.push(context);
},
icon: Icon(Icons.add),
icon: const Icon(Icons.add),
label: Text(S.of(context)!.newView),
),
],
Expand All @@ -227,7 +240,7 @@ class AppDrawer extends StatelessWidget {
final view = sidebarViews[index];
return ListTile(
title: Text(view.name),
trailing: Icon(Icons.arrow_forward),
trailing: const Icon(Icons.arrow_forward),
onTap: () {
Scaffold.of(context).closeDrawer();
context
Expand Down
118 changes: 118 additions & 0 deletions lib/features/changelogs/view/changelog_dialog.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
import 'package:go_router/go_router.dart';
import 'package:paperless_mobile/extensions/flutter_extensions.dart';
import 'package:paperless_mobile/generated/l10n/app_localizations.dart';
import 'package:paperless_mobile/theme.dart';

class ChangelogDialog extends StatelessWidget {
const ChangelogDialog({super.key});

@override
Widget build(BuildContext context) {
return AlertDialog(
contentPadding: EdgeInsets.zero,
actionsPadding: const EdgeInsets.all(4),
title: Text(S.of(context)!.changelog),
content: FutureBuilder<String>(
future: _loadChangelog(context),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return const Center(
child: CircularProgressIndicator(),
).padded(24);
}
return SizedBox(
width: 1000,
child: Markdown(
data: snapshot.data!,
),
);
},
),
actions: [
TextButton(
child: Text(S.of(context)!.close),
onPressed: () {
context.pop();
},
),
],
);
}

Future<String> _loadChangelog(BuildContext context) async {
final languageCode = Localizations.localeOf(context).languageCode;
final locale = switch (languageCode) {
'de' => 'de-DE',
_ => 'en-US',
};
'en-US';
String changelog = await rootBundle.loadString(
'assets/changelogs/changelogs_$locale.md',
);
for (var versionNumber in _versionNumbers.keys) {
changelog = changelog.replaceFirst(
RegExp('# $versionNumber'),
'# v${_versionNumbers[versionNumber]!}',
);
}
return changelog;
}
}

const _versionNumbers = {
"53": "3.0.6",
"52": "3.0.5",
"51": "3.0.4",
"50": "3.0.3",
"49": "3.0.2",
"48": "3.0.1",
"47": "3.0.0",
"46": "2.3.11",
"45": "2.3.10",
"44": "2.3.9",
"43": "2.3.8",
"42": "2.3.7",
"41": "2.3.6",
"40": "2.3.5",
"39": "2.3.4",
"38": "2.3.3",
"37": "2.3.2",
"36": "2.3.1",
"35": "2.3.0",
"34": "2.2.6",
"33": "2.2.5",
"32": "2.2.4",
"31": "2.2.3",
"30": "2.2.2",
"29": "2.2.1",
"28": "2.2.0",
"27": "2.1.0",
"26": "2.0.9",
"25": "2.0.8",
"24": "2.0.7",
"23": "2.0.6",
"22": "2.0.5",
"21": "2.0.4",
"20": "2.0.3",
"19": "2.0.2",
"18": "2.0.1",
"17": "2.0.0",
"16": "1.5.3",
"15": "1.5.2",
"14": "1.5.1",
"13": "1.5.0",
"12": "1.4.1",
"11": "1.4.0",
"10": "1.3.1",
"9": "1.3.0",
"8": "1.2.2",
"7": "1.2.1",
"6": "1.2.0",
"5": "1.1.0",
"3": "1.0.5",
"4": "1.0.6",
"2": "1.0.4",
};
Loading

0 comments on commit 2484bd2

Please sign in to comment.