ember-ebau-gwr 5.0.4 → 6.0.1

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +1 -1
  3. package/addon/components/instance-link.hbs +16 -0
  4. package/addon/components/linked-models.hbs +45 -41
  5. package/addon/components/linked-models.js +1 -0
  6. package/addon/components/linked-projects.hbs +7 -2
  7. package/addon/components/linked-projects.js +2 -1
  8. package/addon/components/login-modal.hbs +1 -0
  9. package/addon/components/model-errors/list.hbs +5 -3
  10. package/addon/components/model-form/date.hbs +30 -19
  11. package/addon/components/model-form/date.js +6 -0
  12. package/addon/components/model-form/field.js +1 -5
  13. package/addon/components/model-form/header/actions.hbs +2 -2
  14. package/addon/components/model-form/header/status-selector.hbs +96 -85
  15. package/addon/components/model-form/header.hbs +5 -4
  16. package/addon/components/model-form.hbs +4 -3
  17. package/addon/components/model-form.js +2 -1
  18. package/addon/components/project-landing-page.hbs +16 -12
  19. package/addon/components/project-landing-page.js +6 -0
  20. package/addon/components/quarterly-closure/card-status.hbs +2 -2
  21. package/addon/components/quarterly-closure/card-status.js +2 -36
  22. package/addon/components/quarterly-closure/close-survey-button.hbs +11 -1
  23. package/addon/components/quarterly-closure/disabled-form-alert.hbs +3 -0
  24. package/addon/components/quarterly-closure/disabled-form-info.hbs +3 -3
  25. package/addon/components/quarterly-closure/error-list/project-errors.hbs +1 -1
  26. package/addon/components/quarterly-closure/error-list/survey-department-errors.hbs +6 -2
  27. package/addon/components/quarterly-closure/status.hbs +13 -5
  28. package/addon/components/quarterly-closure/status.js +30 -1
  29. package/addon/components/quarterly-closure/title.hbs +13 -10
  30. package/addon/components/quarterly-closure.hbs +3 -2
  31. package/addon/components/search/filters.hbs +11 -5
  32. package/addon/components/search/result-table/load-more.hbs +7 -5
  33. package/addon/components/search/result-table/row/field.hbs +1 -1
  34. package/addon/components/search.js +2 -0
  35. package/addon/components/title-card.hbs +1 -2
  36. package/addon/controllers/building/edit/dwelling/edit.js +4 -0
  37. package/addon/controllers/building/edit/form.js +4 -0
  38. package/addon/controllers/import.js +2 -2
  39. package/addon/controllers/project/form.js +4 -0
  40. package/addon/controllers/project.js +10 -5
  41. package/addon/controllers/search-building.js +5 -0
  42. package/addon/controllers/search-project.js +38 -3
  43. package/addon/helpers/current-quarter.js +24 -3
  44. package/addon/resources/import.js +9 -0
  45. package/addon/services/auth-fetch.js +18 -13
  46. package/addon/services/gwr.js +16 -3
  47. package/addon/services/quarterly-closure.js +5 -2
  48. package/addon/templates/building/edit/dwelling/edit.hbs +4 -4
  49. package/addon/templates/building/edit/entrance/edit/index.hbs +10 -10
  50. package/addon/templates/building/edit/form.hbs +4 -4
  51. package/addon/templates/global-landing-page.hbs +1 -1
  52. package/addon/templates/project/form.hbs +4 -4
  53. package/addon/templates/quarterly-closure.hbs +4 -0
  54. package/addon/templates/search-building.hbs +1 -0
  55. package/addon/templates/search-project.hbs +6 -0
  56. package/addon/validations/search-building.js +10 -0
  57. package/addon/validations/search-project.js +10 -0
  58. package/app/styles/ember-ebau-gwr.scss +6 -3
  59. package/config/environment.js +0 -11
  60. package/config/icons.js +1 -0
  61. package/index.js +10 -0
  62. package/package.json +13 -13
  63. package/translations/de.yaml +6 -3
  64. package/translations/quarterly-closure/de.yaml +10 -4
  65. package/translations/validation-errors/de.yaml +35 -35
