ember-ebau-gwr 4.0.7 → 5.0.2
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.
- package/CHANGELOG.md +312 -299
- package/README.md +25 -8
- package/addon/components/building-preview.hbs +53 -0
- package/addon/components/housing-stat-link.hbs +8 -0
- package/addon/components/import-modal/building-data.hbs +1 -55
- package/addon/components/import-modal/dwelling-data.hbs +3 -3
- package/addon/components/import-modal/entrance-data.hbs +1 -1
- package/addon/components/import-modal.hbs +1 -4
- package/addon/components/link-building-modal.hbs +38 -24
- package/addon/components/link-building-modal.js +13 -5
- package/addon/components/link-street.hbs +33 -31
- package/addon/components/linked-models.hbs +13 -6
- package/addon/components/linked-projects.hbs +8 -6
- package/addon/components/linked-projects.js +13 -0
- package/addon/components/loading.hbs +3 -0
- package/addon/components/login-modal.hbs +86 -68
- package/addon/components/model-errors/error-indicator.hbs +1 -2
- package/addon/components/model-errors/header.hbs +6 -2
- package/addon/components/model-errors/list.hbs +13 -4
- package/addon/components/model-errors/skeleton-errors.hbs +14 -0
- package/addon/components/model-errors/skeleton.hbs +1 -16
- package/addon/components/model-errors.hbs +14 -16
- package/addon/components/model-form/date.hbs +10 -6
- package/addon/components/model-form/diff.hbs +8 -8
- package/addon/components/model-form/field.hbs +3 -2
- package/addon/components/model-form/field.js +7 -5
- package/addon/components/model-form/header/actions.hbs +25 -22
- package/addon/components/model-form/header/actions.js +6 -3
- package/addon/components/model-form/header/errors.hbs +16 -16
- package/addon/components/model-form/header/status-selector/submit-parameters.hbs +2 -1
- package/addon/components/model-form/header/status-selector.hbs +15 -3
- package/addon/components/model-form/header/status.hbs +2 -1
- package/addon/components/model-form/header.hbs +6 -5
- package/addon/components/model-form/step.hbs +5 -5
- package/addon/components/model-form/submit.hbs +1 -0
- package/addon/components/model-form.hbs +110 -77
- package/addon/components/model-form.js +38 -2
- package/addon/components/model-inview.hbs +2 -7
- package/addon/components/project-landing-page.hbs +26 -0
- package/addon/components/project-nav.hbs +65 -0
- package/addon/components/project-nav.js +27 -0
- package/addon/components/quarterly-closure/card-status.hbs +11 -0
- package/addon/components/quarterly-closure/card-status.js +36 -0
- package/addon/components/quarterly-closure/close-survey-button.hbs +10 -0
- package/addon/components/quarterly-closure/close-survey-button.js +46 -0
- package/addon/components/quarterly-closure/disabled-form-info.hbs +4 -0
- package/addon/components/quarterly-closure/error-list/project-errors.hbs +22 -0
- package/addon/components/quarterly-closure/error-list/project-errors.js +41 -0
- package/addon/components/quarterly-closure/error-list/survey-department-errors.hbs +22 -0
- package/addon/components/quarterly-closure/error-list/survey-department-errors.js +28 -0
- package/addon/components/quarterly-closure/error-list.hbs +4 -0
- package/addon/components/quarterly-closure/status.hbs +8 -0
- package/addon/components/quarterly-closure/status.js +6 -0
- package/addon/components/quarterly-closure/title.hbs +15 -0
- package/addon/components/quarterly-closure/title.js +11 -0
- package/addon/components/quarterly-closure.hbs +9 -0
- package/addon/components/quarterly-closure.js +6 -0
- package/addon/components/search/filters.hbs +128 -106
- package/addon/components/search/filters.js +13 -59
- package/addon/components/search/result-table/head/header.hbs +1 -1
- package/addon/components/search/result-table/head.hbs +1 -1
- package/addon/components/search/result-table/load-more.hbs +5 -0
- package/addon/components/search/result-table/row/field.hbs +1 -1
- package/addon/components/search/result-table/row.hbs +12 -13
- package/addon/components/search/result-table.hbs +3 -2
- package/addon/components/search.hbs +29 -0
- package/addon/components/search.js +96 -0
- package/addon/components/soon-available.hbs +7 -0
- package/addon/components/sub-nav.hbs +5 -8
- package/addon/components/title-card.hbs +28 -0
- package/addon/components/validated-form-error.hbs +4 -0
- package/addon/components/validated-form-error.js +14 -0
- package/addon/controllers/building/edit/dwelling/edit.js +2 -3
- package/addon/controllers/building/edit/entrance/edit/index.js +2 -3
- package/addon/controllers/building/edit/entrance/edit/link-street.js +4 -1
- package/addon/controllers/building/edit/form.js +57 -39
- package/addon/controllers/import.js +8 -64
- package/addon/controllers/project/form.js +3 -4
- package/addon/controllers/project.js +22 -44
- package/addon/controllers/search-building.js +39 -14
- package/addon/controllers/search-project.js +24 -19
- package/addon/helpers/current-quarter.js +8 -0
- package/addon/helpers/current-route-is-not.js +7 -0
- package/addon/helpers/current-route-is.js +15 -0
- package/addon/helpers/is-set.js +9 -0
- package/addon/helpers/is-unset.js +4 -4
- package/addon/helpers/show-model-field.js +4 -4
- package/addon/models/check-construction-project-response.js +20 -0
- package/addon/models/check-survey-department-response.js +20 -0
- package/addon/models/quarterly-closure-status.js +52 -0
- package/addon/modifiers/in-viewport.js +14 -0
- package/addon/modifiers/inverse-background.js +21 -0
- package/addon/resources/import.js +69 -0
- package/addon/routes/building/edit.js +1 -1
- package/addon/routes/building/new.js +1 -1
- package/addon/routes/building.js +7 -2
- package/addon/routes/global-landing-page.js +9 -0
- package/addon/routes/project/errors.js +1 -1
- package/addon/routes/project/form.js +1 -1
- package/addon/routes/project/new.js +1 -1
- package/addon/routes/project.js +1 -1
- package/addon/routes/quarterly-closure.js +3 -0
- package/addon/routes/search-building.js +7 -2
- package/addon/routes.js +7 -3
- package/addon/services/auth-fetch.js +6 -7
- package/addon/services/construction-project.js +10 -0
- package/addon/services/gwr.js +19 -7
- package/addon/services/quarterly-closure.js +147 -0
- package/addon/templates/building/edit/dwelling/edit.hbs +22 -19
- package/addon/templates/building/edit/dwelling/new.hbs +1 -1
- package/addon/templates/building/edit/dwelling.hbs +1 -1
- package/addon/templates/building/edit/dwellings.hbs +3 -4
- package/addon/templates/building/edit/entrance/edit/index.hbs +32 -18
- package/addon/templates/building/edit/entrance/edit/link-street.hbs +79 -75
- package/addon/templates/building/edit/entrance/edit.hbs +1 -1
- package/addon/templates/building/edit/entrance/new.hbs +1 -1
- package/addon/templates/building/edit/entrance.hbs +6 -5
- package/addon/templates/building/edit/entrances.hbs +4 -6
- package/addon/templates/building/edit/form.hbs +127 -112
- package/addon/templates/building/edit/index.hbs +1 -1
- package/addon/templates/building/edit.hbs +33 -23
- package/addon/templates/building.hbs +1 -1
- package/addon/templates/global-landing-page.hbs +34 -0
- package/addon/templates/project/errors.hbs +116 -109
- package/addon/templates/project/form.hbs +96 -63
- package/addon/templates/project/index.hbs +0 -1
- package/addon/templates/project/linked-buildings.hbs +7 -10
- package/addon/templates/project.hbs +12 -73
- package/addon/templates/quarterly-closure.hbs +1 -0
- package/addon/templates/search-building.hbs +202 -134
- package/addon/templates/search-project.hbs +98 -85
- package/addon/validations/building-work.js +106 -97
- package/addon/validations/extended-search-fields.js +27 -0
- package/addon/validations/realestate-identification.js +1 -0
- package/addon/xml/helpers.js +3 -0
- package/addon/xml/templates/building.js +1 -1
- package/addon/xml/templates/construction-project.js +1 -1
- package/app/styles/ember-ebau-gwr.scss +19 -0
- package/config/environment.js +4 -0
- package/config/icons.js +15 -0
- package/package.json +19 -15
- package/translations/de.yaml +29 -26
- package/translations/fr.yaml +11 -19
- package/translations/quarterly-closure/de.yaml +59 -0
- package/translations/validation-errors/de.yaml +37 -0
- package/addon/components/landing-page.hbs +0 -24
- package/addon/components/project-form/checkbox.hbs +0 -11
- package/addon/components/project-form/checkbox.js +0 -9
- package/addon/components/project-form/date.hbs +0 -10
- package/addon/components/project-form/diff.hbs +0 -43
- package/addon/components/project-form/diff.js +0 -18
- package/addon/components/project-form/field.hbs +0 -32
- package/addon/components/project-form/field.js +0 -59
- package/addon/components/project-form/input.hbs +0 -7
- package/addon/components/project-form/label.hbs +0 -17
- package/addon/components/project-form/select.hbs +0 -17
- package/addon/components/project-form/textarea.hbs +0 -7
- package/addon/components/project-form.hbs +0 -19
- package/addon/components/project-form.js +0 -14
- package/addon/components/sub-nav.js +0 -18
- package/addon/services/import-state.js +0 -10
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{{#let
|
|
2
2
|
(t (concat "ember-gwr.models." @modelName) count=1)
|
|
3
|
-
(get @model (concat @modelName "Status"))
|
|
3
|
+
(get @model (concat @modelName "Status"))
|
|
4
|
+
as |modelName modelStatus|
|
|
4
5
|
}}
|
|
5
6
|
<div
|
|
6
7
|
class="uk-margin-right uk-margin-small-bottom uk-width-medium uk-width-1-2@m"
|
|
@@ -5,17 +5,18 @@
|
|
|
5
5
|
@modelName={{@modelName}}
|
|
6
6
|
@modelDescription={{@modelDescription}}
|
|
7
7
|
/>
|
|
8
|
-
{{
|
|
8
|
+
{{! template-lint-disable no-passed-in-event-handlers }}
|
|
9
9
|
<ModelForm::Header::Actions
|
|
10
10
|
@submit={{@submit}}
|
|
11
11
|
@submitErrors={{@submitErrors}}
|
|
12
|
-
@
|
|
12
|
+
@showStatusActions={{and @showStatusActions @model (not @model.isNew)}}
|
|
13
13
|
@modelHasImport={{@modelHasImport}}
|
|
14
14
|
@import={{@import}}
|
|
15
15
|
@importAllData={{@importAllData}}
|
|
16
16
|
@openStatus={{fn (mut this.changeStatus) true}}
|
|
17
17
|
@modelName={{@modelName}}
|
|
18
18
|
@translationBase={{@translationBase}}
|
|
19
|
+
@disabled={{@disabled}}
|
|
19
20
|
/>
|
|
20
21
|
</div>
|
|
21
22
|
{{#if (and @model (not @model.isNew))}}
|
|
@@ -23,10 +24,10 @@
|
|
|
23
24
|
{{#let (t (concat "ember-gwr.models." @modelName) count=1) as |modelName|}}
|
|
24
25
|
<div
|
|
25
26
|
class="uk-flex uk-margin-top
|
|
26
|
-
{{if @
|
|
27
|
+
{{if @showStatusActions 'uk-flex-between' 'uk-flex-right'}}
|
|
27
28
|
uk-flex-bottom uk-flex-wrap uk-flex-wrap-around"
|
|
28
29
|
>
|
|
29
|
-
{{#if @
|
|
30
|
+
{{#if @showStatusActions}}
|
|
30
31
|
<ModelForm::Header::Status
|
|
31
32
|
@model={{@model}}
|
|
32
33
|
@modelName={{@modelName}}
|
|
@@ -57,4 +58,4 @@
|
|
|
57
58
|
{{/if}}
|
|
58
59
|
{{/let}}
|
|
59
60
|
<hr class="uk-margin-small-top" />
|
|
60
|
-
{{/if}}
|
|
61
|
+
{{/if}}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<div class="{{if @horizontal
|
|
2
|
-
<div class="{{if @horizontal
|
|
1
|
+
<div class="{{if @horizontal 'uk-flex'}}">
|
|
2
|
+
<div class="{{if @horizontal 'uk-margin-left uk-flex-last'}}">
|
|
3
3
|
{{component @labelComponent}}
|
|
4
4
|
</div>
|
|
5
5
|
<input
|
|
6
6
|
type="number"
|
|
7
7
|
class="uk-width-1 uk-input
|
|
8
|
-
{{if @isInvalid
|
|
9
|
-
{{if @isValid
|
|
8
|
+
{{if @isInvalid 'uk-form-danger'}}
|
|
9
|
+
{{if @isValid 'uk-form-success'}}"
|
|
10
10
|
name={{@name}}
|
|
11
11
|
required={{@required}}
|
|
12
12
|
value={{@value}}
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
/>
|
|
20
20
|
</div>
|
|
21
21
|
{{component @hintComponent}}
|
|
22
|
-
{{component @errorComponent}}
|
|
22
|
+
{{component @errorComponent}}
|
|
@@ -1,81 +1,114 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
{{#if this.import.isLoading}}
|
|
2
|
+
<Loading />
|
|
3
|
+
{{else}}
|
|
4
|
+
|
|
5
|
+
{{#if this.import.error}}
|
|
6
|
+
<div
|
|
7
|
+
class={{if this.noImportData "uk-alert-warning" "uk-alert-error"}}
|
|
8
|
+
uk-alert
|
|
9
|
+
>
|
|
10
|
+
|
|
11
|
+
{{! The aria-label attr results in a template-lint error for some reason: error Cannot read properties of undefined (reading 'replace') undefined}}
|
|
12
|
+
{{! template-lint-disable}}
|
|
13
|
+
<a
|
|
14
|
+
aria-label={{t "ember-gwr.close"}}
|
|
15
|
+
class="uk-alert-close"
|
|
16
|
+
href=""
|
|
17
|
+
uk-close
|
|
18
|
+
></a>
|
|
19
|
+
{{! template-lint-enable}}
|
|
20
|
+
<p>
|
|
21
|
+
{{#if this.noImportData}}
|
|
22
|
+
{{t "ember-gwr.components.modelForm.noImportData"}}
|
|
23
|
+
{{else}}
|
|
24
|
+
{{t "ember-gwr.components.modelForm.importError"}}
|
|
25
|
+
{{/if}}
|
|
26
|
+
</p>
|
|
27
|
+
</div>
|
|
28
|
+
{{/if}}
|
|
29
|
+
|
|
30
|
+
<ValidatedForm
|
|
31
|
+
@model={{if @validations (changeset @model @validations) @model}}
|
|
32
|
+
@on-submit={{perform this.submit}}
|
|
33
|
+
@validateBeforeSubmit={{true}}
|
|
34
|
+
class="validated-form"
|
|
35
|
+
...attributes
|
|
36
|
+
as |f|
|
|
37
|
+
>
|
|
38
|
+
{{#let
|
|
39
|
+
(component
|
|
40
|
+
f.submit
|
|
41
|
+
type="submit"
|
|
42
|
+
label=(t "ember-gwr.components.modelForm.save")
|
|
43
|
+
disabled=(or this.isSaving @disabled this.showImport)
|
|
44
|
+
loading=this.isSaving
|
|
45
|
+
buttonComponent=(component "model-form/submit" color="primary")
|
|
24
46
|
)
|
|
25
|
-
)
|
|
26
|
-
as |Submit SubmitErrors|
|
|
27
|
-
}}
|
|
28
|
-
{{!-- template-lint-disable no-passed-in-event-handlers --}}
|
|
29
|
-
<ModelForm::Header
|
|
30
|
-
@model={{@headerModel}}
|
|
31
|
-
@modelId={{@headerModelId}}
|
|
32
|
-
@projectId={{@projectId}}
|
|
33
|
-
@modelName={{@headerModelName}}
|
|
34
|
-
@modelDescription={{@headerModelDescription}}
|
|
35
|
-
@hasStatus={{@hasStatus}}
|
|
36
|
-
@import={{@import}}
|
|
37
|
-
@modelHasImport={{this.modelHasImport}}
|
|
38
|
-
@importAllData={{this.importAllData}}
|
|
39
|
-
@modelStatusOptions={{@modelStatusOptions}}
|
|
40
|
-
@nextValidStates={{@nextValidStates}}
|
|
41
|
-
@onStatusChange={{@onStatusChange}}
|
|
42
|
-
@onStatusCorrection={{@onStatusCorrection}}
|
|
43
|
-
@getChangeParameters={{@getChangeParameters}}
|
|
44
|
-
@getCorrectionParameters={{@getCorrectionParameters}}
|
|
45
|
-
@getChangeHint={{@getChangeHint}}
|
|
46
|
-
@modelStatusField={{@modelStatusField}}
|
|
47
|
-
@translationBaseHeader={{@translationBaseHeader}}
|
|
48
|
-
@translationBase={{@translationBase}}
|
|
49
|
-
@submit={{Submit}}
|
|
50
|
-
@submitErrors={{SubmitErrors}}
|
|
51
|
-
/>
|
|
52
|
-
{{yield
|
|
53
47
|
(component
|
|
54
|
-
"model-form/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
resolveDiff=this.resolveDiff
|
|
48
|
+
"model-form/submit-errors"
|
|
49
|
+
errors=(if
|
|
50
|
+
(and f.model.isInvalid f.model.isDirty)
|
|
51
|
+
(array (t "ember-gwr.components.modelForm.validationError"))
|
|
52
|
+
@errors
|
|
53
|
+
)
|
|
61
54
|
)
|
|
62
|
-
|
|
55
|
+
as |Submit SubmitErrors|
|
|
63
56
|
}}
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
57
|
+
{{! template-lint-disable no-passed-in-event-handlers }}
|
|
58
|
+
<ModelForm::Header
|
|
59
|
+
@model={{@headerModel}}
|
|
60
|
+
@modelId={{@headerModelId}}
|
|
61
|
+
@projectId={{@projectId}}
|
|
62
|
+
@modelName={{@modelName}}
|
|
63
|
+
@modelDescription={{@headerModelDescription}}
|
|
64
|
+
@showStatusActions={{@showStatusActions}}
|
|
65
|
+
@import={{this.importData}}
|
|
66
|
+
@modelHasImport={{this.modelHasImport}}
|
|
67
|
+
@importAllData={{this.importAllData}}
|
|
68
|
+
@modelStatusOptions={{@modelStatusOptions}}
|
|
69
|
+
@nextValidStates={{@nextValidStates}}
|
|
70
|
+
@onStatusChange={{@onStatusChange}}
|
|
71
|
+
@onStatusCorrection={{@onStatusCorrection}}
|
|
72
|
+
@getChangeParameters={{@getChangeParameters}}
|
|
73
|
+
@getCorrectionParameters={{@getCorrectionParameters}}
|
|
74
|
+
@getChangeHint={{@getChangeHint}}
|
|
75
|
+
@modelStatusField={{@modelStatusField}}
|
|
76
|
+
@translationBaseHeader={{@translationBaseHeader}}
|
|
77
|
+
@translationBase={{@translationBase}}
|
|
78
|
+
@submit={{Submit}}
|
|
79
|
+
@submitErrors={{SubmitErrors}}
|
|
80
|
+
@disabled={{@disabled}}
|
|
81
|
+
/>
|
|
82
|
+
{{yield
|
|
83
|
+
(component
|
|
84
|
+
"model-form/field"
|
|
85
|
+
model=f.model
|
|
86
|
+
importedData=this.importData
|
|
87
|
+
translationBase=@translationBase
|
|
88
|
+
input=f.input
|
|
89
|
+
registerDiff=this.registerDiff
|
|
90
|
+
resolveDiff=this.resolveDiff
|
|
91
|
+
disabled=@disabled
|
|
92
|
+
)
|
|
93
|
+
f.model
|
|
94
|
+
this.importData
|
|
95
|
+
}}
|
|
96
|
+
<div class="uk-flex-inline uk-flex-nowrap uk-flex-top uk-margin-top">
|
|
97
|
+
<Submit class="uk-flex-none" />
|
|
98
|
+
{{#if @showImport}}
|
|
99
|
+
<LinkTo
|
|
100
|
+
@query={{hash import=false}}
|
|
101
|
+
class="uk-button uk-button-default uk-flex-none uk-margin-small-left"
|
|
102
|
+
>
|
|
103
|
+
{{t "ember-gwr.components.modelForm.cancelImport"}}
|
|
104
|
+
</LinkTo>
|
|
105
|
+
{{/if}}
|
|
106
|
+
{{#if (or (and f.model.isInvalid f.model.isDirty) @errors)}}
|
|
107
|
+
<div class="uk-margin-left uk-flex-inline">
|
|
108
|
+
<SubmitErrors />
|
|
109
|
+
</div>
|
|
110
|
+
{{/if}}
|
|
111
|
+
</div>
|
|
112
|
+
{{/let}}
|
|
113
|
+
</ValidatedForm>
|
|
114
|
+
{{/if}}
|
|
@@ -3,6 +3,7 @@ import { inject as service } from "@ember/service";
|
|
|
3
3
|
import Component from "@glimmer/component";
|
|
4
4
|
import { tracked } from "@glimmer/tracking";
|
|
5
5
|
import { dropTask } from "ember-concurrency";
|
|
6
|
+
import ImportResource, { NO_DATA_ERROR } from "ember-ebau-gwr/resources/import";
|
|
6
7
|
import { isIsoDate } from "ember-ebau-gwr/utils";
|
|
7
8
|
|
|
8
9
|
export default class ModelFormComponent extends Component {
|
|
@@ -16,12 +17,47 @@ export default class ModelFormComponent extends Component {
|
|
|
16
17
|
// All diff state tracking is done in field.js
|
|
17
18
|
@tracked diffs = [];
|
|
18
19
|
|
|
20
|
+
@tracked import = ImportResource.from(this, () => ({
|
|
21
|
+
instanceId: this.args.instanceId,
|
|
22
|
+
showImport: this.args.showImport,
|
|
23
|
+
importModelName: this.args.importModelName ?? this.args.modelName,
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
get importData() {
|
|
27
|
+
const index = Number(this.args.importIndex);
|
|
28
|
+
const data =
|
|
29
|
+
Array.isArray(this.import.value) && !isNaN(index)
|
|
30
|
+
? this.import.value[index]
|
|
31
|
+
: this.import.value;
|
|
32
|
+
|
|
33
|
+
return data
|
|
34
|
+
? {
|
|
35
|
+
index,
|
|
36
|
+
data,
|
|
37
|
+
originalData: this.import.value,
|
|
38
|
+
}
|
|
39
|
+
: null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// These getters are a bit funky so they only access the `import`
|
|
43
|
+
// prop (and trigger the resource) if they need to.
|
|
44
|
+
get showImport() {
|
|
45
|
+
return Boolean(this.args.instanceId && this.args.showImport);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get noImportData() {
|
|
49
|
+
return this.import.error === NO_DATA_ERROR;
|
|
50
|
+
}
|
|
51
|
+
|
|
19
52
|
get isSaving() {
|
|
20
53
|
return this.submit.isRunning || this.args.onSubmit.isRunning;
|
|
21
54
|
}
|
|
22
55
|
|
|
23
56
|
get modelHasImport() {
|
|
24
|
-
return
|
|
57
|
+
return (
|
|
58
|
+
this.args.instanceId &&
|
|
59
|
+
this.config.importModels.includes(this.args.modelName)
|
|
60
|
+
);
|
|
25
61
|
}
|
|
26
62
|
|
|
27
63
|
finishImport() {
|
|
@@ -80,7 +116,7 @@ export default class ModelFormComponent extends Component {
|
|
|
80
116
|
}
|
|
81
117
|
});
|
|
82
118
|
};
|
|
83
|
-
deepMerge(this.args.model, this.
|
|
119
|
+
deepMerge(this.args.model, this.import.value.data);
|
|
84
120
|
this.finishImport();
|
|
85
121
|
}
|
|
86
122
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<div class="uk-flex uk-flex-center uk-flex-middle uk-margin-large-top">
|
|
3
|
+
<div class="uk-flex uk-flex-column uk-width-2-3">
|
|
4
|
+
<h2>
|
|
5
|
+
{{t "ember-gwr.projectLandingPage.heading"}}
|
|
6
|
+
</h2>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
{{t "ember-gwr.projectLandingPage.infoText"}}
|
|
10
|
+
</p>
|
|
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>
|
|
17
|
+
</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>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{{#if @instanceId}}
|
|
2
|
+
<div class="ember-ebau-gwr-projects-header">
|
|
3
|
+
<div class="uk-padding-small">
|
|
4
|
+
<LinkedProjects
|
|
5
|
+
@instanceId={{@instanceId}}
|
|
6
|
+
@activeProjectId={{@activeProjectId}}
|
|
7
|
+
@projects={{@projects}}
|
|
8
|
+
class="uk-padding-small"
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
<hr class="uk-margin-remove" />
|
|
12
|
+
<div uk-alert class="uk-margin-remove">
|
|
13
|
+
<div class="uk-flex uk-flex-between uk-flex-middle">
|
|
14
|
+
<div class="uk-flex uk-flex-middle uk-width-expand uk-margin-right">
|
|
15
|
+
<div class="uk-flex-none uk-margin-right">
|
|
16
|
+
<span uk-icon="icon: info"></span>
|
|
17
|
+
</div>
|
|
18
|
+
<div>
|
|
19
|
+
<div>
|
|
20
|
+
{{t "ember-gwr.nav.housingStatInfo"}}
|
|
21
|
+
</div>
|
|
22
|
+
<div>
|
|
23
|
+
{{t "ember-gwr.nav.deletionInfo"}}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="uk-width-auto">
|
|
28
|
+
<HousingStatLink />
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
{{else}}
|
|
34
|
+
<BackRoute
|
|
35
|
+
@backRoute="search-project"
|
|
36
|
+
@backText={{t "ember-gwr.globalLandingPage.backToSearch"}}
|
|
37
|
+
/>
|
|
38
|
+
{{/if}}
|
|
39
|
+
{{#if @activeProjectId}}
|
|
40
|
+
<UkTab as |Tab|>
|
|
41
|
+
<Tab.item @href={{build-url "project.form" (array @activeProjectId)}}>
|
|
42
|
+
{{t "ember-gwr.models.project" count=1}}
|
|
43
|
+
</Tab.item>
|
|
44
|
+
<Tab.item
|
|
45
|
+
@href={{build-url "project.linked-buildings" (array @activeProjectId)}}
|
|
46
|
+
@disabled={{this.buildingTabInfoText}}
|
|
47
|
+
>
|
|
48
|
+
{{t "ember-gwr.models.building" count=1}}
|
|
49
|
+
</Tab.item>
|
|
50
|
+
{{#if this.buildingTabInfoText}}
|
|
51
|
+
<div class="uk-padding-remove">
|
|
52
|
+
<span
|
|
53
|
+
uk-icon="icon: question; ratio: 0.8"
|
|
54
|
+
uk-tooltip="title: {{this.buildingTabInfoText}}; container: {{this.config.modalContainer}}"
|
|
55
|
+
></span>
|
|
56
|
+
</div>
|
|
57
|
+
{{/if}}
|
|
58
|
+
<Tab.item
|
|
59
|
+
class="uk-position-right"
|
|
60
|
+
@href={{build-url "project.errors" (array @activeProjectId)}}
|
|
61
|
+
>
|
|
62
|
+
{{t "ember-gwr.issues.nav"}}
|
|
63
|
+
</Tab.item>
|
|
64
|
+
</UkTab>
|
|
65
|
+
{{/if}}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { inject as service } from "@ember/service";
|
|
2
|
+
import Component from "@glimmer/component";
|
|
3
|
+
|
|
4
|
+
export default class ProjectNavComponent extends Component {
|
|
5
|
+
@service config;
|
|
6
|
+
@service intl;
|
|
7
|
+
|
|
8
|
+
get buildingTabInfoText() {
|
|
9
|
+
if (!this.args.activeProjectId) {
|
|
10
|
+
return this.intl.t(
|
|
11
|
+
"ember-gwr.linkedBuildings.buildingDisabledForNewProject"
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const project = this.args.instanceId
|
|
16
|
+
? this.args.projects.find(
|
|
17
|
+
(project) => project.EPROID === this.args.activeProjectId
|
|
18
|
+
)
|
|
19
|
+
: this.args.projects[0];
|
|
20
|
+
|
|
21
|
+
return project?.typeOfConstructionProject !== 6011
|
|
22
|
+
? this.intl.t(
|
|
23
|
+
"ember-gwr.linkedBuildings.buildingDisabledForInfrastructure"
|
|
24
|
+
)
|
|
25
|
+
: null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { inject as service } from "@ember/service";
|
|
2
|
+
import Component from "@glimmer/component";
|
|
3
|
+
import {
|
|
4
|
+
REQUEST_PENDING,
|
|
5
|
+
WAITING,
|
|
6
|
+
PROCESSING,
|
|
7
|
+
ERROR,
|
|
8
|
+
CLOSED,
|
|
9
|
+
} from "ember-ebau-gwr/models/quarterly-closure-status";
|
|
10
|
+
|
|
11
|
+
export default class QuarterlyClosureCardStatus extends Component {
|
|
12
|
+
@service quarterlyClosure;
|
|
13
|
+
|
|
14
|
+
get statusClass() {
|
|
15
|
+
switch (this.quarterlyClosure.status.type) {
|
|
16
|
+
case REQUEST_PENDING: {
|
|
17
|
+
return { text: "uk-text-meta", icon: "clock" };
|
|
18
|
+
}
|
|
19
|
+
case WAITING: {
|
|
20
|
+
return { text: "uk-text-warning", icon: "circle-info" };
|
|
21
|
+
}
|
|
22
|
+
case PROCESSING: {
|
|
23
|
+
return { text: "uk-text-muted", icon: "clock" };
|
|
24
|
+
}
|
|
25
|
+
case ERROR: {
|
|
26
|
+
return { text: "uk-text-danger", icon: "triangle-exclamation" };
|
|
27
|
+
}
|
|
28
|
+
case CLOSED: {
|
|
29
|
+
return { text: "uk-text-success", icon: "circle-check" };
|
|
30
|
+
}
|
|
31
|
+
default: {
|
|
32
|
+
return { text: "uk-text-default" };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { inject as service } from "@ember/service";
|
|
2
|
+
import Component from "@glimmer/component";
|
|
3
|
+
import { task } from "ember-concurrency";
|
|
4
|
+
import {
|
|
5
|
+
WAITING,
|
|
6
|
+
PROCESSING,
|
|
7
|
+
ERROR,
|
|
8
|
+
CLOSED,
|
|
9
|
+
} from "ember-ebau-gwr/models/quarterly-closure-status";
|
|
10
|
+
|
|
11
|
+
const NOTIFICATION_TYPES = {
|
|
12
|
+
[WAITING]: "warning",
|
|
13
|
+
[PROCESSING]: "primary",
|
|
14
|
+
[ERROR]: "danger",
|
|
15
|
+
[CLOSED]: "success",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default class QuarterlyClosureStatus extends Component {
|
|
19
|
+
@service quarterlyClosure;
|
|
20
|
+
@service notification;
|
|
21
|
+
@service intl;
|
|
22
|
+
|
|
23
|
+
get disabledButton() {
|
|
24
|
+
return ![620, 630, 650, 651, 663, 665].includes(
|
|
25
|
+
this.quarterlyClosure.status.id
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@task
|
|
30
|
+
*closeQuarterlySurvey() {
|
|
31
|
+
try {
|
|
32
|
+
yield this.quarterlyClosure.close();
|
|
33
|
+
|
|
34
|
+
const notificationType =
|
|
35
|
+
NOTIFICATION_TYPES[this.quarterlyClosure.status.type];
|
|
36
|
+
this.notification[notificationType](
|
|
37
|
+
this.quarterlyClosure.status.shortLabel
|
|
38
|
+
);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error(error);
|
|
41
|
+
this.notification.danger(
|
|
42
|
+
this.intl.t("ember-gwr.quarterlyClosure.closure.error")
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<h3>{{t "ember-gwr.quarterlyClosure.components.projectErrors.title"}}</h3>
|
|
2
|
+
<p>{{t "ember-gwr.quarterlyClosure.components.projectErrors.infoText"}}</p>
|
|
3
|
+
|
|
4
|
+
<div id="scroll-container uk-overflow-auto">
|
|
5
|
+
{{#each this.errors.value as |project|}}
|
|
6
|
+
<ModelInview
|
|
7
|
+
@model={{project}}
|
|
8
|
+
@fetchModel={{perform this.performQualityCheck project}}
|
|
9
|
+
as |result|
|
|
10
|
+
>
|
|
11
|
+
<ModelErrors
|
|
12
|
+
@model={{project}}
|
|
13
|
+
@modelId={{project.EPROID}}
|
|
14
|
+
@errorModel={{result.model}}
|
|
15
|
+
@linkRoute="project.form"
|
|
16
|
+
@linkModels={{array project.EPROID}}
|
|
17
|
+
@modelDescription={{project.constructionProjectDescription}}
|
|
18
|
+
/>
|
|
19
|
+
</ModelInview>
|
|
20
|
+
<hr />
|
|
21
|
+
{{/each}}
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { inject as service } from "@ember/service";
|
|
2
|
+
import Component from "@glimmer/component";
|
|
3
|
+
import { tracked } from "@glimmer/tracking";
|
|
4
|
+
import { task } from "ember-concurrency";
|
|
5
|
+
import { trackedFunction } from "ember-resources/util/function";
|
|
6
|
+
|
|
7
|
+
export default class SurveyDepartmentErrors extends Component {
|
|
8
|
+
@service quarterlyClosure;
|
|
9
|
+
@service constructionProject;
|
|
10
|
+
@service notification;
|
|
11
|
+
@service intl;
|
|
12
|
+
|
|
13
|
+
@tracked errors = trackedFunction(this, async () => {
|
|
14
|
+
try {
|
|
15
|
+
return await this.constructionProject.search({
|
|
16
|
+
constructionSurveyDeptNumber:
|
|
17
|
+
this.quarterlyClosure.constructionSurveyDeptNumber,
|
|
18
|
+
hasError: true,
|
|
19
|
+
});
|
|
20
|
+
} catch (error) {
|
|
21
|
+
console.error(error);
|
|
22
|
+
this.notification.danger(
|
|
23
|
+
this.intl.t("ember-gwr.quarterlyClosure.components.projectErrors.error")
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
@task
|
|
29
|
+
*performQualityCheck(project) {
|
|
30
|
+
try {
|
|
31
|
+
return yield this.quarterlyClosure.checkConstructionProject(
|
|
32
|
+
project.EPROID
|
|
33
|
+
);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.error(error);
|
|
36
|
+
this.notification.danger(
|
|
37
|
+
this.intl.t("ember-gwr.quarterlyClosure.components.projectErrors.error")
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<h3>{{t "ember-gwr.quarterlyClosure.components.departmentErrors.title"}}</h3>
|
|
2
|
+
|
|
3
|
+
{{#if this.isFirstQuarter}}
|
|
4
|
+
<UkFlex
|
|
5
|
+
@horizontal="between"
|
|
6
|
+
@vertical="middle"
|
|
7
|
+
uk-alert
|
|
8
|
+
class="uk-margin-remove uk-alert-default"
|
|
9
|
+
>
|
|
10
|
+
{{t
|
|
11
|
+
"ember-gwr.quarterlyClosure.components.departmentErrors.maintenanceCost"
|
|
12
|
+
}}
|
|
13
|
+
<HousingStatLink />
|
|
14
|
+
</UkFlex>
|
|
15
|
+
{{/if}}
|
|
16
|
+
|
|
17
|
+
<p>{{t "ember-gwr.quarterlyClosure.components.departmentErrors.infoText"}}</p>
|
|
18
|
+
|
|
19
|
+
<ModelErrors::List
|
|
20
|
+
@errors={{this.errors.value.errorList}}
|
|
21
|
+
@isRunning={{this.errors.isLoading}}
|
|
22
|
+
/>
|