refactor: update openstapps packages

This commit is contained in:
Jovan Krunić
2021-08-18 10:29:18 +00:00
parent 09aa7bb5c5
commit b56a428c92
16 changed files with 328 additions and 427 deletions

View File

@@ -1,3 +1,18 @@
<!--
~ Copyright (C) 2021 StApps
~ This program is free software: you can redistribute it and/or modify it
~ under the terms of the GNU General Public License as published by the Free
~ Software Foundation, version 3.
~
~ This program is distributed in the hope that it will be useful, but WITHOUT
~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along with
~ this program. If not, see <https://www.gnu.org/licenses/>.
-->
<ion-card
[style.height.px]="height * scale"
[style.marginTop.px]="(fromY - fromHour) * scale - 5"
@@ -12,9 +27,13 @@
</ion-card-title>
<ion-card-subtitle>
<ion-icon name="calendar"></ion-icon>
<span class="repetitions">
{{ scheduleEvent.dateSeries.frequency }}
until
<span
class="repetitions"
*ngIf="scheduleEvent.dateSeries.repeatFrequency"
>
{{ 'schedule.card.forEach' | translate }}
{{ scheduleEvent.dateSeries.repeatFrequency | amDuration }}
{{ 'schedule.card.until' | translate }}
{{
scheduleEvent.dateSeries.dates | last | amDateFormat: 'DD. MMM YYYY'
}}

View File

@@ -14,7 +14,7 @@
*/
import {Component, Input, OnDestroy, OnInit} from '@angular/core';
import {SCDateSeries, SCUuid} from '@openstapps/core';
import {flatMap, groupBy, omit, sortBy} from 'lodash-es';
import {flatMap, groupBy, isNil, omit, sortBy} from 'lodash-es';
import moment from 'moment';
import {Subscription} from 'rxjs';
import {materialFade} from '../../../animation/material-motion';
@@ -115,7 +115,7 @@ export class ScheduleSingleEventsComponent implements OnInit, OnDestroy {
// TODO: replace with filter
return ScheduleSingleEventsComponent.groupDateSeriesToDays(
dateSeries.filter(it => it.frequency === 'single'),
dateSeries.filter(it => isNil(it.repeatFrequency)),
);
}

View File

@@ -1,6 +1,5 @@
/* eslint-disable unicorn/no-null */
/*
* Copyright (C) 2018-2020 StApps
* Copyright (C) 2021 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
@@ -13,11 +12,14 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
/* eslint-disable unicorn/no-null */
import {Injectable, OnDestroy} from '@angular/core';
import {
Bounds,
SCDateSeries,
SCISO8601Date,
SCISO8601Duration,
SCSearchFilter,
SCThingType,
SCUuid,
@@ -102,7 +104,7 @@ export class ScheduleProvider implements OnDestroy {
*/
async getDateSeries(
uuids: SCUuid[],
frequencies?: Array<'single' | 'weekly' | 'biweekly'>,
frequencies?: Array<SCISO8601Duration>,
from?: SCISO8601Date | 'now',
to?: SCISO8601Date | 'now',
): Promise<SCDateSeries[]> {
@@ -138,7 +140,7 @@ export class ScheduleProvider implements OnDestroy {
arguments: {
filters: frequencies.map(frequency => ({
arguments: {
field: 'frequency',
field: 'repeatFrequency',
value: frequency,
},
type: 'value',