-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Mobile 4842 #4538
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
Open
crazyserver
wants to merge
14
commits into
moodlehq:main
Choose a base branch
from
crazyserver:MOBILE-4842
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Mobile 4842 #4538
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1950d9a
MOBILE-4842 block: Add block name constants
crazyserver 158e23b
MOBILE-4842 course: Move course completion out of course helper
crazyserver 3f24390
MOBILE-4842 chore: Change file actions component to signals
crazyserver 84624a3
MOBILE-4842 timeline: Remove BehaviorSubject in favour of signals
crazyserver 86609c8
MOBILE-4842 search-box: Fix focus out of history depending on the click
crazyserver 1ae7bbb
MOBILE-4842 chore: Use signals on search box component
crazyserver 7e9e5af
MOBILE-4842 blocks: Use signals on side blocks
crazyserver 7f34026
MOBILE-4842 chore: Use signals on core-loading
crazyserver 8abff5e
MOBILE-4842 chore: Use input signals on reminders
crazyserver f4d229e
MOBILE-4842 chore: Use new host directive instead of HostBindings
crazyserver de46ae4
MOBILE-4842 chore: ViewChild and ViewChildren migration
crazyserver 23d1acc
MOBILE-4842 chore: Migrate complex ViewChild
crazyserver 9591aa5
MOBILE-4842 chore: Migrate complex ContentChild
crazyserver 01e30c4
MOBILE-4842 chore: Migrate some Inputs and Outputs on directives
crazyserver File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// (C) Copyright 2015 Moodle Pty Ltd. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
export const ADDON_BLOCK_MYOVERVIEW_BLOCK_NAME = 'myoverview'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
142 changes: 73 additions & 69 deletions
142
src/addons/block/timeline/components/events/addon-block-timeline-events.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,93 @@ | ||
@if (course) { | ||
@if (course()) { | ||
<ion-item> | ||
<ion-label class="ion-text-wrap"> | ||
<h3> | ||
<span class="sr-only">{{ 'core.courses.aria:coursename' | translate }}</span> | ||
<core-format-text [text]="course.displayname || course.fullname" contextLevel="course" [contextInstanceId]="course.id" /> | ||
<core-format-text | ||
[text]="course().displayname || course().fullname" contextLevel="course" [contextInstanceId]="course().id" /> | ||
</h3> | ||
</ion-label> | ||
</ion-item> | ||
} | ||
<ion-item-group *ngFor="let dayEvents of events"> | ||
<ion-item> | ||
<ion-label> | ||
@if (course) { | ||
<h4><ng-container *ngTemplateOutlet="date" /></h4> | ||
} @else { | ||
<h3><ng-container *ngTemplateOutlet="date" /></h3> | ||
} | ||
<ng-template #date> | ||
{{ dayEvents.dayTimestamp * 1000 | coreFormatDate:"strftimedaydate" }} | ||
</ng-template> | ||
</ion-label> | ||
</ion-item> | ||
<ng-container *ngFor="let event of dayEvents.events"> | ||
<ion-item class="addon-block-timeline-activity" [detail]="false" (click)="action($event, event.url)" [attr.aria-label]="event.name" | ||
button lines="full" [attr.data-event-course-id]="event.course?.id"> | ||
@for (dayEvents of events(); track dayEvents.dayTimestamp) { | ||
<ion-item-group> | ||
<ion-item> | ||
<ion-label> | ||
<ion-row class="ion-justify-content-between ion-align-items-center ion-nowrap ion-no-padding"> | ||
<ion-col class="addon-block-timeline-activity-time ion-no-padding ion-text-nowrap"> | ||
<small>{{event.timesort * 1000 | coreFormatDate:"strftimetime24" }}</small> | ||
@if (event.iconUrl) { | ||
<core-mod-icon [modicon]="event.iconUrl" [componentId]="event.instance" [modname]="event.modulename" | ||
[purpose]="event.purpose" [colorize]="colorizeIcons" [isBranded]="event.branded" /> | ||
} | ||
</ion-col> | ||
<ion-col class="addon-block-timeline-activity-name ion-no-padding"> | ||
<p class="item-heading"> | ||
<span> | ||
<core-format-text [text]="event.activityname || event.name" contextLevel="module" | ||
[contextInstanceId]="event.id" [courseId]="event.course?.id" /> | ||
</span> | ||
@if (event.overdue) { | ||
<ion-badge color="danger">{{ 'addon.block_timeline.overdue' | translate }} | ||
</ion-badge> | ||
@if (course()) { | ||
<h4><ng-container *ngTemplateOutlet="date" /></h4> | ||
} @else { | ||
<h3><ng-container *ngTemplateOutlet="date" /></h3> | ||
} | ||
<ng-template #date> | ||
{{ dayEvents.dayTimestamp * 1000 | coreFormatDate:"strftimedaydate" }} | ||
</ng-template> | ||
</ion-label> | ||
</ion-item> | ||
@for (event of dayEvents.events; track event.id) { | ||
<ion-item class="addon-block-timeline-activity" [detail]="false" (click)="action($event, event.url)" | ||
[attr.aria-label]="event.name" button lines="full" [attr.data-event-course-id]="event.course?.id"> | ||
<ion-label> | ||
<ion-row class="ion-justify-content-between ion-align-items-center ion-nowrap ion-no-padding"> | ||
<ion-col class="addon-block-timeline-activity-time ion-no-padding ion-text-nowrap"> | ||
<small>{{event.timesort * 1000 | coreFormatDate:"strftimetime24" }}</small> | ||
@if (event.iconUrl) { | ||
<core-mod-icon [modicon]="event.iconUrl" [componentId]="event.instance" [modname]="event.modulename" | ||
[purpose]="event.purpose" [colorize]="colorizeIcons" [isBranded]="event.branded" /> | ||
} | ||
</p> | ||
@if (showInlineCourse && event.course) { | ||
<p> | ||
</ion-col> | ||
<ion-col class="addon-block-timeline-activity-name ion-no-padding"> | ||
<p class="item-heading"> | ||
<span> | ||
<core-format-text [text]="event.course.fullnamedisplay" contextLevel="course" | ||
[contextInstanceId]="event.course.id" /> | ||
<core-format-text [text]="event.activityname || event.name" contextLevel="module" | ||
[contextInstanceId]="event.id" [courseId]="event.course?.id" /> | ||
</span> | ||
@if (event.overdue) { | ||
<ion-badge color="danger">{{ 'addon.block_timeline.overdue' | translate }} | ||
</ion-badge> | ||
} | ||
</p> | ||
} | ||
@if (event.activitystr) { | ||
<p> | ||
<span> | ||
@if (event.activitystr) { | ||
<core-format-text [text]="event.activitystr" contextLevel="module" [contextInstanceId]="event.id" /> | ||
} | ||
</span> | ||
</p> | ||
} | ||
</ion-col> | ||
</ion-row> | ||
@if (event.action && event.action.actionable) { | ||
<div class="addon-block-timeline-activity-action"> | ||
<ion-button fill="outline" (click)="action($event, event.action.url)" [title]="event.action.name" class="chip"> | ||
{{event.action.name}} | ||
@if (event.action.showitemcount) { | ||
<ion-badge slot="end" class="ion-margin-start"> | ||
{{event.action.itemcount}} | ||
</ion-badge> | ||
@if (showInlineCourse() && event.course) { | ||
<p> | ||
<span> | ||
<core-format-text [text]="event.course.fullnamedisplay" contextLevel="course" | ||
[contextInstanceId]="event.course.id" /> | ||
</span> | ||
</p> | ||
} | ||
</ion-button> | ||
</div> | ||
} | ||
</ion-label> | ||
</ion-item> | ||
</ng-container> | ||
</ion-item-group> | ||
@if (event.activitystr) { | ||
<p> | ||
<span> | ||
@if (event.activitystr) { | ||
<core-format-text [text]="event.activitystr" contextLevel="module" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This if is duplicated, it's already a couple of lines above. |
||
[contextInstanceId]="event.id" /> | ||
} | ||
</span> | ||
</p> | ||
} | ||
</ion-col> | ||
</ion-row> | ||
@if (event.action && event.action.actionable) { | ||
<div class="addon-block-timeline-activity-action"> | ||
<ion-button fill="outline" (click)="action($event, event.action.url)" [title]="event.action.name" class="chip"> | ||
{{event.action.name}} | ||
@if (event.action.showitemcount) { | ||
<ion-badge slot="end" class="ion-margin-start"> | ||
{{event.action.itemcount}} | ||
</ion-badge> | ||
} | ||
</ion-button> | ||
</div> | ||
} | ||
</ion-label> | ||
</ion-item> | ||
} | ||
</ion-item-group> | ||
} | ||
|
||
@if (canLoadMore) { | ||
@if (canLoadMore()) { | ||
<div class="ion-padding ion-text-center"> | ||
<!-- Button and spinner to show more attempts. --> | ||
@if (loadingMore) { | ||
@if (loadingMore()) { | ||
<ion-spinner [attr.aria-label]="'core.loading' | translate" /> | ||
} @else { | ||
<ion-button expand="block" (click)="loadMore.emit()" fill="outline"> | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't new, but the fact that "canLoadMore" is an event ID is really confusing, I expect a variable named "canLoadMore" to be a boolean. The timeline service is not exported to services, so this can be a good opportunity to rename that variable to something that makes more sense.