From c2c0ad46ea9a97e230e2e768bcabebfe36b5122a Mon Sep 17 00:00:00 2001 From: Eric Schubert Date: Thu, 31 Mar 2022 11:12:30 +0200 Subject: [PATCH] [chore] add helper section for files tab - added to wp single view at split and show routes --- .editorconfig | 3 - config/locales/js-en.yml | 1 + .../wp-single-view.component.ts | 14 +- .../wp-single-view/wp-single-view.html | 42 ++++-- .../wp-full-view/wp-full-view.component.ts | 2 +- .../routing/wp-full-view/wp-full-view.html | 126 +++++++++--------- .../routing/wp-split-view/wp-split-view.html | 88 ++++++------ .../content/_attributes_group.sass | 9 +- 8 files changed, 161 insertions(+), 124 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9452e9f944e..707092fe373 100644 --- a/.editorconfig +++ b/.editorconfig @@ -291,9 +291,6 @@ ij_javascript_while_on_new_line = false ij_javascript_wrap_comments = false [{*.sht,*.html,*.shtm,*.shtml,*.htm,*.ng}] -indent_size = 2 -tab_width = 2 -ij_continuation_indent_size = 2 ij_html_add_new_line_before_tags = body,div,p,form,h1,h2,h3 ij_html_align_attributes = true ij_html_align_text = false diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml index cac0a762ba9..96926945770 100644 --- a/config/locales/js-en.yml +++ b/config/locales/js-en.yml @@ -1073,6 +1073,7 @@ en: relations: Relations watchers: Watchers files: Files + files_tab_migration_help: 'You can now attach files to work packages via the new tab:' time_relative: days: "days" weeks: "weeks" diff --git a/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.component.ts b/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.component.ts index a51dd73114c..143790e4f9b 100644 --- a/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.component.ts +++ b/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.component.ts @@ -35,6 +35,7 @@ import { Input, OnInit, } from '@angular/core'; +import { StateService } from '@uirouter/core'; import { I18nService } from 'core-app/core/i18n/i18n.service'; import { PathHelperService } from 'core-app/core/path-helper/path-helper.service'; import { distinctUntilChanged, map } from 'rxjs/operators'; @@ -114,6 +115,10 @@ export class WorkPackageSingleViewComponent extends UntilDestroyedMixin implemen attachments: { label: this.I18n.t('js.label_attachments'), }, + files: { + label: this.I18n.t('js.work_packages.tabs.files'), + migration_help: this.I18n.t('js.work_packages.tabs.files_tab_migration_help'), + }, project: { required: this.I18n.t('js.project.required_outside_context'), context: this.I18n.t('js.project.context'), @@ -131,6 +136,8 @@ export class WorkPackageSingleViewComponent extends UntilDestroyedMixin implemen public isNewResource:boolean; + public uiSelfRef:string; + protected firstTimeFocused = false; $element:JQuery; @@ -138,6 +145,7 @@ export class WorkPackageSingleViewComponent extends UntilDestroyedMixin implemen constructor(readonly I18n:I18nService, protected currentProject:CurrentProjectService, protected PathHelper:PathHelperService, + protected $state:StateService, protected states:States, protected halEditing:HalResourceEditingService, protected halResourceService:HalResourceService, @@ -151,11 +159,13 @@ export class WorkPackageSingleViewComponent extends UntilDestroyedMixin implemen super(); } - public ngOnInit() { + public ngOnInit():void { this.$element = jQuery(this.elementRef.nativeElement as HTMLElement); this.isNewResource = isNewResource(this.workPackage); + this.uiSelfRef = this.$state.$current.name; + const change = this.halEditing.changeFor(this.workPackage); this.resourceContextChange.next(this.contextFrom(change.projectedResource)); this.refresh(change); @@ -368,7 +378,7 @@ export class WorkPackageSingleViewComponent extends UntilDestroyedMixin implemen private contextFrom(workPackage:WorkPackageResource):ResourceContextChange { const schema = this.schema(workPackage); - let schemaHref:string|null = null; + let schemaHref:string|null; const projectHref:string|null = workPackage.project && workPackage.project.href; if (schema.baseSchema) { diff --git a/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.html b/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.html index 923a38ae32c..befdc80b71a 100644 --- a/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.html +++ b/frontend/src/app/features/work-packages/components/wp-single-view/wp-single-view.html @@ -5,8 +5,8 @@
+ [wrapperClasses]="'-no-label'" + [fieldName]="'subject'">
@@ -25,11 +25,13 @@ because otherwise the browser would add a second space after it -->   . + [user]="workPackage.author"> + .   - . -
+ + . + @@ -53,7 +55,7 @@
+ [fieldName]="descriptor.name">
@@ -84,9 +86,9 @@
+ [resource]="workPackage" + [isDropTarget]="true" + [wrapperClasses]="'-no-label'">
@@ -102,7 +104,7 @@ + query: group.query }"> @@ -140,3 +142,23 @@ + +
+
+
+
+

+
+
+ +
+ + + +
+
+
diff --git a/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.component.ts b/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.component.ts index 85eda076805..e041f91f826 100644 --- a/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.component.ts +++ b/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.component.ts @@ -29,7 +29,7 @@ import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource'; import { StateService } from '@uirouter/core'; import { Component, Injector, OnInit } from '@angular/core'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { WorkPackageViewSelectionService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-selection.service'; import { WorkPackageSingleViewBase } from 'core-app/features/work-packages/routing/wp-view-base/work-package-single-view.base'; import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service'; diff --git a/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html b/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html index 838a987c949..747e0a31a49 100644 --- a/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html +++ b/frontend/src/app/features/work-packages/routing/wp-full-view/wp-full-view.html @@ -3,78 +3,78 @@ *ngIf="workPackage" class="work-packages--show-view"> - + -
-
-
+
+
+
- - + + -
- -
+
+
-
    -
  • - - -
  • -
  • - - -
  • -
  • - - -
  • -
  • - -
  • -
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + +
  • +
+
+
+ +
+
+
+
- -
-
-
- +
+
+ + +
+ +
+
-
-
- - -
- -
-
-
-
-
- -
+
+
+
diff --git a/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.html b/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.html index 81585e0f7b5..4c3ae75f31b 100644 --- a/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.html +++ b/frontend/src/app/features/work-packages/routing/wp-split-view/wp-split-view.html @@ -3,8 +3,8 @@ data-indicator-name="wpDetails" *ngIf="workPackage" > - -
+ +
- -
-
- - -
- - - -
-
- - +
+
+ + class="work-packages--breadcrumb" + > + +
+ + + +
-
- -
+ +
-
- -
+
+
+
-
- -
+
+ +
+ +
+ +
diff --git a/frontend/src/global_styles/content/_attributes_group.sass b/frontend/src/global_styles/content/_attributes_group.sass index 85455f7a377..991a3259c16 100644 --- a/frontend/src/global_styles/content/_attributes_group.sass +++ b/frontend/src/global_styles/content/_attributes_group.sass @@ -33,7 +33,7 @@ .attributes-group--header @include grid-block - margin: 0 0 0.5rem 0 + margin: 0 0 0.5rem 0 border-bottom: 1px solid #ddd align-items: flex-end @@ -61,6 +61,13 @@ .button margin: 0 0 8px 0 +.attributes-group--icon-indented-text + display: grid + margin-top: 1rem + grid-template-columns: auto auto 1fr + column-gap: 8px + + // HACK. TODO: Remove H3 element rules in various places. .attributes-group--header-text, #content h3.attributes-group--header-text