Skip to content
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

[ch39548] Etools-modules-common improvements #6

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 9 additions & 4 deletions intervention-metadata/fund-reservations/fund-reservations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {LitElement, html} from 'lit';
import {customElement, property} from 'lit/decorators.js';
import {customElement, property, query} from 'lit/decorators.js';
import '@unicef-polymer/etools-unicef/src/etools-icons/etools-icon';

import '@unicef-polymer/etools-unicef/src/etools-content-panel/etools-content-panel';
Expand Down Expand Up @@ -27,18 +27,18 @@ import {getStore} from '@unicef-polymer/etools-utils/dist/store.util';
import {sharedStyles} from '@unicef-polymer/etools-modules-common/dist/styles/shared-styles-lit';
import FrNumbersConsistencyMixin from '@unicef-polymer/etools-modules-common/dist/mixins/fr-numbers-consistency-mixin';
import {frWarningsStyles} from '@unicef-polymer/etools-modules-common/dist/styles/fr-warnings-styles';
import ContentPanelMixin from '@unicef-polymer/etools-modules-common/dist/mixins/content-panel-mixin';
import {getArraysDiff} from '@unicef-polymer/etools-utils/dist/array.util';
import {listenForLangChanged} from '@unicef-polymer/etools-unicef/src/etools-translate';
import {openDialog} from '@unicef-polymer/etools-utils/dist/dialog.util';
import '@unicef-polymer/etools-modules-common/dist/layout/are-you-sure';
import '@unicef-polymer/etools-unicef/src/etools-icon-button/etools-icon-button';
import {EtoolsContentPanel} from '@unicef-polymer/etools-unicef/src/etools-content-panel/etools-content-panel';

