Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error catching added to workspace settings workflow #991

Open
wants to merge 50 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f9b64cd
Conflicts resolved
Oct 7, 2021
742a186
Create organization with default email completed
Oct 7, 2021
1e68b2d
Edit profile done
Oct 7, 2021
443dd00
resolved changes requested
Oct 8, 2021
52bd906
Merge remote-tracking branch 'upstream/dev' into editprofile
Oct 8, 2021
122101a
Merge remote-tracking branch 'upstream/dev' into editprofile
Oct 8, 2021
facb22d
Merge branch 'editprofile' of https://github.com/Lord-Chris/zc_app in…
Oct 8, 2021
6b76025
Conflicts merged
Oct 8, 2021
322d0e3
Fixed edit profile feature
Oct 13, 2021
dd1148d
conflicts fixed
Oct 13, 2021
350837b
app bundle and package name changed
Oct 13, 2021
386b71b
changed package id
Oct 13, 2021
99c3b6a
conflicts resolved
Oct 13, 2021
0305c9b
fixed issues
Oct 13, 2021
cb2f927
Workspace settings, phase 1
Oct 14, 2021
0858d8d
workspace settings phase 2
Oct 14, 2021
b4cd5b4
Workspace Settings complete
Oct 14, 2021
0d5f542
Reverted package name change
Oct 14, 2021
71a955b
Conflicts resolved, merged upstream
Oct 14, 2021
a9c1e47
Conflicts resolved, merged upstream
Oct 14, 2021
dc15015
Merge branch 'editprofile' of https://github.com/Lord-Chris/zc_app in…
Oct 14, 2021
c16b75d
change resolved
Oct 14, 2021
03e5b95
Merge branch 'dev' into editprofile
Lord-Chris Oct 14, 2021
6a7760f
Conflicts resolved
Oct 15, 2021
55a2255
Changes resolved 2
Oct 15, 2021
ac57717
Conflicts resolved 2
Oct 15, 2021
752070c
Fixed conflicts again
Oct 15, 2021
e685891
Fixed conflicts again
Oct 15, 2021
ffd93ac
Merge branch 'editprofile' of https://github.com/Lord-Chris/zc_app in…
Oct 15, 2021
a00002e
Merge branch 'editprofile' of https://github.com/Lord-Chris/zc_app in…
Oct 15, 2021
80ca61c
Merge branch 'editprofile' of https://github.com/Lord-Chris/zc_app in…
Oct 15, 2021
b2c2342
Merge branch 'editprofile' of https://github.com/Lord-Chris/zc_app in…
Oct 15, 2021
5eae388
Merge branch 'editprofile' of https://github.com/Lord-Chris/zc_app in…
Oct 15, 2021
d823f73
Merge remote-tracking branch 'upstream/dev' into editprofile
Oct 16, 2021
e235988
Merge remote-tracking branch 'upstream/dev' into editprofile
Oct 16, 2021
5210664
Changed package name
Oct 16, 2021
d5d1a0d
conflicts fixed
Oct 16, 2021
0145f82
added error catching to workspace settings
Oct 16, 2021
a690627
Conficts resolved
Oct 16, 2021
e81decc
changes fixed and workspace settings work now
Oct 16, 2021
ebeb8ca
conflicts merge
Oct 16, 2021
758eba2
Conficts resolved
Oct 16, 2021
fd162dc
Conficts resolved
Oct 16, 2021
44991c3
Merge branch 'editprofile' of https://github.com/Lord-Chris/zc_app in…
Oct 16, 2021
865da56
Merge remote-tracking branch 'upstream/dev' into editprofile
Oct 16, 2021
6c2c471
Merge remote-tracking branch 'upstream/dev' into editprofile
Oct 16, 2021
3140d78
changes resolved
Oct 16, 2021
ed20eb4
Merge remote-tracking branch 'upstream/dev' into editprofile
Oct 16, 2021
5d8657a
Merge remote-tracking branch 'upstream/dev' into editprofile
Oct 16, 2021
b79dca2
Merge branch 'editprofile' of https://github.com/Lord-Chris/zc_app in…
Oct 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/app/app.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:zurichat/services/centrifuge_service.dart';
import 'package:zurichat/services/localization_service.dart';
import 'package:zurichat/services/media_service.dart';
Expand Down Expand Up @@ -33,7 +32,6 @@ import 'package:zurichat/ui/view/forgot_password/forgot_password_email/forgot_pa
import 'package:zurichat/ui/view/forgot_password/forgot_password_new_password/forgot_password_newview.dart';
import 'package:zurichat/ui/view/forgot_password/forgot_password_otp/forgot_password_otpview.dart';
import 'package:zurichat/ui/view/webview_page/webview_page.dart';

