Skip to content

Commit 728cbc0

Browse files
authored
Merge pull request #4674 from crazyserver/MOBILE-4974
Mobile 4974
2 parents c76a756 + 8ecdb16 commit 728cbc0

File tree

77 files changed

+655
-421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+655
-421
lines changed

.github/workflows/acceptance.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,13 @@ jobs:
222222

223223
complete:
224224
runs-on: ubuntu-latest
225-
needs: [behat]
225+
needs: behat
226226

227227
steps:
228-
- uses: actions/download-artifact@v4
229-
with:
230-
path: artifacts
231-
232-
- name: Check failure artifacts
228+
- uses: technote-space/workflow-conclusion-action@v3
229+
- name: Check job status and fail if they are red
230+
if: env.WORKFLOW_CONCLUSION == 'failure'
233231
run: |
234-
rm ./artifacts/build -rf
235-
if [ -n "$(ls -A ./artifacts)" ]; then
236-
echo "There were some failures in the previous jobs"
237-
echo "### ❌ There were some failures in the previous jobs" >> $GITHUB_STEP_SUMMARY
238-
exit 1
239-
fi
232+
echo "There were some failures in the previous jobs"
233+
echo "### ❌ There were some failures in the previous jobs" >> $GITHUB_STEP_SUMMARY
234+
exit 1

.github/workflows/docker.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Docker Build and Test
22

33
on:
44
push:
5-
branches: [main, freemium-*, workplace-main]
6-
tags: ["v*.x", "freemium-*", "workplace-*"]
5+
branches: [main, latest]
6+
tags: ["v*.x"]
77
workflow_dispatch:
88

99
concurrency:
@@ -13,13 +13,14 @@ concurrency:
1313
jobs:
1414
docker:
1515
runs-on: ubuntu-latest
16+
if: github.repository == 'moodlehq/moodleapp'
1617
steps:
1718
- uses: actions/checkout@v4
1819
- name: Set up QEMU
1920
uses: docker/setup-qemu-action@v3
2021
- name: Set up Docker Buildx
2122
uses: docker/setup-buildx-action@v3
22-
- name: Build and push
23+
- name: Test build
2324
uses: docker/build-push-action@v6
2425
with:
2526
path: app