/**
* @customElement
*/
@customElement('gdd-fund-reservations')
export class GDDFundReservations extends CommentsMixin(ContentPanelMixin(FrNumbersConsistencyMixin(LitElement))) {
export class GDDFundReservations extends CommentsMixin(FrNumbersConsistencyMixin(LitElement)) {
static get styles() {
return [frWarningsStyles];
}
Expand Down Expand Up @@ -116,6 +116,9 @@ export class GDDFundReservations extends CommentsMixin(ContentPanelMixin(FrNumbe
`;
}

@query('etools-content-panel')
contentPanel?: EtoolsContentPanel;

@property({type: Object})
permissions!: Permission<GDDFundReservationsPermissions>;

Expand Down Expand Up @@ -206,7 +209,9 @@ export class GDDFundReservations extends CommentsMixin(ContentPanelMixin(FrNumbe
this.frsDialogEl.data = frs;
this.frsDialogEl.interventionStatus = this.intervention.status;
this.frsDialogEl.openDialog();
this.openContentPanel();
if (this.contentPanel) {
this.contentPanel.open = true;
}
}

// get original/initial intervention frs numbers
Expand Down
6 changes: 3 additions & 3 deletions intervention-metadata/review-and-sign/review-and-sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {CommentsMixin} from '../../common/components/comments/comments-mixin';
import {AsyncAction, EtoolsEndpoint, MinimalUser, Permission, User} from '@unicef-polymer/etools-types';
import {MinimalAgreement} from '@unicef-polymer/etools-types';
import {translate} from '@unicef-polymer/etools-unicef/src/etools-translate';
import {sectionContentStyles} from '@unicef-polymer/etools-modules-common/dist/styles/content-section-styles-polymer';
import {contentSectionStylesLit} from '@unicef-polymer/etools-modules-common/dist/styles/content-section-styles-lit';
import {getEndpoint} from '@unicef-polymer/etools-utils/dist/endpoint.util';
import {gddEndpoints} from '../../utils/intervention-endpoints';
import {EtoolsUpload} from '@unicef-polymer/etools-unicef/src/etools-upload';
Expand All @@ -45,7 +45,7 @@ import {RequestEndpoint} from '@unicef-polymer/etools-utils/dist/etools-ajax/aja
@customElement('gdd-review-and-sign')
export class GDDInterventionReviewAndSign extends CommentsMixin(ComponentBaseMixin(UploadMixin(LitElement))) {
static get styles() {
return [layoutStyles];
return [contentSectionStylesLit, layoutStyles];
}
render() {
if (!this.data || !this.permissions) {
Expand All @@ -55,7 +55,7 @@ export class GDDInterventionReviewAndSign extends CommentsMixin(ComponentBaseMix
return html`
${sharedStyles}
<style>
${sectionContentStyles}:host {
:host {
display: flex;
flex-direction: column;
width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {sharedStyles} from '@unicef-polymer/etools-modules-common/dist/styles/sh
import {callClickOnSpacePushListener} from '@unicef-polymer/etools-utils/dist/accessibility.util';
import {translate} from '@unicef-polymer/etools-unicef/src/etools-translate';
import {gddTranslatesMap} from '../../utils/intervention-labels-map';
import {sectionContentStyles} from '@unicef-polymer/etools-modules-common/dist/styles/content-section-styles-polymer';
import {contentSectionStylesLit} from '@unicef-polymer/etools-modules-common/dist/styles/content-section-styles-lit';
import '@unicef-polymer/etools-unicef/src/etools-info-tooltip/info-icon-tooltip';
import '@unicef-polymer/etools-unicef/src/etools-icon-button/etools-icon-button';
import {isActiveTab} from '../../utils/utils';
Expand All @@ -38,11 +38,11 @@ import {isActiveTab} from '../../utils/utils';
@customElement('gdd-partner-reporting-requirements')
export class GDDPartnerReportingRequirements extends connectStore(LitElement) {
static get styles() {
return [layoutStyles];
return [contentSectionStylesLit, layoutStyles];
}
render() {
return html`
${sectionContentStyles} ${sharedStyles}
${sharedStyles}
<style>
:host {
display: block;
Expand Down
15 changes: 10 additions & 5 deletions intervention-workplan/results-structure/results-structure.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {getStore} from '@unicef-polymer/etools-utils/dist/store.util';
import {css, html, CSSResultArray, LitElement} from 'lit';
import {property, customElement} from 'lit/decorators.js';
import {property, customElement, query} from 'lit/decorators.js';
import {repeat} from 'lit/directives/repeat.js';
import {layoutStyles} from '@unicef-polymer/etools-unicef/src/styles/layout-styles';
import {
Expand Down Expand Up @@ -46,7 +46,7 @@ import {
} from '@unicef-polymer/etools-types';
import {translate} from '@unicef-polymer/etools-unicef/src/etools-translate';
import {gddTranslatesMap} from '../../utils/intervention-labels-map';
import ContentPanelMixin from '@unicef-polymer/etools-modules-common/dist/mixins/content-panel-mixin';
import {EtoolsContentPanel} from '@unicef-polymer/etools-unicef/src/etools-content-panel/etools-content-panel';
import {_sendRequest} from '@unicef-polymer/etools-modules-common/dist/utils/request-helper';
import {EtoolsDataTableRow} from '@unicef-polymer/etools-unicef/src/etools-data-table/etools-data-table-row';
import {GDDPdActivities} from './pd-activities';
Expand All @@ -60,7 +60,7 @@ import '@unicef-polymer/etools-unicef/src/etools-icon-button/etools-icon-button'
* @customElement
*/
@customElement('gdd-results-structure')
export class GDDResultsStructure extends CommentsMixin(ContentPanelMixin(LitElement)) {
export class GDDResultsStructure extends CommentsMixin(LitElement) {
get resultLinks(): GDDExpectedResult[] {
return this._resultLinks || [];
}
Expand All @@ -69,6 +69,7 @@ export class GDDResultsStructure extends CommentsMixin(ContentPanelMixin(LitElem
(linkA, linkB) => Number(Boolean(linkB.cp_output)) - Number(Boolean(linkA.cp_output))
);
}
@query('etools-content-panel') contentPanel?: EtoolsContentPanel;
@property() interventionId!: number | null;
@property() interventionStatus!: string;

Expand Down Expand Up @@ -390,7 +391,9 @@ export class GDDResultsStructure extends CommentsMixin(ContentPanelMixin(LitElem
canChangeCpOp: canChangeCpOp
}
});
this.openContentPanel();
if (this.contentPanel) {
this.contentPanel.open = true;
}
}

openSyncResultsStructure() {
Expand All @@ -400,7 +403,9 @@ export class GDDResultsStructure extends CommentsMixin(ContentPanelMixin(LitElem
interventionId: this.interventionId
}
});
this.openContentPanel();
if (this.contentPanel) {
this.contentPanel.open = true;
}
}

filterOutAlreadySelectedAndByCPStructure(canChangeCpOp: boolean) {
Expand Down