import 'package:shared_preferences/shared_preferences.dart';
import 'package:stacked/stacked_annotations.dart';
import 'package:stacked_services/stacked_services.dart';
Expand Down
2 changes: 0 additions & 2 deletions lib/app/app.locator.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions lib/app/app.router.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/package/base/server-request/api/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ abstract class Api {
});

// THE SERVICE TO UPDATE AN ORGANIZATION LOGO
Future updateOrgLogo(String orgId, File image, token);
Future<bool> updateOrgLogo(String orgId, File image, token);

// THE SERVICE TO ADD A MEMBERS TO AN ORGANIZATION
Future addMemberToOrganization(String orgId, String email, token);
Expand Down
11 changes: 8 additions & 3 deletions lib/package/base/server-request/api/zuri_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ class ZuriApi implements Api {
} on DioError catch (e) {
log.w(e.toString());
handleApiError(e);
throw e.response!.data['message'];
}
}

Expand All @@ -340,32 +341,36 @@ class ZuriApi implements Api {
} on DioError catch (e) {
log.w(e.toString());
handleApiError(e);
throw e.response!.data['message'];
}
}

/// Updates an organization's logo. The organization's id `orgId` must not be
/// null or empty
@override
Future updateOrgLogo(String orgId, File image, token) async {
Future<bool> updateOrgLogo(String orgId, File image, token) async {
try {
var formData = FormData.fromMap({
'height': 300,
'width': 300,
"image": await MultipartFile.fromFile(
image.path,
filename: image.path.split(Platform.pathSeparator).last,
contentType: MediaType('image', 'jpeg'),
),
});
final res = await dio.patch(
await dio.patch(
'${coreBaseUrl}organizations/$orgId/logo',
options: Options(
headers: {'Authorization': 'Bearer $token'},
),
data: formData,
);
return res.data['message'];
return true;
} on DioError catch (e) {
log.w(e.toString());
handleApiError(e);
throw e.response?.data['message'];
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import 'package:flutter/material.dart';

import 'package:zurichat/ui/shared/shared.dart';
import 'package:zurichat/ui/shared/text_styles.dart';
import 'package:zurichat/ui/shared/zuri_appbar.dart';
import 'package:zurichat/ui/view/organization/invite_to_organization/invite_via_email/invite_viewmodel.dart';
import 'package:zurichat/utilities/internalization/localization/app_localization.dart';

import 'package:stacked/stacked.dart';

class CreateInviteLink extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';

import 'package:zurichat/ui/shared/shared.dart';
import 'package:zurichat/ui/shared/text_styles.dart';
import 'package:zurichat/ui/shared/zuri_appbar.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';

import 'package:zurichat/ui/shared/long_button.dart';
import 'package:zurichat/ui/shared/shared.dart';
import 'package:zurichat/ui/shared/text_styles.dart';
import 'package:zurichat/ui/shared/ui_helpers.dart';
import 'package:zurichat/ui/shared/zuri_appbar.dart';
import 'package:zurichat/ui/view/organization/invite_to_organization/invite_via_email/invite_viewmodel.dart';
import 'package:zurichat/utilities/internalization/localization/app_localization.dart';

import 'package:stacked/stacked.dart';

class InvitationSent extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import 'package:flutter/material.dart';

import 'package:zurichat/ui/nav_pages/plugin_page/widgets/custom_search_field.dart';
import 'package:zurichat/ui/shared/text_styles.dart';
import 'package:zurichat/ui/shared/zuri_appbar.dart';
import 'package:zurichat/utilities/internalization/localization/app_localization.dart';

import 'package:stacked/stacked.dart';

import '../invite_via_email/invite_viewmodel.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';

import 'package:zurichat/ui/shared/shared.dart';
import 'package:zurichat/ui/shared/text_styles.dart';
import 'package:zurichat/ui/shared/zuri_appbar.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import 'package:zurichat/services/user_service.dart';
import 'package:zurichat/utilities/constants.dart';
import 'package:zurichat/utilities/mixins/validators_mixin.dart';
import 'package:zurichat/utilities/storage_keys.dart';

import '../../../../../../app/app.logger.dart';
import 'package:stacked_services/stacked_services.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';

import 'package:zurichat/constants/app_strings.dart';
import 'package:zurichat/ui/shared/text_styles.dart';
import 'package:zurichat/ui/shared/text_field.dart';
import 'package:zurichat/utilities/enums.dart';
import 'package:zurichat/utilities/internalization/localization/app_localization.dart';

import 'package:stacked/stacked.dart';

import '../../../shared/shared.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@

import 'package:zurichat/app/app.locator.dart';
import 'package:zurichat/app/app.router.dart';
import 'package:zurichat/ui/shared/colors.dart';
import 'package:zurichat/utilities/enums.dart';
import 'package:zurichat/utilities/mixins/validators_mixin.dart';

import 'package:stacked/stacked.dart';
import 'package:stacked_services/stacked_services.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,25 @@ class OrganizationLogo extends StatelessWidget {
@override
Widget build(BuildContext context) {
final bool _dark = Theme.of(context).brightness == Brightness.dark;

return ViewModelBuilder<OrganizationSettingsViewModel>.reactive(
viewModelBuilder: () => OrganizationSettingsViewModel(),
builder: (context, model, child) {
return Scaffold(
appBar: ZuriAppBar(
isDarkMode: _dark,
whiteBackground: true,
leading: Icons.chevron_left,
leading: Icons.close,
leadingPress: () => model.back(),
orgTitle: Text(
Lord-Chris marked this conversation as resolved.
Show resolved Hide resolved
OrgIcon,
style: AppTextStyle.organizationNameText,
),
title: OrgIcon,
Lord-Chris marked this conversation as resolved.
Show resolved Hide resolved
subtitle: '',
actions: [
TextButton(
onPressed: () => model.updateOrgLogo(org.id.toString()),
child: Text(
Save,
style: AppTextStyle.lightGreySize16.copyWith(
color: AppColors.zuriPrimaryColor,
),
style: _dark
? AppTextStyle.lightGreySize16
: AppTextStyle.darkGreySize16,
),
),
],
Expand Down Expand Up @@ -79,15 +76,19 @@ class OrganizationLogo extends StatelessWidget {
width: 200,
),
const SizedBox(height: 30),
Text(OrgIconGuide,
Lord-Chris marked this conversation as resolved.
Show resolved Hide resolved
style: _dark
? AppTextStyle.whiteSize18Bold
: AppTextStyle.blackSize18Bold),
Text(
OrgIconGuide,
style: AppTextStyle.blackSize18Bold.copyWith(
color: _dark
? AppColors.whiteColor
: AppColors.blackColor),
),
const SizedBox(height: 10),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Text(OrgIconGuideDesc,
style: AppTextStyle.lightGreySize16),
Text(
OrgIconGuideDesc,
style: _dark
? AppTextStyle.lightGreySize16
: AppTextStyle.darkGreySize16,
),
],
),
Expand Down
Loading