CoreFiles by mySites.guru
mutations.es6.js52 lines, 1,310 bytes, from Joomla_6.1.4-Stable-Full_Package.zip
Raw History Compare with 6.1.3
md5
142e6a8c86c7225dc88efa5ba8cff24c
sha1
7bc4d7b5a2b89fa31efd5f2e20b04f6efce0b0e0
sha256
53292eb8469c383a34f8fe275001cc399be70fd1c71d1a4824d93c215181dcfa
/**
 * Vuex Mutations for synchronously modifying workflow state
 */
export default {
  SET_WORKFLOW_ID(state, id) {
    state.workflowId = id;
  },
  SET_WORKFLOW(state, workflow) {
    state.workflow = workflow;
  },
  SET_STAGES(state, stages) {
    state.stages = stages.map((stage, idx) => ({
      ...stage,
      position: {
        x: typeof stage?.position?.x === 'number' && !Number.isNaN(stage.position.x)
          ? stage.position.x
          : 100 + (idx % 4) * 400,
        y: typeof stage?.position?.y === 'number' && !Number.isNaN(stage.position.y)
          ? stage.position.y
          : 100 + Math.floor(idx / 4) * 300,
      },
    }));
  },
  SET_TRANSITIONS(state, transitions) {
    state.transitions = transitions;
  },
  SET_LOADING(state, loading) {
    state.loading = loading;
  },
  SET_ERROR(state, error) {
    state.error = error;
  },
  UPDATE_STAGE_POSITION(state, { id, x, y }) {
    state.stages = state.stages.map((stage) => {
      if (stage.id.toString() === id) {
        return {
          ...stage,
          position: {
            x,
            y,
          },
        };
      }
      return stage;
    });
  },
  SET_CANVAS_VIEWPORT(state, { zoom, panX, panY }) {
    state.canvas.zoom = zoom;
    state.canvas.panX = panX;
    state.canvas.panY = panY;
  },
};

The same content is in 18 releases, Joomla 6.1.0-beta1 to 6.1.4. See them all, or every version of this file.