Add subject field

Add subject field
pull/4471/head
Alex Dik 9 years ago
parent 58d5ee0072
commit c7096bb220
  1. 8
      frontend/app/components/work-packages/wp-subject/wp-subject.directive.ts
  2. 3
      frontend/app/components/wp-create/wp-create.directive.html
  3. 2
      frontend/app/components/wp-edit/wp-edit-mode-state.service.ts

@ -37,10 +37,12 @@ export class WorkPackageSubjectController {
constructor(protected $scope,
protected $stateParams,
protected wpCacheService) {
scopedObservable($scope, wpCacheService.loadWorkPackage($stateParams.workPackageId))
if (!this.workPackage) {
scopedObservable($scope, wpCacheService.loadWorkPackage($stateParams.workPackageId))
.subscribe((wp: WorkPackageResource) => {
this.workPackage = wp;
});
}
}
}
@ -48,7 +50,9 @@ function wpSubjectDirective() {
return {
restrict: 'E',
templateUrl: '/components/work-packages/wp-subject/wp-subject.directive.html',
scope: {},
scope: {
workPackage: '=?'
},
bindToController: true,
controller: WorkPackageSubjectController,
controllerAs: '$ctrl'

@ -1,7 +1,10 @@
<div
ng-if="$ctrl.newWorkPackage"
has-edit-mode="true"
wp-edit-form="$ctrl.newWorkPackage"
>
<wp-subject work-package="$ctrl.newWorkPackage"></wp-subject>
<wp-single-view work-package="$ctrl.newWorkPackage"></wp-single-view>
<edit-actions-bar
on-save="$ctrl.saveWorkPackage()"

@ -65,7 +65,7 @@ export class WorkPackageEditModeStateService {
public save() {
if (this.active) {
this.form.updateWorkPackage().then(() => {
return this.form.updateWorkPackage().then(() => {
// Doesn't use cancel() since that resets all values
this.form.closeAllFields();
this._active = false;

Loading…
Cancel
Save