package/CHANGELOG.md CHANGED
@@ -1,3 +1,43 @@
1
+ ## [6.0.1](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v6.0.0...v6.0.1) (2022-09-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **search:** separate project and building search validations ([0510045](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/0510045b6d2f09615afcc241f1a61aaa4ddd95eb))
7
+
8
+ # [6.0.0](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v5.0.4...v6.0.0) (2022-09-16)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **date:** update validated form and allow date to be cleared ([006653a](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/006653a1246343a934a306b4402dd957867200cd))
14
+ * **forms:** disable object links during quarterly closure ([b9d054f](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/b9d054f8bf756bcc742639ff84f8d4fa20166572))
15
+ * **global:** display both status change and correction in global view ([256b7d8](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/256b7d814ae68a6fd2465450b723deeeab9fa762))
16
+ * **global:** minor layout fixes ([295d6cb](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/295d6cb9ddac13095ab6fb636fde11bd5ddf7e62))
17
+ * **global:** minor ui fixes ([b9b1abd](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/b9b1abdd9f1f7cc0b0c48cd92bbce4372b379865))
18
+ * **import:** fix access to import resource after it was destroyed ([08830ef](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/08830ef43a13dc8de24e045dbe2f35e4276e5746))
19
+ * **login:** prevent requests if no token is returned from gwr api ([ad2b9b8](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/ad2b9b8bf59715250827b267467368fb3a334375))
20
+ * **projects:** ensure linked projects are recomputed correctly ([e018a29](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/e018a29d9f6450af5bb19ca9287be7543cda751f))
21
+ * **quarterly-closure:** display quarter according to bfs ([7fdfde4](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/7fdfde485a6b04cf1680d43c53ed8f85b99c12a1))
22
+ * **search:** minor table styling fixes ([d451149](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/d4511497b0645be9f148e56cfb5b2e5178726441))
23
+ * **search:** validate building and search id in search ([8b731ea](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/8b731ea8d878219599263735cdea98034f466233))
24
+
25
+
26
+ ### Documentation
27
+
28
+ * **readme:** update supported node version ([94af4da](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/94af4daf66d3c2db1d16ee6267862909d957fe01))
29
+
30
+
31
+ ### Features
32
+
33
+ * **search:** include instance links for linked projects ([2f8d348](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/2f8d348410dc95dc3e2ae4e5a1f525e2241be7ae))
34
+ * **search:** sort results by descending modification date ([8b0d46e](https://github.com/adfinis-sygroup/ember-ebau-gwr/commit/8b0d46eac8a28adc49dbcfbb53f5ebd8e9b41c7e))
35
+
36
+
37
+ ### BREAKING CHANGES
38
+
39
+ * **readme:** Drop node v12 support.
40
+
1
41
  ## [5.0.4](https://github.com/adfinis-sygroup/ember-ebau-gwr/compare/v5.0.3...v5.0.4) (2022-09-05)
2
42
 
3
43
 
package/README.md CHANGED
@@ -15,7 +15,7 @@ yarn start
15
15
 
16
16
  - Ember.js v3.28 or above
17
17
  - Ember CLI v3.28 or above
18
- - Node.js v12 or above
18
+ - Node.js v14 or above
19
19
 
20
20
  ## Installation
21
21
 
@@ -0,0 +1,16 @@
1
+ {{#if @links.length}}
2
+ <div class="uk-flex uk-flex-inline uk-flex-middle">
3
+ <UkIcon @icon="link" class="uk-text-emphasis" />
4
+ {{#each @links as |link index|}}
5
+ {{#if index}}
6
+ <span class="margin-right-xs">,</span>
7
+ {{/if}}
8
+ <a
9
+ class="uk-button uk-button-link"
10
+ href={{concat link.hostLink link.localLink}}
11
+ >
12
+ {{link.identifier}}
13
+ </a>
14
+ {{/each}}
15
+ </div>
16
+ {{/if}}
@@ -21,7 +21,7 @@
21
21
  {{#each @models as |model|}}
22
22
  <tr>
23
23
  {{yield model}}
24
- {{#if @removeLink}}
24
+ {{#if (and (not this.quarterlyClosure.formsDisabled) @removeLink)}}
25
25
  <td class="uk-table-shrink">
26
26
  <button
27
27
  type="button"
@@ -49,49 +49,53 @@
49
49
  <tfoot>
50
50
  <tr>
51
51
  <td colspan="99" class="uk-text-center">
52
- {{#if @searchRoute}}
53
- <LinkTo
54
- @route={{@searchRoute}}
55
- @models={{or @searchModels (array)}}
56
- @query={{or @searchQuery (hash)}}
57
- >
58
- {{#if (eq @modelName "building")}}
59
- {{t "ember-gwr.components.linkedModels.linkExistingBuilding"}}
60
- {{else}}
52
+ {{#if this.quarterlyClosure.formsDisabled}}
53
+ <QuarterlyClosure::DisabledFormInfo />
54
+ {{else}}
55
+ {{#if @searchRoute}}
56
+ <LinkTo
57
+ @route={{@searchRoute}}
58
+ @models={{or @searchModels (array)}}
59
+ @query={{or @searchQuery (hash)}}
60
+ >
61
+ {{#if (eq @modelName "building")}}
62
+ {{t "ember-gwr.components.linkedModels.linkExistingBuilding"}}
63
+ {{else}}
64
+ {{t
65
+ "ember-gwr.components.linkedModels.linkEntry"
66
+ modelName=modelName
67
+ }}
68
+ {{/if}}
69
+ </LinkTo>
70
+ {{/if}}
71
+ {{#if (and @searchRoute @newRoute)}}
72
+ {{t "ember-gwr.components.linkedModels.or"}}
73
+ {{/if}}
74
+ {{#if @newRoute}}
75
+ <LinkTo
76
+ @route={{@newRoute}}
77
+ @models={{or @newModels (array)}}
78
+ @query={{or @newQuery (hash)}}
79
+ >
61
80
  {{t
62
- "ember-gwr.components.linkedModels.linkEntry"
81
+ "ember-gwr.components.linkedModels.createEntry"
63
82
  modelName=modelName
83
+ model=@modelName
64
84
  }}
65
- {{/if}}
66
- </LinkTo>
67
- {{/if}}
68
- {{#if (and @searchRoute @newRoute)}}
69
- {{t "ember-gwr.components.linkedModels.or"}}
70
- {{/if}}
71
- {{#if @newRoute}}
72
- <LinkTo
73
- @route={{@newRoute}}
74
- @models={{or @newModels (array)}}
75
- @query={{or @newQuery (hash)}}
76
- >
77
- {{t
78
- "ember-gwr.components.linkedModels.createEntry"
79
- modelName=modelName
80
- model=@modelName
81
- }}
82
- </LinkTo>
83
- {{else if @addLink}}
84
- <button
85
- type="button"
86
- class="uk-button uk-button-link"
87
- {{on "click" @addLink}}
88
- >
89
- {{t
90
- "ember-gwr.components.linkedModels.createEntry"
91
- modelName=modelName
92
- model=@modelName
93
- }}
94
- </button>
85
+ </LinkTo>
86
+ {{else if @addLink}}
87
+ <button
88
+ type="button"
89
+ class="uk-button uk-button-link"
90
+ {{on "click" @addLink}}
91
+ >
92
+ {{t
93
+ "ember-gwr.components.linkedModels.createEntry"
94
+ modelName=modelName
95
+ model=@modelName
96
+ }}
97
+ </button>
98
+ {{/if}}
95
99
  {{/if}}
96
100
  </td>
97
101
  </tr>
@@ -3,4 +3,5 @@ import Component from "@glimmer/component";
3
3
 
4
4
  export default class LinkedModelsComponent extends Component {
5
5
  @service config;
6
+ @service quarterlyClosure;
6
7
  }
@@ -20,7 +20,12 @@
20
20
  {{project.constructionProjectDescription}}
21
21
  </td>
22
22
  <td class="uk-table-shrink">
23
- {{#if (eq @activeProjectId project.EPROID)}}
23
+ {{#if
24
+ (and
25
+ (eq @activeProjectId project.EPROID)
26
+ (not this.quarterlyClosure.formsDisabled)
27
+ )
28
+ }}
24
29
  <button
25
30
  type="button"
26
31
  class="uk-icon-button"
@@ -33,4 +38,4 @@
33
38
  </button>
34
39
  {{/if}}
35
40
  </td>
36
- </LinkedModels>
41
+ </LinkedModels>
@@ -7,6 +7,7 @@ export default class LinkedProjectsComponent extends Component {
7
7
  @service router;
8
8
  @service store;
9
9
  @service constructionProject;
10
+ @service quarterlyClosure;
10
11
 
11
12
  @action
12
13
  async removeProjectLink() {
@@ -14,6 +15,6 @@ export default class LinkedProjectsComponent extends Component {
14
15
  .peekAll("gwr-link")
15
16
  .find(({ eproid }) => Number(eproid) === this.args.activeProjectId);
16
17
  await link.destroyRecord();
17
- await this.constructionProject.all.perform(this.args.instanceId);
18
+ this.router.transitionTo("project.index");
18
19
  }
19
20
  }
@@ -79,6 +79,7 @@
79
79
  (find-by "id" this.authFetch.municipality this.municipalities)
80
80
  "name"
81
81
  )
82
+ htmlSafe=true
82
83
  }}
83
84
  </span>
84
85
  <Logout />
@@ -24,9 +24,11 @@
24
24
  </li>
25
25
  {{else}}
26
26
  <li>
27
- <div class="uk-text-success">
28
- <FaIcon @icon="circle-check" @fixedWidth={{true}} />
29
- {{t "ember-gwr.components.modelErrors.empty"}}
27
+ <div class="uk-text-success uk-flex uk-flex-middle">
28
+ <FaIcon @icon="circle-check" @fixedWidth={{true}} class="margin-right-xs" @size="sm" />
29
+ <div>
30
+ {{t "ember-gwr.components.modelErrors.empty"}}
31
+ </div>
30
32
  </div>
31
33
  </li>
32
34
  {{/each}}
@@ -15,25 +15,36 @@
15
15
  ...attributes
16
16
  />
17
17
  {{else}}
18
- <input
19
- type="text"
20
- class="uk-input uk-width-1
21
- {{if @isInvalid 'uk-form-danger'}}
22
- {{if @isValid 'uk-form-success'}}"
23
- name={{@name}}
24
- required={{@required}}
25
- placeholder={{t "ember-gwr.components.modelForm.datePlaceholder"}}
26
- ...attributes
27
- {{pikaday
28
- value=@value
29
- yearRange=this.yearRange
30
- onSelect=@update
31
- toString=this.formatDate
32
- firstDay=1
33
- i18n=this.pikadayTranslations
34
- }}
35
- />
18
+
19
+ <div class="uk-inline uk-width-1-1">
20
+ {{#if @value}}
21
+ <button
22
+ type="button"
23
+ class="uk-form-icon uk-form-icon-flip"
24
+ uk-icon="icon: close; ratio: 0.7"
25
+ {{on "click" this.clearDate}}
26
+ />
27
+ {{/if}}
28
+ <input
29
+ type="text"
30
+ class="uk-input uk-width-1
31
+ {{if @isInvalid 'uk-form-danger'}}
32
+ {{if @isValid 'uk-form-success'}}"
33
+ name={{@name}}
34
+ required={{@required}}
35
+ placeholder={{t "ember-gwr.components.modelForm.datePlaceholder"}}
36
+ ...attributes
37
+ {{pikaday
38
+ value=@value
39
+ yearRange=this.yearRange
40
+ onSelect=@update
41
+ toString=this.formatDate
42
+ firstDay=1
43
+ i18n=this.pikadayTranslations
44
+ }}
45
+ />
46
+ </div>
36
47
  {{/if}}
37
48
  </div>
38
49
  {{component @hintComponent}}
39
- {{component @errorComponent}}
50
+ {{component @errorComponent}}
@@ -33,4 +33,10 @@ export default class ModelFormDateComponent extends Component {
33
33
  year: "numeric",
34
34
  });
35
35
  }
36
+
37
+ @action
38
+ clearDate(event) {
39
+ event.preventDefault();
40
+ this.args.update(null);
41
+ }
36
42
  }
@@ -70,11 +70,7 @@ export default class ModelFormFieldComponent extends Component {
70
70
  }
71
71
 
72
72
  get fieldComponent() {
73
- return this.isStep
74
- ? "model-form/step"
75
- : this.isDate
76
- ? "model-form/date"
77
- : "validated-input/render";
73
+ return this.isStep ? "model-form/step" : "validated-input/render";
78
74
  }
79
75
 
80
76
  get options() {
@@ -59,7 +59,7 @@
59
59
  {{#let @submit as |Submit|}}
60
60
  <Submit />
61
61
  {{/let}}
62
- {{#if (or @modelHasImport @showStatusActions)}}
62
+ {{#if (or @modelHasImport @statusConfiguration)}}
63
63
  <button
64
64
  class="uk-button uk-button-default uk-flex-none uk-padding-small uk-padding-remove-vertical"
65
65
  type="button"
@@ -95,7 +95,7 @@
95
95
  </LinkTo>
96
96
  </li>
97
97
  {{/if}}
98
- {{#if @showStatusActions}}
98
+ {{#if @statusConfiguration}}
99
99
  <li>
100
100
  <a
101
101
  href="#ember-ebau-gwr-status"
@@ -58,96 +58,107 @@
58
58
  >
59
59
  {{t "ember-gwr.components.header.statusSelector.actionInfo"}}
60
60
  </div>
61
- <ModelForm::Header::StatusSelector::SubmitParameters
62
- @submitLabel={{t
63
- "ember-gwr.components.header.statusSelector.submitCorrectionLabel"
64
- }}
65
- @loading={{and this.submit.isRunning (not this.isChange)}}
66
- @isPrimary={{false}}
67
- @dropTitle={{t
68
- "ember-gwr.components.header.statusSelector.correctionDropTitle"
69
- }}
70
- @confirmLabel={{t
71
- "ember-gwr.components.header.statusSelector.confirmCorrection"
72
- }}
73
- @parameters={{this.correctionParameters}}
74
- @onSubmit={{this.submit}}
75
- @changeset={{this.changesetCorrection}}
76
- @errors={{this.correctionErrors}}
77
- @showDrop={{this.correctionParameters.length}}
78
- @isChange={{false}}
79
- @translationBase={{@translationBase}}
80
- />
81
- <ModelForm::Header::StatusSelector::SubmitParameters
82
- @submitLabel={{t
83
- "ember-gwr.components.header.statusSelector.submitChangeLabel"
84
- }}
85
- @loading={{and this.submit.isRunning this.isChange}}
86
- @disabled={{not this.isValidStatusChange}}
87
- @isPrimary={{true}}
88
- @dropTitle={{t
89
- "ember-gwr.components.header.statusSelector.changeDropTitle"
90
- }}
91
- @confirmLabel={{t
92
- "ember-gwr.components.header.statusSelector.confirmChange"
93
- }}
94
- @parameters={{this.changeParameters}}
95
- @onSubmit={{this.submit}}
96
- @changeset={{this.changesetChange}}
97
- @errors={{this.changeErrors}}
98
- @showDrop={{and (not this.errors) this.changeParameters.length}}
99
- @isChange={{true}}
100
- @translationBase={{@translationBase}}
101
- />
61
+ {{#if @statusConfiguration.correction}}
62
+ <ModelForm::Header::StatusSelector::SubmitParameters
63
+ @submitLabel={{t
64
+ "ember-gwr.components.header.statusSelector.submitCorrectionLabel"
65
+ }}
66
+ @loading={{and this.submit.isRunning (not this.isChange)}}
67
+ @isPrimary={{false}}
68
+ @dropTitle={{t
69
+ "ember-gwr.components.header.statusSelector.correctionDropTitle"
70
+ }}
71
+ @confirmLabel={{t
72
+ "ember-gwr.components.header.statusSelector.confirmCorrection"
73
+ }}
74
+ @parameters={{this.correctionParameters}}
75
+ @onSubmit={{this.submit}}
76
+ @changeset={{this.changesetCorrection}}
77
+ @errors={{this.correctionErrors}}
78
+ @showDrop={{this.correctionParameters.length}}
79
+ @isChange={{false}}
80
+ @translationBase={{@translationBase}}
81
+ />
82
+ {{/if}}
83
+ {{#if @statusConfiguration.change}}
84
+ <ModelForm::Header::StatusSelector::SubmitParameters
85
+ @submitLabel={{t
86
+ "ember-gwr.components.header.statusSelector.submitChangeLabel"
87
+ }}
88
+ @loading={{and this.submit.isRunning this.isChange}}
89
+ @disabled={{not this.isValidStatusChange}}
90
+ @isPrimary={{true}}
91
+ @dropTitle={{t
92
+ "ember-gwr.components.header.statusSelector.changeDropTitle"
93
+ }}
94
+ @confirmLabel={{t
95
+ "ember-gwr.components.header.statusSelector.confirmChange"
96
+ }}
97
+ @parameters={{this.changeParameters}}
98
+ @onSubmit={{this.submit}}
99
+ @changeset={{this.changesetChange}}
100
+ @errors={{this.changeErrors}}
101
+ @showDrop={{and (not this.errors) this.changeParameters.length}}
102
+ @isChange={{true}}
103
+ @translationBase={{@translationBase}}
104
+ />
105
+ {{/if}}
102
106
  </div>
103
107
  </div>
104
- <div
105
- class="uk-flex uk-flex-nowrap uk-flex-between uk-child-width-1-2 uk-flex-top uk-margin-remove-bottom uk-margin-top"
106
- >
107
- {{#if this.modelStatus}}
108
- <div
109
- class="uk-flex-inline uk-text-small uk-margin-remove-bottom uk-margin-large-right"
110
- uk-alert
111
- >
112
- <div class="uk-margin-right uk-flex-none" uk-icon="icon: info"></div>
113
- <div class="uk-flex-inline uk-flex-column">
114
- <div class="uk-flex-inline uk-flex-top">
115
- <div class="uk-margin-right uk-flex-none">
116
- {{t "ember-gwr.components.header.statusSelector.statusInfo"}}
108
+ {{#if @statusConfiguration.change}}
109
+ <div
110
+ class="uk-flex uk-flex-nowrap uk-flex-between uk-child-width-1-2 uk-flex-top uk-margin-remove-bottom uk-margin-top"
111
+ >
112
+ {{#if this.modelStatus}}
113
+ <div
114
+ class="uk-flex-inline uk-text-small uk-margin-remove-bottom uk-margin-large-right"
115
+ uk-alert
116
+ >
117
+ <div class="uk-margin-right uk-flex-none" uk-icon="icon: info"></div>
118
+ <div class="uk-flex-inline uk-flex-column">
119
+ <div class="uk-flex-inline uk-flex-top">
120
+ <div class="uk-margin-right uk-flex-none">
121
+ {{t "ember-gwr.components.header.statusSelector.statusInfo"}}
122
+ </div>
117
123
  </div>
118
- </div>
119
- <div
120
- class="uk-flex-inline uk-flex-wrap uk-width-expand uk-margin-small-top"
121
- >
122
- {{#each @nextValidStates as |state index|}}
123
- <div class="uk-flex-inline uk-flex-middle">
124
- <div>
124
+ <div
125
+ class="uk-flex-inline uk-flex-wrap uk-width-expand uk-margin-small-top"
126
+ >
127
+ {{#each @nextValidStates as |state index|}}
128
+ <div class="uk-flex-inline uk-flex-middle">
129
+ <div>
130
+ {{t
131
+ (concat
132
+ "ember-gwr.lifeCycles."
133
+ @modelName
134
+ ".statusOptions."
135
+ state
136
+ )
137
+ }}
138
+ </div>
139
+ {{#if (not (eq index (dec @nextValidStates.length)))}}
140
+ <div class="uk-margin-small-left uk-margin-small-right">
141
+ |
142
+ </div>
143
+ {{/if}}
144
+ </div>
145
+ {{/each}}
146
+ {{#unless @nextValidStates.length}}
147
+ <div class="uk-flex-inline uk-flex-middle">
125
148
  {{t
126
- (concat
127
- "ember-gwr.lifeCycles." @modelName ".statusOptions." state
128
- )
149
+ "ember-gwr.components.header.statusSelector.noNextStates"
129
150
  }}
130
151
  </div>
131
- {{#if (not (eq index (dec @nextValidStates.length)))}}
132
- <div class="uk-margin-small-left uk-margin-small-right">
133
- |
134
- </div>
135
- {{/if}}
136
- </div>
137
- {{/each}}
138
- {{#unless @nextValidStates.length}}
139
- <div class="uk-flex-inline uk-flex-middle">
140
- {{t "ember-gwr.components.header.statusSelector.noNextStates"}}
141
- </div>
142
- {{/unless}}
152
+ {{/unless}}
153
+ </div>
143
154
  </div>
144
155
  </div>
145
- </div>
146
- {{/if}}
147
- {{#if (or this.errors.length this.errors.linkToRoute)}}
148
- <div class="uk-flex-inline">
149
- <ModelForm::SubmitErrors @errors={{this.errors}} />
150
- </div>
151
- {{/if}}
152
- </div>
153
- </div>
156
+ {{/if}}
157
+ {{#if (or this.errors.length this.errors.linkToRoute)}}
158
+ <div class="uk-flex-inline">
159
+ <ModelForm::SubmitErrors @errors={{this.errors}} />
160
+ </div>
161
+ {{/if}}
162
+ </div>
163
+ {{/if}}
164
+ </div>
@@ -9,7 +9,7 @@
9
9
  <ModelForm::Header::Actions
10
10
  @submit={{@submit}}
11
11
  @submitErrors={{@submitErrors}}
12
- @showStatusActions={{and @showStatusActions @model (not @model.isNew)}}
12
+ @statusConfiguration={{and @statusConfiguration @model (not @model.isNew)}}
13
13
  @modelHasImport={{@modelHasImport}}
14
14
  @import={{@import}}
15
15
  @importAllData={{@importAllData}}
@@ -24,10 +24,10 @@
24
24
  {{#let (t (concat "ember-gwr.models." @modelName) count=1) as |modelName|}}
25
25
  <div
26
26
  class="uk-flex uk-margin-top
27
- {{if @showStatusActions 'uk-flex-between' 'uk-flex-right'}}
27
+ {{if @statusConfiguration 'uk-flex-between' 'uk-flex-right'}}
28
28
  uk-flex-bottom uk-flex-wrap uk-flex-wrap-around"
29
29
  >
30
- {{#if @showStatusActions}}
30
+ {{#if @statusConfiguration}}
31
31
  <ModelForm::Header::Status
32
32
  @model={{@model}}
33
33
  @modelName={{@modelName}}
@@ -54,8 +54,9 @@
54
54
  @getChangeHint={{@getChangeHint}}
55
55
  @modelStatusField={{@modelStatusField}}
56
56
  @translationBase={{or @translationBaseHeader @translationBase}}
57
+ @statusConfiguration={{@statusConfiguration}}
57
58
  />
58
59
  {{/if}}
59
60
  {{/let}}
60
61
  <hr class="uk-margin-small-top" />
61
- {{/if}}
62
+ {{/if}}
@@ -30,6 +30,7 @@
30
30
  <ValidatedForm
31
31
  @model={{if @validations (changeset @model @validations) @model}}
32
32
  @on-submit={{perform this.submit}}
33
+ @on-invalid-submit={{fn (mut this.invalidSubmit) true}}
33
34
  @validateBeforeSubmit={{true}}
34
35
  class="validated-form"
35
36
  ...attributes
@@ -47,7 +48,7 @@
47
48
  (component
48
49
  "model-form/submit-errors"
49
50
  errors=(if
50
- (and f.model.isInvalid f.model.isDirty)
51
+ (and f.model.isInvalid f.model.isDirty this.invalidSubmit)
51
52
  (array (t "ember-gwr.components.modelForm.validationError"))
52
53
  @errors
53
54
  )
@@ -61,7 +62,7 @@
61
62
  @projectId={{@projectId}}
62
63
  @modelName={{@modelName}}
63
64
  @modelDescription={{@headerModelDescription}}
64
- @showStatusActions={{@showStatusActions}}
65
+ @statusConfiguration={{@statusConfiguration}}
65
66
  @import={{this.importData}}
66
67
  @modelHasImport={{this.modelHasImport}}
67
68
  @importAllData={{this.importAllData}}
@@ -103,7 +104,7 @@
103
104
  {{t "ember-gwr.components.modelForm.cancelImport"}}
104
105
  </LinkTo>
105
106
  {{/if}}
106
- {{#if (or (and f.model.isInvalid f.model.isDirty) @errors)}}
107
+ {{#if (or (and f.model.isInvalid f.model.isDirty this.invalidSubmit) @errors)}}
107
108
  <div class="uk-margin-left uk-flex-inline">
108
109
  <SubmitErrors />
109
110
  </div>
@@ -16,8 +16,9 @@ export default class ModelFormComponent extends Component {
16
16
  // so we can transition out of the import once the array is empty.
17
17
  // All diff state tracking is done in field.js
18
18
  @tracked diffs = [];
19
+ @tracked invalidSubmit = false;
19
20
 
20
- @tracked import = ImportResource.from(this, () => ({
21
+ import = ImportResource.from(this, () => ({
21
22
  instanceId: this.args.instanceId,
22
23
  showImport: this.args.showImport,
23
24
  importModelName: this.args.importModelName ?? this.args.modelName,
@@ -9,18 +9,22 @@
9
9
  {{t "ember-gwr.projectLandingPage.infoText"}}
10
10
  </p>
11
11
 
12
- <div class="uk-flex uk-flex-between">
13
- <div class="uk-margin-large-right">
14
- <LinkTo @route="project.new" class="uk-button uk-button-primary">
15
- {{t "ember-gwr.projectLandingPage.createNewProject"}}
16
- </LinkTo>
12
+ {{#if this.quarterlyClosure.formsDisabled}}
13
+ <QuarterlyClosure::DisabledFormAlert />
14
+ {{else}}
15
+ <div class="uk-flex uk-flex-between">
16
+ <div class="uk-margin-large-right">
17
+ <LinkTo @route="project.new" class="uk-button uk-button-primary">
18
+ {{t "ember-gwr.projectLandingPage.createNewProject"}}
19
+ </LinkTo>
20
+ </div>
21
+ <div>
22
+ <LinkTo @route="search-project" class="uk-button uk-button-primary">
23
+ {{t "ember-gwr.projectLandingPage.linkExistingProject"}}
24
+ </LinkTo>
25
+ </div>
17
26
  </div>
18
- <div>
19
- <LinkTo @route="search-project" class="uk-button uk-button-primary">
20
- {{t "ember-gwr.projectLandingPage.linkExistingProject"}}
21
- </LinkTo>
22
- </div>
23
- </div>
27
+ {{/if}}
24
28
  </div>
25
29
  </div>
26
- </div>
30
+ </div>