Skip to content

Feature/Routing Forms: Add the concepts of reusable Router and Router Linked Fields.#5566

Merged
kodiakhq[bot] merged 26 commits intomainfrom
hariom/cal-368-rfc-routing-forms-reusability-and
Jan 4, 2023
Merged

Feature/Routing Forms: Add the concepts of reusable Router and Router Linked Fields.#5566
kodiakhq[bot] merged 26 commits intomainfrom
hariom/cal-368-rfc-routing-forms-reusability-and

Conversation

@hariombalhara
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara commented Nov 17, 2022

What does this PR do?

Closes #5508

  • This is a live connection and editing the fields and routing in the form being used as Router should be reflected in the new form as well.

Loom Video: https://www.loom.com/share/d0ef3bcaa77c4c84b8159c255e744a14

Environment: Production

Type of change

  • New feature (non-breaking change which adds functionality)

How should this be tested?

  • See the loom

Documentation

  • Terminology

    • Router : A form that has been picked as a route.
    • F1 ← F2 : F2 is using F1 as a Router. We can call F1 a router in this context. Fields in F2 coming from F1 are called Router Linked Fields.
    • Connected Forms: For a relationship F1 ← F2, F2 is Connected Form
  • Restrictions

    • You can’t delete fields connected to a Router. To delete, you can remove the connection(by removing the Router from routes list). That would make all the Router fields local. After that you can delete them.
    • A multi-level relationship like F1<-F2<-F3 is not allowed only one level like F1<-F2 is allowed. This is to prevent creation of circular dependencies like F3<-F1<-F2<-F3
  • Actions

    • Disconnect → [Not yet Implemented]You can disconnect a router. When a Router is disconnected, the Router fields would become local and won’t get removed. The routing would also become local.
    • Removing a Router → Deleting a router removes the routing logic and corresponding fields of that Router from the connected form.
    • Adding after Removing → Adding after removing would re-add the fields. It simply marks the fields as non-delet
    • Updating Field → Modifying Type/Label/Required options of a field in a Router, updates them in the connected forms.
    • Delete Field → For a relationship F1 ← F2, if a field is deleted in F1, it won’t be deleted from F2 but become local in F2, so that it can be modified in F2.
  • Behaviours

    • If a form F2 picks F1 as a Router - F1’s deleted fields won’t appear in F2 anywhere.
    • If a relationship like F1 ← F2 exists, then F1 can’t have F2 in ‘Add a new Route’ listing. This is to avoid a circular relationship.
    • A form can be picked as a router only once in a given form.
  • Playright Tests

@linear
Copy link
Copy Markdown

linear Bot commented Nov 17, 2022

CAL-368 RFC: Routing Forms - Reusability and Extensibility of Router

  • Allow a Router to be created outside of a Form - Call it a Global Router
  • User can create a Global Router which would have just Form and Routing tabs.
    • This is because a Router can't be created without Form Fields.
  • When a new Form is created user can optionally select which Global Router to use. We can call such a Form as Global Router Linked Form
    • It would automatically add all the fields required by the Router in addition to Routing Rules
  • Characteristics of Global Router Linked Forms
    • Such a form has a Global Router which can be edited at one place and all Global Router Linked Forms linked to that Global Router would have the effect.
    • would have Global Router Fields locked
    • would have Global Router Rules locked
    • User can add more fields.
    • User would be able to add more Routing Rules
    • ~The way user can click Add a rule, user can do 'Add a Global Router'. This allows a scenario like Having a Global Router as 'Enterprise Client'(reusable across multiple forms) and make it AND/OR with other form specific rules.~ The ~striked off~ approach won't work as a Router also has the corresponding Route and not just the AND/OR condition. The only thing that's possible is to decide where exactly Global Router would come in ordered Routes list. So, there can be
      • R1, R2, GR(Global Route)
      • GR, R1, R2
      • R1, GR, R2
  • Global Routers should list which Forms are linked to it.
  • User can save an existing form as Global Router as well
  • Global Router Fields still can be re-ordered inside a Global Router Linked Form. That reordering would impact only that Form and not other Global Router Linked Forms or the Global Router itself. It can also be said that Global Router doesn't care about the ordering of fields. Global Router Linked Form cares about that.
  • User would be able to delete Global Router fields(Would be a soft delete only)

Legend:

  • Router is the Routing Rules which are available under the Routing tab

From SyncLinear.com | CAL-368

From SyncLinear.com

@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 17, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Jan 4, 2023 at 1:26PM (UTC)

Comment thread packages/lib/logger.ts
Comment thread packages/prisma/migrations/20221114095200_add_router_table/migration.sql Outdated
@hariombalhara hariombalhara force-pushed the hariom/cal-368-rfc-routing-forms-reusability-and branch from ebbf3af to 12516a8 Compare December 8, 2022 08:12
@hariombalhara hariombalhara changed the title Feature/Routing Forms: Ability to reuse an existing form as a router in a new form creating a connection b/w the two Feature/Routing Forms: Add the concepts of reusable Router and Router Linked Fields. Dec 8, 2022
@hariombalhara hariombalhara force-pushed the hariom/cal-368-rfc-routing-forms-reusability-and branch from 12516a8 to 190abb9 Compare December 8, 2022 10:52
@hariombalhara hariombalhara force-pushed the hariom/cal-368-rfc-routing-forms-reusability-and branch 2 times, most recently from 94407fb to d8a1608 Compare December 11, 2022 10:10
Copy link
Copy Markdown
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great new feature, it's approved from my side! Requesting changes for now to block merge until after holidays 🎄

@CarinaWolli
Copy link
Copy Markdown
Member

@hariombalhara Let's fix the merge conflicts and then I'll approve 🙏

@hariombalhara
Copy link
Copy Markdown
Member Author

@CarinaWolli Resolved.

@hariombalhara hariombalhara force-pushed the hariom/cal-368-rfc-routing-forms-reusability-and branch from 5d56824 to 733ff66 Compare January 4, 2023 13:04
@hariombalhara hariombalhara added ♻️ autoupdate tells kodiak to keep this branch up-to-date automerge labels Jan 4, 2023
@CarinaWolli CarinaWolli self-requested a review January 4, 2023 13:30
Copy link
Copy Markdown
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 🙏

@kodiakhq kodiakhq Bot merged commit 38b3563 into main Jan 4, 2023
@kodiakhq kodiakhq Bot deleted the hariom/cal-368-rfc-routing-forms-reusability-and branch January 4, 2023 13:30
@PeerRich PeerRich added the core area: core, team members only label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge ♻️ autoupdate tells kodiak to keep this branch up-to-date core area: core, team members only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CAL-368] RFC: Routing Forms - Reusability and Extensibility of Router

3 participants