summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issue_show/stores/index.js
blob: 9ba3c285e7057e24f8148c957a93d9effefa4fe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
export default class Store {
  constructor({
    titleHtml,
    titleText,
    descriptionHtml,
    descriptionText,
    updatedAt,
    updatedByName,
    updatedByPath,
  }) {
    this.state = {
      titleHtml,
      titleText,
      descriptionHtml,
      descriptionText,
      taskStatus: '',
      updatedAt,
      updatedByName,
      updatedByPath,
<<<<<<< HEAD
    };
    this.formState = {
      title: '',
      confidential: false,
      description: '',
      lockedWarningVisible: false,
<<<<<<< HEAD
      move_to_project_id: 0,
      updateLoading: false,
<<<<<<< HEAD
=======
>>>>>>> 6a14a51... Show warning if realtime data has changed since the form has opened
=======
>>>>>>> 6becf28... use formState to update loading of save button
=======
>>>>>>> 07c984d... Port fix-realtime-edited-text-for-issues 9-2-stable fix to master.
    };
  }

  updateState(data) {
    this.state.titleHtml = data.title;
    this.state.titleText = data.title_text;
    this.state.descriptionHtml = data.description;
    this.state.descriptionText = data.description_text;
    this.state.taskStatus = data.task_status;
    this.state.updatedAt = data.updated_at;
    this.state.updatedByName = data.updated_by_name;
    this.state.updatedByPath = data.updated_by_path;
<<<<<<< HEAD
  }

  stateShouldUpdate(data) {
    return {
      title: this.state.titleText !== data.title_text,
      description: this.state.descriptionText !== data.description_text,
    };
  }

  setFormState(state) {
    this.formState = Object.assign(this.formState, state);
  }

  stateShouldUpdate(data) {
    return {
      title: this.state.titleText !== data.title_text,
      description: this.state.descriptionText !== data.description_text,
    };
  }

  setFormState(state) {
    this.formState = Object.assign(this.formState, state);
=======
>>>>>>> 07c984d... Port fix-realtime-edited-text-for-issues 9-2-stable fix to master.
  }
}