Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

chore: issues filtering flow #167

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*.log
*.pyc
*.swp
*.freezed.dart
*.g.dart
.DS_Store
.atom/
.buildlog/
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ android {
applicationId "com.plane.so"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 19
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:plane/bottom_sheets/global_search_sheet.dart';
import 'package:plane/bottom_sheets/select_workspace.dart';
import 'package:plane/bottom-sheets/global_search_sheet.dart';
import 'package:plane/bottom-sheets/select_workspace.dart';
import 'package:plane/models/user_profile_model.dart';
import 'package:plane/models/workspace_model.dart';
import 'package:plane/models/Workspace/workspace_model.dart';
import 'package:plane/provider/dashboard_provider.dart';
import 'package:plane/provider/global_search_provider.dart';
import 'package:plane/provider/profile_provider.dart';
import 'package:plane/provider/projects_provider.dart';
import 'package:plane/provider/provider_list.dart';
import 'package:plane/provider/workspace_provider.dart';
import 'package:plane/screens/MainScreens/Home/Dashboard/dash_board_screen.dart';
import 'package:plane/screens/on_boarding/auth/setup_workspace.dart';
import 'package:plane/screens/dashboard/dash_board_screen.dart';
import 'package:plane/screens/onboarding/auth/setup_workspace.dart';

import 'package:plane/utils/enums.dart';

Expand Down
14 changes: 8 additions & 6 deletions lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:loading_indicator/loading_indicator.dart';
import 'package:plane/provider/workspace_provider.dart';
import 'package:plane/screens/on_boarding/auth/invite_co_workers.dart';
import 'package:plane/screens/on_boarding/auth/join_workspaces.dart';
import 'package:plane/screens/on_boarding/auth/setup_profile_screen.dart';
import 'package:plane/screens/on_boarding/auth/setup_workspace.dart';
import 'package:plane/screens/on_boarding/auth/sign_in.dart';
import 'package:plane/screens/onboarding/auth/invite_co_workers.dart';
import 'package:plane/screens/onboarding/auth/join_workspaces.dart';
import 'package:plane/screens/onboarding/auth/setup_profile_screen.dart';
import 'package:plane/screens/onboarding/auth/setup_workspace.dart';
import 'package:plane/screens/onboarding/auth/sign_in.dart';
import 'package:plane/startup/dependency_resolver.dart';
import 'package:plane/widgets/error_state.dart';
import 'utils/enums.dart';
Expand All @@ -31,7 +31,9 @@ class _AppState extends ConsumerState<App> {
final configProvider = ref.watch(ProviderList.configProvider);
final themeProvider = ref.watch(ProviderList.themeProvider);
return Scaffold(
body: (configProvider.getConfigState == StateEnum.loading ||
body: (
// TODO -> Config API should be re-initiated once the API added in this base API
// configProvider.getConfigState == StateEnum.loading ||
profileProv.getProfileState == StateEnum.loading ||
workspaceProv.workspaceInvitationState == StateEnum.loading)
? Center(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DeleteLabelSheet extends ConsumerStatefulWidget {
class _DeleteLabelSheetState extends ConsumerState<DeleteLabelSheet> {
@override
Widget build(BuildContext context) {
final issuesProvider = ref.read(ProviderList.issuesProvider);
final labelNotifier = ref.read(ProviderList.labelProvider.notifier);
return Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
child: Column(
Expand Down Expand Up @@ -62,20 +62,7 @@ class _DeleteLabelSheetState extends ConsumerState<DeleteLabelSheet> {
padding: const EdgeInsets.only(bottom: 20),
child: Button(
ontap: () async {
await issuesProvider
.issueLabels(
slug: ref
.watch(ProviderList.workspaceProvider)
.selectedWorkspace
.workspaceSlug,
projID: ref
.watch(ProviderList.projectProvider)
.currentProject['id'],
method: CRUD.delete,
data: {},
labelId: widget.labelId,
ref: ref)
.then((value) {
await labelNotifier.deleteLabel(widget.labelId).then((value) {
ref.read(ProviderList.issuesProvider).filterIssues(
slug: ref
.watch(ProviderList.workspaceProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class _DeleteLeaveProjectSheetState
Widget build(BuildContext context) {
final themeProvider = ref.watch(ProviderList.themeProvider);
final projectProvider = ref.watch(ProviderList.projectProvider);
final profileProvider = ref.watch(ProviderList.profileProvider);

return GestureDetector(
onTap: () {
FocusScope.of(context).unfocus();
Expand Down Expand Up @@ -234,7 +236,8 @@ class _DeleteLeaveProjectSheetState
postHogService(
eventName: 'LEAVE_PROJECT',
properties: widget.data,
ref: ref);
userEmail: profileProvider.userProfile.email!,
userID: profileProvider.userProfile.id!);
Navigator.of(context)
..pop()
..pop()
Expand All @@ -260,7 +263,9 @@ class _DeleteLeaveProjectSheetState
postHogService(
eventName: 'DELETE_PROJECT',
properties: widget.data,
ref: ref);
userEmail:
profileProvider.userProfile.email!,
userID: profileProvider.userProfile.id!);
}
});
Navigator.of(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class _DeleteProjectSheetState extends ConsumerState<DeleteProjectSheet> {
Widget build(BuildContext context) {
final themeProvider = ref.watch(ProviderList.themeProvider);
final projectProviderRead = ref.watch(ProviderList.projectProvider);
final profileProvider = ref.watch(ProviderList.profileProvider);
return Padding(
padding:
EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
Expand Down Expand Up @@ -209,7 +210,8 @@ class _DeleteProjectSheetState extends ConsumerState<DeleteProjectSheet> {
postHogService(
eventName: 'DELETE_PROJECT',
properties: widget.data,
ref: ref);
userEmail: profileProvider.userProfile.email!,
userID: profileProvider.userProfile.id!);
}
});
Navigator.of(context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class DeleteStateSheet extends ConsumerStatefulWidget {
class _DeleteStateSheetState extends ConsumerState<DeleteStateSheet> {
@override
Widget build(BuildContext context) {
final projectProvider = ref.watch(ProviderList.projectProvider);
final themeProvider = ref.watch(ProviderList.themeProvider);
final issuesProvider = ref.watch(ProviderList.issuesProvider);
final statesProvider = ref.watch(ProviderList.statesProvider);
final statesProviderRead = ref.watch(ProviderList.statesProvider.notifier);
return LoadingWidget(
loading: projectProvider.stateCrudState == StateEnum.loading,
loading: statesProvider.deleteState == StateEnum.loading,
allowBorderRadius: true,
widgetClass: Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 30),
Expand Down Expand Up @@ -70,31 +70,11 @@ class _DeleteStateSheetState extends ConsumerState<DeleteStateSheet> {
Button(
color: const Color.fromRGBO(254, 242, 242, 1),
textColor: themeProvider.themeManager.textErrorColor,
filledButton: false,
borderColor: themeProvider.themeManager.textErrorColor,
text: 'Delete',
ontap: () async {
await projectProvider.stateCrud(
slug: ref
.watch(ProviderList.workspaceProvider)
.selectedWorkspace
.workspaceSlug,
projId: ref
.watch(ProviderList.projectProvider)
.currentProject['id'],
method: CRUD.delete,
stateId: widget.stateId,
context: context,
data: {},
ref: ref);
issuesProvider.getStates(
slug: ref
.watch(ProviderList.workspaceProvider)
.selectedWorkspace
.workspaceSlug,
projID: ref
.watch(ProviderList.projectProvider)
.currentProject['id'],
await statesProviderRead.deleteState(
stateId: widget.stateId,
);
Navigator.of(context).pop();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class _DeleteOrLeaveWorkpaceState extends ConsumerState<DeleteOrLeaveWorkpace> {
Widget build(BuildContext context) {
final themeProvider = ref.watch(ProviderList.themeProvider);
final workspaceProvider = ref.watch(ProviderList.workspaceProvider);
final profileProvider = ref.watch(ProviderList.profileProvider);
return GestureDetector(
onTap: () {
FocusScope.of(context).unfocus();
Expand Down Expand Up @@ -240,7 +241,8 @@ class _DeleteOrLeaveWorkpaceState extends ConsumerState<DeleteOrLeaveWorkpace> {
properties: {
'WORKSPACE_NAME': widget.workspaceName
},
ref: ref);
userEmail: profileProvider.userProfile.email!,
userID: profileProvider.userProfile.id!);
await ref
.watch(ProviderList.profileProvider)
.updateProfile(data: {
Expand Down Expand Up @@ -279,7 +281,8 @@ class _DeleteOrLeaveWorkpaceState extends ConsumerState<DeleteOrLeaveWorkpace> {
properties: {
'WORKSPACE_NAME': widget.workspaceName
},
ref: ref);
userEmail: profileProvider.userProfile.email!,
userID: profileProvider.userProfile.id!);
await ref
.watch(ProviderList.profileProvider)
.updateProfile(data: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:calendar_date_picker2/calendar_date_picker2.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:plane/models/project/state/state_model.dart';
import 'package:plane/models/issues.dart';
import 'package:plane/provider/cycles_provider.dart';
import 'package:plane/provider/modules_provider.dart';
Expand Down Expand Up @@ -36,18 +37,21 @@ part 'widgets/labels_filter.dart';

// ignore: must_be_immutable
class FilterSheet extends ConsumerStatefulWidget {
FilterSheet(
{super.key,
required this.issueCategory,
this.filtersData,
this.fromViews = false,
this.isArchived = false,
this.fromCreateView = false});
FilterSheet({
super.key,
required this.issueCategory,
this.filtersData,
this.fromViews = false,
this.isArchived = false,
this.fromCreateView = false,
this.cycleOrModuleId,
});
final IssueCategory issueCategory;
final bool fromCreateView;
final bool fromViews;
final bool isArchived;
dynamic filtersData;
String? cycleOrModuleId;
@override
ConsumerState<FilterSheet> createState() => _FilterSheetState();
}
Expand All @@ -67,14 +71,20 @@ class _FilterSheetState extends ConsumerState<FilterSheet> {
setState(() {});
},
ref: ref);

super.initState();
}

@override
Widget build(BuildContext context) {
final themeProvider = ref.watch(ProviderList.themeProvider);

log(ref
.read(ProviderList.cyclesProvider)
.issues
.filters
.priorities
.toString());
log(state.filters.priorities.toString());

return Container(
padding: const EdgeInsets.only(top: 20, left: 20, right: 20),
child: Stack(
Expand Down Expand Up @@ -156,9 +166,9 @@ class _FilterSheetState extends ConsumerState<FilterSheet> {
? Container()
: _saveView(state: state, ref: ref),
_applyFilterButton(
state: state,
context: context,
)
state: state,
context: context,
cycleOrModuleId: widget.cycleOrModuleId)
],
),
),
Expand Down
Loading