Skip to content

[pull] dev from opf:dev #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 34 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2dc9b53
[#59914] Add times for labour costs to the cost report and export
as-op Dec 12, 2024
4895aaa
xls: display full datetime if end_time is on another day
as-op Dec 16, 2024
980ebd9
Merge branch 'dev' into feature/59914-add-times-for-labour-costs-to-t…
as-op Jan 2, 2025
87b4fa6
Merge branch 'dev' into feature/59914-add-times-for-labour-costs-to-t…
as-op Jan 6, 2025
aeef5ce
Merge branch 'dev' into feature/59914-add-times-for-labour-costs-to-t…
as-op Jan 7, 2025
d20d4b8
Merge branch 'dev' into feature/59914-add-times-for-labour-costs-to-t…
as-op Jan 16, 2025
73cc4e5
Merge branch 'dev' into feature/59914-add-times-for-labour-costs-to-t…
as-op Jan 16, 2025
21cb77d
[#60019] Left side menu doesn't highlight Meeting series name
mrmir Jan 20, 2025
d186b84
fix date span check in xls export
as-op Jan 20, 2025
165aa7c
add specs for time entry times in xls & basic-table
as-op Jan 20, 2025
345e264
Merge remote-tracking branch 'origin/feature/59914-add-times-for-labo…
as-op Jan 20, 2025
d6f27ca
Highlight meeting series names from occurrences
mrmir Jan 20, 2025
a832a7a
Bump nokogiri from 1.18.1 to 1.18.2
dependabot[bot] Jan 21, 2025
1bf535e
[#60718] Activity field populates automatically
klaustopher Jan 21, 2025
d9fcd50
Remove assigning the default activity
klaustopher Jan 21, 2025
c090738
Allow WP time entries component to be used in primer
oliverguenther Jan 16, 2025
927ad2f
Merge branch 'dev' into bug/60019-left-side-menu-doesnt-highlight-mee…
mrmir Jan 20, 2025
727fe10
fix invalid truncating float value
as-op Jan 21, 2025
40ad68a
use a float value for time entry hours in the specs
as-op Jan 21, 2025
cd22a1d
Merge branch 'dev' into feature/59914-add-times-for-labour-costs-to-t…
as-op Jan 21, 2025
53aab51
Don't fire on same value
oliverguenther Jan 21, 2025
a4584c6
add opencode screenshots
MayaBerd Jan 21, 2025
82c254f
Publiccode yml (#17639)
lindenthal Jan 21, 2025
3dfcc4b
Merge pull request #17450 from opf/feature/59914-add-times-for-labour…
as-op Jan 21, 2025
836aec0
Add screenshots to publiccode
oliverguenther Jan 21, 2025
06404da
Merge remote-tracking branch 'origin/release/15.2' into dev
oliverguenther Jan 21, 2025
b7a7744
Merge pull request #17630 from opf/chore/custom-element-recent-time-e…
oliverguenther Jan 21, 2025
573b9d5
[#60713] Ends after 'a specific date' dates are not inclusive (#17674)
mrmir Jan 21, 2025
e9459cf
remove test that assumes default activity
klaustopher Jan 21, 2025
7e101c5
Try different approach without N+1
mrmir Jan 21, 2025
c475c2d
Merge pull request #17675 from opf/bug/60718-activity-field-populates…
klaustopher Jan 21, 2025
cec74d3
Merge pull request #17672 from opf/dependabot/bundler/dev/nokogiri-1.…
ulferts Jan 21, 2025
aaad232
[#59963] Sort order on index page is off when recurring meeting sched…
mrmir Jan 21, 2025
be2de32
Merge pull request #17668 from opf/bug/60019-left-side-menu-doesnt-hi…
oliverguenther Jan 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.4)
nokogiri (1.18.1)
nokogiri (1.18.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
oj (3.16.9)
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ import { appBaseSelector, ApplicationBaseComponent } from 'core-app/core/routing
import { SpotSwitchComponent } from 'core-app/spot/components/switch/switch.component';
import { OPContextMenuService } from 'core-app/shared/components/op-context-menu/op-context-menu.service';
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
import {
TimeEntriesWorkPackageAutocompleterComponent,
} from 'core-app/shared/components/autocompleter/time-entries-work-package-autocompleter/time-entries-work-package-autocompleter.component';

export function initializeServices(injector:Injector) {
return () => {
Expand Down Expand Up @@ -425,6 +428,7 @@ export class OpenProjectModule implements DoBootstrap {
registerCustomElement('opce-project-autocompleter', ProjectAutocompleterComponent, { injector });
registerCustomElement('opce-members-autocompleter', MembersAutocompleterComponent, { injector });
registerCustomElement('opce-user-autocompleter', UserAutocompleterComponent, { injector });
registerCustomElement('opce-time-entries-work-package-autocompleter', TimeEntriesWorkPackageAutocompleterComponent, { injector });
registerCustomElement('opce-macro-attribute-value', AttributeValueMacroComponent, { injector });
registerCustomElement('opce-macro-attribute-label', AttributeLabelMacroComponent, { injector });
registerCustomElement('opce-macro-wp-quickinfo', WorkPackageQuickinfoMacroComponent, { injector });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*ngIf="inputName && !(multiple && multipleAsSeparateInputs)"
type="hidden"
[attr.name]="inputName"
[value]="mappedInputValue"
[attr.data-action]="hiddenFieldAction">
<ng-container *ngIf="multiple && multipleAsSeparateInputs">
<input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class OpAutocompleterComponent<T extends IAutocompleteItem = IAutocomplet

@Input() public selectableGroupAsModel?:boolean = true;

@Input() public searchFn:(term:string, item:any) => boolean;
@Input() public searchFn:(term:string, item:unknown) => boolean;

@Input() public trackByFn = this.defaultTrackByFunction();

Expand Down Expand Up @@ -293,7 +293,7 @@ export class OpAutocompleterComponent<T extends IAutocompleteItem = IAutocomplet

initialDebounce = true;

private opAutocompleterService = new OpAutocompleterService(this.apiV3Service);
readonly opAutocompleterService = new OpAutocompleterService(this.apiV3Service);

constructor(
readonly injector:Injector,
Expand All @@ -319,17 +319,6 @@ export class OpAutocompleterComponent<T extends IAutocompleteItem = IAutocomplet
if (this.items) {
this.items$.next(this.items as IOPAutocompleterOption[]);
}

if (this.inputValue && this.resource && !this.model) {
this
.opAutocompleterService
.loadValue(this.inputValue, this.resource, this.multiple)
.subscribe((resource) => {
this.model = resource as unknown as T;
this.syncHiddenField(this.mappedInputValue);
this.cdRef.detectChanges();
});
}
}

ngOnChanges(changes:SimpleChanges):void {
Expand All @@ -343,6 +332,17 @@ export class OpAutocompleterComponent<T extends IAutocompleteItem = IAutocomplet
this.syncHiddenField(this.mappedInputValue);
}

if (this.inputValue && this.resource && !this.model) {
this
.opAutocompleterService
.loadValue(this.inputValue, this.resource, this.multiple)
.subscribe((resource) => {
this.model = resource as unknown as T;
this.syncHiddenField(this.mappedInputValue);
this.cdRef.detectChanges();
});
}

this.ngZone.runOutsideAngular(() => {
setTimeout(() => {
this.results$ = merge(
Expand Down Expand Up @@ -385,7 +385,7 @@ export class OpAutocompleterComponent<T extends IAutocompleteItem = IAutocomplet
this.open.emit();
}

public getOptionsItems(searchKey:string):Observable<any> {
public getOptionsItems(searchKey:string):Observable<unknown> {
return of((this.items as IOPAutocompleterOption[])?.filter((element) => element.name.includes(searchKey)));
}

Expand Down Expand Up @@ -414,6 +414,7 @@ export class OpAutocompleterComponent<T extends IAutocompleteItem = IAutocomplet
this.onTouched(val);
this.onChange(val);
this.syncHiddenField(this.mappedInputValue);
this.syncedInput?.nativeElement.dispatchEvent(new Event('change'));
this.change.emit(val);

if (this.resetOnChange) {
Expand Down Expand Up @@ -592,13 +593,19 @@ export class OpAutocompleterComponent<T extends IAutocompleteItem = IAutocomplet
);
}

protected syncHiddenField(mappedInputValue:string|string[]) {
protected syncHiddenField(mappedInputValue:string|string[]):void {
const input = this.syncedInput?.nativeElement;
if (input) {
input.value = Array.isArray(mappedInputValue) ? mappedInputValue.join(',') : mappedInputValue;
const event = new Event('change');
input.dispatchEvent(event);
if (!input) {
return;
}

const newValue = Array.isArray(mappedInputValue) ? mappedInputValue.join(',') : mappedInputValue;
// Don't fire a change event if the value is the same
if (input.value === newValue) {
return;
}

input.value = newValue;
}

public addNewObjectFn(searchTerm:string):unknown {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import { ColorsAutocompleterComponent } from 'core-app/shared/components/colors/
import {
WorkPackageAutocompleterComponent,
} from 'core-app/shared/components/autocompleter/work-package-autocompleter/wp-autocompleter.component';
import {
TimeEntryWorkPackageAutocompleterComponent,
} from 'core-app/shared/components/autocompleter/te-work-package-autocompleter/te-work-package-autocompleter.component';
import {
VersionAutocompleterComponent,
} from 'core-app/shared/components/autocompleter/version-autocompleter/version-autocompleter.component';
Expand Down Expand Up @@ -52,12 +49,15 @@ import {
import {
ProjectAutocompleterTemplateComponent,
} from 'core-app/shared/components/autocompleter/project-autocompleter/project-autocompleter-template.component';
import {
TimeEntriesWorkPackageAutocompleterComponent,
} from 'core-app/shared/components/autocompleter/time-entries-work-package-autocompleter/time-entries-work-package-autocompleter.component';

export const OPENPROJECT_AUTOCOMPLETE_COMPONENTS = [
CreateAutocompleterComponent,
VersionAutocompleterComponent,
WorkPackageAutocompleterComponent,
TimeEntryWorkPackageAutocompleterComponent,
TimeEntriesWorkPackageAutocompleterComponent,
DraggableAutocompleteComponent,
UserAutocompleterComponent,
UserAutocompleterTemplateComponent,
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<ng-template #headerTemplate>
<div class="scrollable-tabs">
<div class="op-scrollable-tabs--tab-container">
<ul class="op-tab-row">
<li
class="op-tab-row--tab"
(click)="autocompleter.changeMode('all')"
>
<a
href="#"
class="op-tab-row--link"
[class.op-tab-row--link_selected]="autocompleter.mode === 'all'"
[textContent]="autocompleter.labelAll"
>
</a>
</li>
<li
class="op-tab-row--tab"
(click)="autocompleter.changeMode('recent')"
>
<a
href="#"
class="op-tab-row--link"
[class.op-tab-row--link_selected]="autocompleter.mode === 'recent'"
[textContent]="autocompleter.labelRecent"
>
</a>
</li>
</ul>
</div>
</div>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -26,44 +26,30 @@
// See COPYRIGHT and LICENSE files for more details.
//++

import { ChangeDetectionStrategy, Component, Injector, Input, TemplateRef, ViewChild } from '@angular/core';
import {
AfterViewInit,
Component,
EventEmitter,
Injector,
Output,
ViewEncapsulation,
} from '@angular/core';
import { WorkPackageAutocompleterComponent } from 'core-app/shared/components/autocompleter/work-package-autocompleter/wp-autocompleter.component';

export type TimeEntryWorkPackageAutocompleterMode = 'all'|'recent';
IAutocompleterTemplateComponent,
OpAutocompleterComponent,
} from 'core-app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component';
import {
TimeEntriesWorkPackageAutocompleterComponent,
} from 'core-app/shared/components/autocompleter/time-entries-work-package-autocompleter/time-entries-work-package-autocompleter.component';

@Component({
templateUrl: './te-work-package-autocompleter.component.html',
styleUrls: [
'./te-work-package-autocompleter.component.sass',
],
selector: 'te-work-package-autocompleter',
encapsulation: ViewEncapsulation.None,
templateUrl: './time-entries-work-package-autocompleter-template.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TimeEntryWorkPackageAutocompleterComponent extends WorkPackageAutocompleterComponent implements AfterViewInit {
@Output() modeSwitch = new EventEmitter<TimeEntryWorkPackageAutocompleterMode>();
export class TimeEntriesWorkPackageAutocompleterTemplateComponent implements IAutocompleterTemplateComponent {
@Input() public mode:string|undefined;
@Input() public isOpenedInModal:boolean = false;
@Input() public hoverCards:boolean = true;

@ViewChild('headerTemplate') headerTemplate:TemplateRef<Element>;

autocompleter:TimeEntriesWorkPackageAutocompleterComponent = this.injector.get(OpAutocompleterComponent) as TimeEntriesWorkPackageAutocompleterComponent;

constructor(
readonly injector:Injector,
) {
super(injector);

this.text.all = this.I18n.t('js.label_all');
this.text.recent = this.I18n.t('js.label_recent');
}

public mode:TimeEntryWorkPackageAutocompleterMode = 'all';

public setMode(value:TimeEntryWorkPackageAutocompleterMode) {
if (value !== this.mode) {
this.modeSwitch.emit(value);
}
this.mode = value;
}
}
Loading
Loading