Giter Club home page Giter Club logo

collaction_cms's People

Contributors

xazin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

collaction_cms's Issues

Create a bloc, a repo and pertinent values, entities, interfaces and extra logic to handle assigning commitments, editing their values and adding blocks.

The state of this bloc should be a List<Commitments> and its initial state should be empty.

Should implement the following events:

  • Adding a commitment
  • Updating a commitment

Consider that the state of the bloc should be immutable so instead of calling the following method to add commitments List.add() is better to add a commitment like this: [...state.commitments, event.commitment]

And to update a commitment:

      var newCommitments = commitments.map((commitment) {
        if(commitment.id == event.commitment.id) {
          return event.commitment;
        }  else {
          return commitment;
        }
      }).toList();

Implement "Already an admin? Go to login" hyperlink

Should be implemented on create_credentials.dart card and link_auth_page.dart

You can find the reference in Figma - CMS project inside CollAction App. the style should be the same (Text color, padding, TextStyle). After triggering onTap the app should navigate to logIn page or to authentication.page.dart. So use GestureDectector or other method to achieve this. Because the navigation Bloc depends on Auth Bloc, one way to achieve this is to emit AuthEvent.authCheckRequested()

Support for user profile.

  • Make appropriate changes in Domain to support profile.
    Keep in mind that there are two types of profile: Admins and Moderators, one approach to handle this is creating an enum and field, like Role { admin, moderator }
  • Create a Bloc, states and events to handle Profile in the application.
    The reason for this is to allow the app to respond to the user's role. For example, if the user is a moderator, options to invite moderators or promote them should not appear. One approach is to listen to AuthBloc user stream.
  • #55 (This could be optional)
  • #56

Improve Invite Admin modal routing

Invite admin modal should be closed without triggering a new application event. If complications appear when taking this approach a new bloc is needed to handle invitation that doesn't trigger navigation events.

Implement invitation modal / invitation flow

Small Description:

The current CMS only allows for admin invitation, but it needs to be replaced with a system that allows admins to invite moderators and promote them to admin. After the update, admins will have two options available: inviting moderators and promoting them to admin.

  • Create the UI of the modal, this issue depends on the issue #54
  • Implement the necessary changes to support this regarding the infrastructure / repository. AuthApiRepository
    This depends on a change that is needed on the api. But the base of the repository could be changed anyway. Right now there's no endpoint to perform the "moderator invitation process". But we could use something like v1/auth/invite-moderator. And leave it there till the endpoint is ready.
  • Implement the necessary changes to support this regarding the application / bloc. AuthBloc
  • Implement the necessary changes to support this regarding UI / infrastructure(repos) / application(bloc). E.g changing naming of "invite admin" to "invite moderator" in cases that are appropriate.

Create UI for the CrowdAction Info form section.

Subtasks

  • Create a shared TextFormField.
    • Check CollActionInputField widget, should be something similar
  • Implement validation logic and error messages.
    • There are some validation function and types ValueFailures in Domain that can be used, can be found in value_validators.dart and value_failures.dart. Also there is a logic to map the values from domain to presentation "displayable" values. Check MapValidationOutput class.
  • Create a parent widget or intermediary that handle all the fields.
    • This should be the intermediary between all the fields and the widget that binds all the forms sections.
  • Implement calendars for date fields.
    • A nice package is syncfusion_flutter_calendar, extra customization it's needed in order to follow CollAction styles.

Create constants or Enums for type and categories fields.

This should be created in Domain. And also have an extension method to get the value for presentation layer and a JsonValue annotation. We use properCase for the presentation and upperCase for sending the request to the api

Check Status enum

Design new invitation modal

Admins should be able to invite moderators and promote moderators to admin. The Invitation modal should have both options.

The modal should contain the following:

  • Title: could be Admin Panel.
  • Description paragraph, similar to the one that is implemented, just replace admin for moderator.
  • Label 1: Invite a moderator
  • Text Field
  • Label 2: Promote a moderator
  • Text Field
  • "Send" Button.

Check Figma for a reference "Invite an admin modal"

Regularize the design mock-ups

Implement Atomic design. Create components with auto-layout. If possible, implement CollAction style or expand the global style. Standardize the styles used.

Create "You are all set" content in create_credentials.dart card

This card or content will be displayed on create_credentials.dart screen when the state is AuthState.adminCreationCompleted(), so once the user adds their password and is successfully updated, the content of the card changes.

Also, the button "Go to log in" should trigger the bloc event AuthEvent.signOut()

The design will be on Figma - CollAction App/CMS page. Under the name of "You are all set card" on the canvas

Implement CrowdActions View

Check Figma CrowdAction View in Final screens for reference.

  • Create the UI of CrowdAction View / Text composition components
  • Wrap the title of crowdActions items with GestureDetetor or a similar widget so that clicking it triggers a navigation to crowdAction view.
  • Configure GoRouter to support this. Would be a dynamic routing.
  • Create pertinent Domain entities and values like commitments.
  • Create a bloc that deals with "getting" the crowdAction, lets call it: SelectedCrowdActionBloc or something like that.
    Basically when an admin clicks a crowdAction's title on the table. it will trigger a NavigationEvent and also trigger a bloc event so that the selected crowdAction is "uploaded into a SelectedCrowdActionBloc". And the widget that manages the presentation can consume the state.

Create Domain Entity / Value , Repository interface, Infrastructure repository, Dto, Bloc states, events and application for CrowdActions getter

