@overmap-ai/core 1.0.38-component-fields.29 → 1.0.38-component-fields.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3097,6 +3097,22 @@ const userFormSlice = createSlice({
3097
3097
  }
3098
3098
  form.favorite = false;
3099
3099
  },
3100
+ attachFormToComponentStage: (state, action) => {
3101
+ const { formId: formId2, componentStageId } = action.payload;
3102
+ const form = state.userForms[formId2];
3103
+ if (!form) {
3104
+ throw new Error("No form exists with the id " + formId2);
3105
+ }
3106
+ form.component_stage = componentStageId;
3107
+ },
3108
+ removeFormFromComponentStage: (state, action) => {
3109
+ const { formId: formId2 } = action.payload;
3110
+ const form = state.userForms[formId2];
3111
+ if (!form) {
3112
+ throw new Error("No form exists with the id " + formId2);
3113
+ }
3114
+ form.component_stage = void 0;
3115
+ },
3100
3116
  deleteUserForm: (state, action) => {
3101
3117
  delete state.userForms[action.payload];
3102
3118
  }
@@ -3112,6 +3128,8 @@ const {
3112
3128
  deleteUserFormSubmissions,
3113
3129
  favoriteForm,
3114
3130
  unfavoriteForm,
3131
+ attachFormToComponentStage,
3132
+ removeFormFromComponentStage,
3115
3133
  deleteUserForm,
3116
3134
  deleteUserFormRevision,
3117
3135
  deleteUserFormRevisions,
@@ -5640,6 +5658,46 @@ class UserFormService extends BaseApiService {
5640
5658
  throw e;
5641
5659
  }
5642
5660
  }
5661
+ async attachToComponentStage(formId2, componentStageId) {
5662
+ const { store } = this.client;
5663
+ store.dispatch(attachFormToComponentStage({ formId: formId2, componentStageId }));
5664
+ try {
5665
+ await this.enqueueRequest({
5666
+ description: "Attach form to component stage",
5667
+ method: HttpMethod.PATCH,
5668
+ url: `/forms/${formId2}/`,
5669
+ payload: { component_stage: componentStageId },
5670
+ queryParams: {
5671
+ component_stage: componentStageId
5672
+ },
5673
+ blockers: [formId2, componentStageId],
5674
+ blocks: [formId2]
5675
+ });
5676
+ } catch (e) {
5677
+ store.dispatch(removeFormFromComponentStage({ formId: formId2 }));
5678
+ throw e;
5679
+ }
5680
+ }
5681
+ async removeFromComponentStage(formId2, componentStageId) {
5682
+ const { store } = this.client;
5683
+ store.dispatch(removeFormFromComponentStage({ formId: formId2 }));
5684
+ try {
5685
+ await this.enqueueRequest({
5686
+ description: "Remove form from component stage",
5687
+ method: HttpMethod.PATCH,
5688
+ url: `/forms/${formId2}/`,
5689
+ payload: { component_stage: void 0 },
5690
+ queryParams: {
5691
+ component_stage: componentStageId
5692
+ },
5693
+ blockers: [formId2, componentStageId],
5694
+ blocks: [formId2]
5695
+ });
5696
+ } catch (e) {
5697
+ store.dispatch(attachFormToComponentStage({ formId: formId2, componentStageId }));
5698
+ throw e;
5699
+ }
5700
+ }
5643
5701
  async delete(formId2) {
5644
5702
  const { store } = this.client;
5645
5703
  const state = store.getState();
@@ -11976,6 +12034,7 @@ export {
11976
12034
  addUsers,
11977
12035
  addWorkspace,
11978
12036
  areArraysEqual,
12037
+ attachFormToComponentStage,
11979
12038
  authReducer,
11980
12039
  authSlice,
11981
12040
  blobToBase64,
@@ -12098,6 +12157,7 @@ export {
12098
12157
  removeComponent,
12099
12158
  removeEmailDomain,
12100
12159
  removeFavouriteProjectId,
12160
+ removeFormFromComponentStage,
12101
12161
  removeIssue,
12102
12162
  removeIssueComment,
12103
12163
  removeOrganizationAccess,