Skip to content

Commit

Permalink
repove todo done 18 to go?
Browse files Browse the repository at this point in the history
  • Loading branch information
rrahir authored and pro-odoo committed Apr 15, 2024
1 parent 015c9a2 commit ece61d6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 30 deletions.
1 change: 0 additions & 1 deletion src/helpers/pivot/pivot_runtime_definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class PivotRuntimeDefinition {
}
}

//TODOPRO It's kind duplicated from spreadsheet_pivot.ts, but with o-spreadsheet format
function getFormatFromGranularity(granularity: string | undefined): Format {
switch (granularity) {
case "year":
Expand Down
27 changes: 0 additions & 27 deletions src/helpers/pivot/spreadsheet_pivot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,6 @@ function toDomainArgs(domainStr: string[]) {
return domain;
}

// function getFormatFromGranularity(granularity: string | undefined): Format {
// switch (granularity) {
// case "year":
// return "yyyy";
// case "quarter":
// case "week":
// //TODOPRO Not implemented
// return "yyyy";
// case "day":
// return "d mmmm yyyy";
// case undefined:
// case "month":
// default:
// return "mmmm yyyy";
// }
// }

function createDate(dimension: PivotDimension, value: FieldValue["value"], locale: Locale) {
const granularity = dimension.granularity || "month";
const date = toJsDate(value, locale);
Expand All @@ -109,10 +92,7 @@ function createDate(dimension: PivotDimension, value: FieldValue["value"], local
}
const aggregateDate = new DateTime(dateParts[0], dateParts[1], dateParts[2]);
const numberDate = jsDateToNumber(aggregateDate);
//TODOPRO Store format on dimension ?
// const format = getFormatFromGranularity(granularity);
return numberDate;
// return formatValue(numberDate, { format, locale });
}

function keySelector(
Expand Down Expand Up @@ -175,8 +155,6 @@ export class SpreadsheetPivot implements Pivot<SpreadsheetPivotRuntimeDefinition
loadSync(): void {
this.invalidRangeError = undefined;
const { zone, sheetId } = this.coreDefinition;
// TODOPRO on fait 5-6 fois la même chose, on pourrait factoriser...

const range = this.getters.getRangeFromZone(sheetId, zone);

try {
Expand Down Expand Up @@ -243,7 +221,6 @@ export class SpreadsheetPivot implements Pivot<SpreadsheetPivotRuntimeDefinition
}

getMeasure(name: string): PivotMeasure {
//TODOPRO Same implementation as OdooPivot
const measures = this.definition.measures;
const measure = measures.find((m) => m.name === name);
if (!measure) {
Expand Down Expand Up @@ -620,11 +597,7 @@ export class SpreadsheetPivot implements Pivot<SpreadsheetPivotRuntimeDefinition
/**
* TODOPRO
*
* Odoo:
* - (In the move PR) https://github.com/odoo/enterprise/pull/50623
* - Order by ASC automatically for date
*
* spreadsheet:
* - Clean DOM from odoo (PivotSidePanel, EditableName, ...)
* - Insert Pivot
*/
4 changes: 2 additions & 2 deletions src/types/pivot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ export interface SPTableCell {
measure?: string;
}

//TODOPRO Use it everywhere a domain is required
//TODO Use it everywhere a domain is required
export interface DomainArg {
field: string;
value: string;
}

//TODOPRO
//TODO
// export type DomainArgs = DomainArg[];
export type DomainArgs = string[];

0 comments on commit ece61d6

Please sign in to comment.