Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export class BrewModalImportShotMeticulousComponent
public static COMPONENT_ID: string = 'brew-modal-import-shot-meticulous';

@Input() public meticulousDevice: MeticulousDevice;
@Input() public profileFilter: string | undefined;
public radioSelection: string;
public history: any[] = [];
public chartWidth = 0;
Expand Down Expand Up @@ -112,10 +111,7 @@ export class BrewModalImportShotMeticulousComponent
private async readHistory() {
await this.uiAlert.showLoadingSpinner();
try {
const results = await this.meticulousDevice?.getHistory(
undefined,
this.profileFilter,
);
const results = await this.meticulousDevice?.getHistory();
this.history = results ?? [];
this.lastEntryTime = this.history[this.history.length - 1]?.time;
this.hasMore = this.history.length >= MeticulousDevice.PAGE_SIZE;
Expand All @@ -141,12 +137,8 @@ export class BrewModalImportShotMeticulousComponent
}
this.isLoadingMore = true;
try {
/**
* Search all profiles everytime
*/
const results = await this.meticulousDevice?.getHistory(
this.lastEntryTime,
'',
);
const allResults = results ?? [];
const newEntries = allResults.filter(
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,7 @@
"IGNORE_ANOMALY_VALUES_DESCRIPTION": "Activating this, results into a graph which will be one second behind",
"SAVE_LOGFILES_TO_NOTES_FROM_MACHINE": "Save the machine logs when saving a brew",
"IMPORT_SHOT_FROM_METICULOUS": "Import a shot",
"OR": "or",
"BEANS_IMPORTED_SUCCESSFULLY_DESCRIPTION": "All found entries in the excel list, have been transformed into new beans, enjoy a tasty brew!",
"IMPORT_UNSUCCESSFULLY": "Import not successful",
"BEAN_LIST": "Bean list",
Expand Down
7 changes: 2 additions & 5 deletions src/classes/preparationDevice/meticulous/meticulousDevice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,9 @@ export class MeticulousDevice extends PreparationDevice {
if (typeof cordova !== 'undefined') {
}
}
public async getHistory(
endDate?: number,
profileFilter?: string,
): Promise<HistoryListingEntry[]> {
public async getHistory(endDate?: number): Promise<HistoryListingEntry[]> {
const params: any = {
query: profileFilter ?? '',
query: '',
ids: [],
order_by: ['date'],
sort: 'desc',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@
<ion-item lines="none">
<span class="ion-title ion-padding-top">{{ "PREPARATION_DEVICE.TYPE_METICULOUS.TITLE" | translate }}</span>
</ion-item>
<ion-item lines="inset">
<ion-item (click)="importShotFromMeticulous()" button tappable lines="none">
<ion-icon name="cloud-download-outline" slot='start'></ion-icon>
<span>{{ "IMPORT_SHOT_FROM_METICULOUS" | translate }}</span>
</ion-item>
<div class="or-separator">
<span>{{ "OR" | translate }}</span>
</div>
<ion-item lines="none">
<ion-select [label]="'PREPARATION_DEVICE.TYPE_METICULOUS.CHOOSE_PROFILE' | translate"
label-placement="stacked"
[interfaceOptions]="customXeniaOptions"
Expand All @@ -111,11 +118,6 @@
}
</ion-select>
</ion-item>
<hr/>
<ion-item (click)="importShotFromMeticulous()" button tappable>
<ion-icon name="cloud-download-outline" slot='start'></ion-icon>
<span>{{ "IMPORT_SHOT_FROM_METICULOUS" | translate }}</span>
</ion-item>
</ion-card>
} @else if (isSanremoYOUDevice(preparationDevice)) {
<ion-card class="popover" style="display:flex; flex-direction: column;" [style.border]="baristamode?'0px!important':''">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@
margin-right: 16px;
}

/* Compact "- or -" divider between two alternative actions inside a card */
.or-separator {
display: flex;
align-items: center;
gap: 8px;
margin: 2px 16px;
color: var(--ion-color-medium);
font-size: 12px;

&::before,
&::after {
content: '';
flex: 1;
border-top: 1px solid var(--ion-color-light-shade);
}
}

ion-col.active {
color: black !important;
ion-card {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -911,20 +911,14 @@ export class BrewBrewingPreparationDeviceComponent

public async importShotFromMeticulous() {
const meticulousDevice = this.preparationDevice as MeticulousDevice;
const chosenProfileId = (
this.data.preparationDeviceBrew.params as MeticulousParams
)?.chosenProfileId;
const profileFilter = chosenProfileId
? meticulousDevice.getProfiles().find((p) => p.id === chosenProfileId)
?.name
: undefined;

// The chosen profile is only used for the brew itself, it deliberately does
// not narrow down the shot history: users expect to see every shot here.
const modal = await this.modalController.create({
component: BrewModalImportShotMeticulousComponent,
id: BrewModalImportShotMeticulousComponent.COMPONENT_ID,
componentProps: {
meticulousDevice,
profileFilter,
},
});

Expand Down
Loading