Should include pagination support and filters actions, you can find the UI reference in Figma - CMS project inside CollAction App on CrowdActions view screen. Also for the application, infrastructure and domain, you can find a reference in collaction_app, crowdactions_getter_bloc.dart and inside infrastructure/crowdactions .

Maybe we should breakdown this issue in multiple ones. Any Suggestions?

Split AuthBloc in two

Split AuthBloc in two blocs. The first bloc is going to handle Authentication state, authenticated or unauthenticated and related events such as AuthEvent.authCheckRequested() and AuthEvent.signedOut(). The second bloc will handle authentication events such as: invite moderators, promote admins, verify user, etc.

[Frontend] Design modal for creating CrowdAction Draft

Description:
On the CrowdActions page, we will have a button to add a new crowdaction. The button will open a modal asking for the information needed to create a draft.

There will be two submit buttons:

  • Create
  • Create and Follow

Create: Creates the CrowdAction and refreshes the CrowdActions page
Create and Follow: Creates the CrowdAction and open the newly added CrowdAction

Ported from Jira

Fix Pagination issue

When triggering pagination events, the following error is produced

Expected a value of type 'String', but got one of type 'Null'

Code generation issues

getting this when using freezed :-

../../../../../.pub-cache/hosted/pub.dev/file-6.1.2/lib/src/interface/file.dart:15:16: Error: The method 'File.create' has fewer named arguments than those of overridden method 'File.create'. Future<File> create({bool recursive = false}); ^ ../../../../../DevSDK/flutter/bin/cache/dart-sdk/lib/io/file.dart:232:16: Context: This is the overridden method ('create'). Future<File> create({bool recursive = false, bool exclusive = false}); ^ ../../../../../.pub-cache/hosted/pub.dev/file-6.1.2/lib/src/interface/file.dart:15:16: Error: The method 'File.create' doesn't have the named parameter 'exclusive' of overridden method 'File.create'. Future<File> create({bool recursive = false}); ^ ../../../../../DevSDK/flutter/bin/cache/dart-sdk/lib/io/file.dart:232:16: Context: This is the overridden method ('create'). Future<File> create({bool recursive = false, bool exclusive = false}); ^ ../../../../../.pub-cache/hosted/pub.dev/file-6.1.2/lib/src/forwarding/forwarding_file.dart:22:8: Error: The method 'ForwardingFile.createSync' has fewer named arguments than those of overridden method 'File.createSync'. void createSync({bool recursive = false}) => ^ ../../../../../DevSDK/flutter/bin/cache/dart-sdk/lib/io/file.dart:248:8: Context: This is the overridden method ('createSync'). void createSync({bool recursive = false, bool exclusive = false}); ^ ../../../../../.pub-cache/hosted/pub.dev/file-6.1.2/lib/src/forwarding/forwarding_file.dart:22:8: Error: The method 'ForwardingFile.createSync' doesn't have the named parameter 'exclusive' of overridden method 'File.createSync'. void createSync({bool recursive = false}) => ^ ../../../../../DevSDK/flutter/bin/cache/dart-sdk/lib/io/file.dart:248:8: Context: This is the overridden method ('createSync'). void createSync({bool recursive = false, bool exclusive = false}); ^ ../../../../../.pub-cache/hosted/pub.dev/file-6.1.2/lib/src/backends/memory/memory_file.dart:57:8: Error: The method 'MemoryFile.createSync' has fewer named arguments than those of overridden method 'File.createSync'. void createSync({bool recursive = false}) { ^ ../../../../../DevSDK/flutter/bin/cache/dart-sdk/lib/io/file.dart:248:8: Context: This is the overridden method ('createSync'). void createSync({bool recursive = false, bool exclusive = false}); ^ ../../../../../.pub-cache/hosted/pub.dev/file-6.1.2/lib/src/backends/memory/memory_file.dart:57:8: Error: The method 'MemoryFile.createSync' doesn't have the named parameter 'exclusive' of overridden method 'File.createSync'. void createSync({bool recursive = false}) { ^ ../../../../../DevSDK/flutter/bin/cache/dart-sdk/lib/io/file.dart:248:8: Context: This is the overridden method ('createSync'). void createSync({bool recursive = false, bool exclusive = false}); ^ ../../../../../.pub-cache/hosted/pub.dev/pub_semver-2.1.0/lib/src/version_constraint.dart:96:13: Error: Method not found: 'FallThroughError'. throw FallThroughError(); ^^^^^^^^^^^^^^^^ ../../../../../.pub-cache/hosted/pub.dev/build_runner-2.1.7/lib/src/build_script_generate/bootstrap.dart:76:40: Error: Method not found: 'NullThrownError'. final error = e[0] as Object? ?? NullThrownError();

Implement crowdAction creation support ๐Ÿš€

Provisional steps to tackle this issue:

Check Figma for the UI reference of CrowdAction Info, Images, Assign Commitments and Assigned Commitments

Architecture

To separate and encapsulate the logic of the form, One approach is to create a bloc for each section and a "high order bloc" that is going to be subscribed to all the other blocs. So everytime there is a state change in one of the "sub-blocs", it going to trigger a state update in the main bloc.

Could be blocs or cubits depending on the situation.

Subtasks

Create a bloc to handle the logic of the Images form section

The files should be uploaded to the bloc as Uint8List. flutter_dropzone and file_pickerprovide a callback / and method to read the file as bytes. This is important because when the POST multipart request is executed the images are going to be sent as bytes? (I think that is the best method but I'm no 100% sure) http.MultipartFile.fromBytes

The event is going to be emitted everytime a file is uploaded

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.