.github/workflows/testing.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,14 @@ jobs:
8787
echo "❌ Static initialization blocks are not supported in Chrome 93 and iOS 15." >> $GITHUB_STEP_SUMMARY
8888
exit 1
8989
fi
90+
91+
- name: Check .feature files all have @app_parallel_run_ prefixed tag
92+
run: |
93+
missing_tags=$(grep -L -E '^@app_parallel_run_' **/*.feature || true)
94+
if [ -n "$missing_tags" ]; then
95+
echo "::error::The following .feature files are missing the @app_parallel_run_ prefixed tag:"
96+
echo "$missing_tags"
97+
echo "❌ The following .feature files are missing the @app_parallel_run_ prefixed tag:" >> $GITHUB_STEP_SUMMARY
98+
echo "$missing_tags" >> $GITHUB_STEP_SUMMARY
99+
exit 1
100+
fi

src/addons/block/myoverview/components/myoverview/myoverview.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import {
4444
} from '@features/courses/constants';
4545
import { CoreAlerts } from '@services/overlays/alerts';
4646
import { Translate } from '@singletons';
47+
import { CoreCourseDownloadStatusIcon } from '@features/course/constants';
4748

4849
const FILTER_PRIORITY: AddonBlockMyOverviewTimeFilters[] =
4950
['all', 'inprogress', 'future', 'past', 'favourite', 'allincludinghidden', 'hidden', 'custom'];
@@ -65,7 +66,7 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
6566
filteredCourses: CoreEnrolledCourseDataWithExtraInfoAndOptions[] = [];
6667

6768
prefetchCoursesData: CorePrefetchStatusInfo = {
68-
icon: '',
69+
icon: CoreCourseDownloadStatusIcon.NOT_DOWNLOADABLE,
6970
statusTranslatable: 'core.loading',
7071
status: DownloadStatus.DOWNLOADABLE_NOT_DOWNLOADED,
7172
loading: true,

src/addons/blog/pages/index/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import { ContextLevel, CoreConstants } from '@/core/constants';
15+
import { ContextLevel, CoreSyncIcon } from '@/core/constants';
1616
import {
1717
ADDON_BLOG_AUTO_SYNCED,
1818
ADDON_BLOG_ENTRY_UPDATED,
@@ -92,7 +92,7 @@ export default class AddonBlogIndexPage implements OnInit, OnDestroy {
9292
readonly hasOfflineDataToSync = signal(false);
9393
readonly isOnline = CoreNetwork.onlineSignal;
9494
siteId: string;
95-
syncIcon = CoreConstants.ICON_SYNC;
95+
syncIcon = CoreSyncIcon.SYNC;
9696
readonly syncHidden = computed(() => !this.loaded() || !this.isOnline() || !this.hasOfflineDataToSync());
9797

9898
constructor() {

src/addons/calendar/components/upcoming-events/upcoming-events.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
import { AddonCalendarHelper, AddonCalendarFilter } from '../../services/calendar-helper';
3434
import { AddonCalendarOffline } from '../../services/calendar-offline';
3535
import { CoreCategoryData, CoreCourses } from '@features/courses/services/courses';
36-
import { CoreConstants } from '@/core/constants';
36+
import { CoreTimeConstants } from '@/core/constants';
3737
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
3838
import { CoreUrl } from '@singletons/url';
3939
import { CoreTime } from '@singletons/time';
@@ -290,7 +290,7 @@ export class AddonCalendarUpcomingEventsComponent implements OnInit, DoCheck, On
290290
}
291291

292292
const start = CoreTime.timestamp();
293-
const end = start + (CoreConstants.SECONDS_DAY * this.lookAhead);
293+
const end = start + (CoreTimeConstants.SECONDS_DAY * this.lookAhead);
294294
let result: AddonCalendarEventToDisplay[] = this.onlineEvents;
295295

296296
if (this.deletedEvents.length) {

src/addons/calendar/pages/day/day.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { Translate } from '@singletons';
3232
import { CoreNavigator } from '@services/navigator';
3333
import { Params } from '@angular/router';
3434
import { CoreArray } from '@singletons/array';
35-
import { CoreConstants } from '@/core/constants';
35+
import { CoreSyncIcon } from '@/core/constants';
3636
import { CoreSwipeSlidesDynamicItemsManager } from '@classes/items-management/swipe-slides-dynamic-items-manager';
3737
import { CoreSwipeSlidesComponent } from '@components/swipe-slides/swipe-slides';
3838
import {
@@ -88,7 +88,7 @@ export default class AddonCalendarDayPage implements OnInit, OnDestroy {
8888
manager?: CoreSwipeSlidesDynamicItemsManager<PreloadedDay, AddonCalendarDaySlidesItemsManagerSource>;
8989
loaded = false;
9090
readonly isOnline = CoreNetwork.onlineSignal;
91-
syncIcon = CoreConstants.ICON_LOADING;
91+
syncIcon = CoreSyncIcon.LOADING;
9292
filter: AddonCalendarFilter = {
9393
filtered: false,
9494
courseId: undefined,
@@ -259,7 +259,7 @@ export default class AddonCalendarDayPage implements OnInit, OnDestroy {
259259
* @returns Promise resolved when done.
260260
*/
261261
async fetchData(sync?: boolean): Promise<void> {
262-
this.syncIcon = CoreConstants.ICON_LOADING;
262+
this.syncIcon = CoreSyncIcon.LOADING;
263263

264264
if (sync) {
265265
await this.sync();
@@ -276,7 +276,7 @@ export default class AddonCalendarDayPage implements OnInit, OnDestroy {
276276
}
277277

278278
this.loaded = true;
279-
this.syncIcon = CoreConstants.ICON_SYNC;
279+
this.syncIcon = CoreSyncIcon.SYNC;
280280
}
281281

282282
/**
@@ -317,7 +317,7 @@ export default class AddonCalendarDayPage implements OnInit, OnDestroy {
317317
* @returns Promise resolved when done.
318318
*/
319319
async refreshData(sync?: boolean, afterChange?: boolean): Promise<void> {
320-
this.syncIcon = CoreConstants.ICON_LOADING;
320+
this.syncIcon = CoreSyncIcon.LOADING;
321321

322322
const selectedDay = this.manager?.getSelectedItem() || null;
323323

src/addons/calendar/pages/event/event.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { Subscription } from 'rxjs';
3131
import { CoreNavigator } from '@services/navigator';
3232
import { CorePromiseUtils } from '@singletons/promise-utils';
3333
import { ActivatedRoute, ActivatedRouteSnapshot } from '@angular/router';
34-
import { CoreConstants } from '@/core/constants';
34+
import { CoreConfigSettingKey, CoreSyncIcon } from '@/core/constants';
3535
import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/routed-items-manager-sources-tracker';
3636
import { AddonCalendarEventsSource } from '@addons/calendar/classes/events-source';
3737
import { CoreSwipeNavigationItemsManager } from '@classes/items-management/swipe-navigation-items-manager';
@@ -97,7 +97,7 @@ export default class AddonCalendarEventPage implements OnInit, OnDestroy {
9797
canEdit = false;
9898
hasOffline = false;
9999
readonly isOnline = CoreNetwork.onlineSignal;
100-
syncIcon = CoreConstants.ICON_LOADING; // Sync icon.
100+
syncIcon = CoreSyncIcon.LOADING; // Sync icon.
101101
canScheduleExactAlarms = true;
102102
scheduleExactWarningHidden = false;
103103

@@ -174,7 +174,7 @@ export default class AddonCalendarEventPage implements OnInit, OnDestroy {
174174
* Check if the app can schedule exact alarms.
175175
*/
176176
protected async checkExactAlarms(): Promise<void> {
177-
this.scheduleExactWarningHidden = !!(await CoreConfig.get(CoreConstants.DONT_SHOW_EXACT_ALARMS_WARNING, 0));
177+
this.scheduleExactWarningHidden = !!(await CoreConfig.get(CoreConfigSettingKey.DONT_SHOW_EXACT_ALARMS_WARNING, 0));
178178
this.canScheduleExactAlarms = await CoreLocalNotifications.canScheduleExactAlarms();
179179
}
180180

@@ -192,7 +192,7 @@ export default class AddonCalendarEventPage implements OnInit, OnDestroy {
192192
return;
193193
}
194194

195-
this.syncIcon = CoreConstants.ICON_LOADING;
195+
this.syncIcon = CoreSyncIcon.LOADING;
196196

197197
await this.initializeSwipeManager();
198198
await this.fetchEvent();
@@ -317,7 +317,7 @@ export default class AddonCalendarEventPage implements OnInit, OnDestroy {
317317
}
318318

319319
this.eventLoaded = true;
320-
this.syncIcon = CoreConstants.ICON_SYNC;
320+
this.syncIcon = CoreSyncIcon.SYNC;
321321
}
322322

323323
/**
@@ -466,7 +466,7 @@ export default class AddonCalendarEventPage implements OnInit, OnDestroy {
466466
* @returns Promise resolved when done.
467467
*/
468468
async refreshEvent(sync = false, showErrors = false): Promise<void> {
469-
this.syncIcon = CoreConstants.ICON_LOADING;
469+
this.syncIcon = CoreSyncIcon.LOADING;
470470

471471
const promises: Promise<void>[] = [];
472472

@@ -664,7 +664,7 @@ export default class AddonCalendarEventPage implements OnInit, OnDestroy {
664664
* Hide alarm warning.
665665
*/
666666
hideAlarmWarning(): void {
667-
CoreConfig.set(CoreConstants.DONT_SHOW_EXACT_ALARMS_WARNING, 1);
667+
CoreConfig.set(CoreConfigSettingKey.DONT_SHOW_EXACT_ALARMS_WARNING, 1);
668668
this.scheduleExactWarningHidden = true;
669669
}
670670

src/addons/calendar/pages/index/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { ActivatedRoute, Params } from '@angular/router';
2727
import { AddonCalendarCalendarComponent } from '../../components/calendar/calendar';
2828
import { AddonCalendarUpcomingEventsComponent } from '../../components/upcoming-events/upcoming-events';
2929
import { CoreNavigator } from '@services/navigator';
30-
import { CoreConstants } from '@/core/constants';
30+
import { CoreSyncIcon } from '@/core/constants';
3131
import { CoreModals } from '@services/overlays/modals';
3232
import {
3333
ADDON_CALENDAR_AUTO_SYNCED,
@@ -82,7 +82,7 @@ export default class AddonCalendarIndexPage implements OnInit, OnDestroy {
8282
loaded = false;
8383
hasOffline = false;
8484
readonly isOnline = CoreNetwork.onlineSignal;
85-
syncIcon = CoreConstants.ICON_LOADING;
85+
syncIcon = CoreSyncIcon.LOADING;
8686
showCalendar = true;
8787
loadUpcoming = false;
8888
filter: AddonCalendarFilter = {
@@ -198,7 +198,7 @@ export default class AddonCalendarIndexPage implements OnInit, OnDestroy {
198198
*/
199199
async fetchData(sync?: boolean, showErrors?: boolean): Promise<void> {
200200

201-
this.syncIcon = CoreConstants.ICON_LOADING;
201+
this.syncIcon = CoreSyncIcon.LOADING;
202202

203203
let refreshComponent = false;
204204

@@ -265,7 +265,7 @@ export default class AddonCalendarIndexPage implements OnInit, OnDestroy {
265265

266266
this.loaded = true;
267267
this.initialized = true;
268-
this.syncIcon = CoreConstants.ICON_SYNC;
268+
this.syncIcon = CoreSyncIcon.SYNC;
269269
}
270270

271271
/**
@@ -296,7 +296,7 @@ export default class AddonCalendarIndexPage implements OnInit, OnDestroy {
296296
* @returns Promise resolved when done.
297297
*/
298298
async refreshData(sync = false, showErrors = false, afterChange = false): Promise<void> {
299-
this.syncIcon = CoreConstants.ICON_LOADING;
299+
this.syncIcon = CoreSyncIcon.LOADING;
300300

301301
const promises: Promise<void>[] = [];
302302

src/addons/calendar/services/calendar-helper.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
import { CoreConfig } from '@services/config';
2828
import { CoreObject } from '@singletons/object';
2929
import { CoreCourseModuleHelper } from '@features/course/services/course-module-helper';
30-
import { ContextLevel, CoreConstants } from '@/core/constants';
30+
import { ContextLevel, CoreTimeConstants } from '@/core/constants';
3131
import { dayjs, Dayjs } from '@/core/utils/dayjs';
3232
import { makeSingleton } from '@singletons';
3333
import { AddonCalendarOfflineEventDBRecord } from './database/calendar-offline';
@@ -261,7 +261,7 @@ export class AddonCalendarHelperProvider {
261261
if (eventFormatted.duration == 1) {
262262
eventFormatted.timeduration = (event.timedurationuntil || 0) - event.timestart;
263263
} else if (eventFormatted.duration == 2) {
264-
eventFormatted.timeduration = (event.timedurationminutes || 0) * CoreConstants.SECONDS_MINUTE;
264+
eventFormatted.timeduration = (event.timedurationminutes || 0) * CoreTimeConstants.SECONDS_MINUTE;
265265
} else {
266266
eventFormatted.timeduration = 0;
267267
}
@@ -632,8 +632,8 @@ export class AddonCalendarHelperProvider {
632632
fetchTimestarts.push(eventData.timestart);
633633

634634
for (let i = 1; i < eventData.repeated; i++) {
635-
invalidateTimestarts.push(eventData.timestart + CoreConstants.SECONDS_DAY * 7 * i);
636-
invalidateTimestarts.push(eventData.timestart - CoreConstants.SECONDS_DAY * 7 * i);
635+
invalidateTimestarts.push(eventData.timestart + CoreTimeConstants.SECONDS_DAY * 7 * i);
636+
invalidateTimestarts.push(eventData.timestart - CoreTimeConstants.SECONDS_DAY * 7 * i);
637637
}
638638

639639
// Get the repeated events to invalidate them.
@@ -651,7 +651,7 @@ export class AddonCalendarHelperProvider {
651651
fetchTimestarts.push(time);
652652

653653
while (eventData.repeated > 1) {
654-
time += CoreConstants.SECONDS_DAY * 7;
654+
time += CoreTimeConstants.SECONDS_DAY * 7;
655655
eventData.repeated--;
656656
invalidateTimestarts.push(time);
657657
}

0 commit comments

Comments
 (0)