Skip to content

Commit

Permalink
Merge pull request #3946 from crazyserver/MOBILE-4456
Browse files Browse the repository at this point in the history
Mobile 4456
  • Loading branch information
NoelDeMartin authored Feb 29, 2024
2 parents 0c49a45 + cd40c1a commit 59cc4bd
Show file tree
Hide file tree
Showing 98 changed files with 509 additions and 210 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:host {
core-mod-icon {
background: transparent;
margin: 0;
--filter: var(--module-icon-filter);
--padding-start: 0px;
--module-icon-size: 24px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h2>{{ 'addon.block_activitymodules.pluginname' | translate }}</h2>
</ion-item-divider>
<core-loading [hideUntil]="loaded">
<ion-item class="ion-text-wrap" *ngFor="let entry of entries" [detail]="true" button (click)="gotoCoureListModType(entry)">
<core-mod-icon slot="start" [modicon]="entry.icon" [modname]="entry.iconModName" [showAlt]="false" />
<core-mod-icon slot="start" [modicon]="entry.icon" [modname]="entry.iconModName" [showAlt]="false" [colorize]="false" />
<ion-label>{{ entry.name }}</ion-label>
</ion-item>
</core-loading>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h2>{{ 'addon.block_recentlyaccesseditems.pluginname' | translate }}</h2>
<ion-card>
<ion-item class="core-course-module-handler ion-text-wrap" [detail]="false" (click)="action($event, item)" button>
<core-mod-icon slot="start" *ngIf="item.iconUrl" [modicon]="item.iconUrl" [modname]="item.modname"
[componentId]="item.cmid" [showAlt]="false" [purpose]="item.purpose" />
[componentId]="item.cmid" [showAlt]="false" [purpose]="item.purpose" [isBranded]="item.branded" />
<ion-label>
<!-- Add the icon title so accessibility tools read it. -->
<span class="sr-only" *ngIf="item.iconTitle">{{ item.iconTitle }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h4 [class.core-bold]="!course">{{ dayEvents.dayTimestamp * 1000 | coreFormatDat
<ion-col class="addon-block-timeline-activity-time ion-no-padding ion-text-nowrap">
<small>{{event.timesort * 1000 | coreFormatDate:"strftimetime24" }}</small>
<core-mod-icon *ngIf="event.iconUrl" [modicon]="event.iconUrl" [componentId]="event.instance"
[modname]="event.modulename" [purpose]="event.purpose" />
[modname]="event.modulename" [purpose]="event.purpose" [isBranded]="event.branded" />
</ion-col>
<ion-col class="addon-block-timeline-activity-name ion-no-padding">
<p class="item-heading">
Expand Down
2 changes: 1 addition & 1 deletion src/addons/block/timeline/components/events/events.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ h4.core-bold {
}

core-mod-icon {
--padding: 8px;
--module-legacy-icon-padding: 8px;
--margin-end: 0.5rem;
--margin-vertical: 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ion-item class="ion-text-wrap addon-calendar-event" [attr.aria-label]="event.name" (click)="eventClicked(event)" button
[ngClass]="['addon-calendar-eventtype-'+event.eventtype]" [detail]="false">
<core-mod-icon *ngIf="event.moduleIcon" [modicon]="event.moduleIcon" slot="start" [modname]="event.modulename"
[componentId]="event.instance" [showAlt]="false" [purpose]="event.purpose" />
[componentId]="event.instance" [showAlt]="false" [purpose]="event.purpose" [isBranded]="event.branded" />
<ion-icon *ngIf="event.eventIcon && !event.moduleIcon" [name]="event.eventIcon" slot="start" aria-hidden="true" />
<ion-label>
<!-- Add the icon title so accessibility tools read it. -->
Expand Down
3 changes: 2 additions & 1 deletion src/addons/calendar/pages/day/day.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ <h2>{{ periodName }}</h2>
(click)="gotoEvent(event.id, day)" [class.item-dimmed]="event.ispast"
[ngClass]="['addon-calendar-eventtype-'+event.eventtype]" button [detail]="false">
<core-mod-icon *ngIf="event.moduleIcon" [modicon]="event.moduleIcon" slot="start" [showAlt]="false"
[modname]="event.modulename" [componentId]="event.instance" [purpose]="event.purpose" />
[modname]="event.modulename" [componentId]="event.instance" [purpose]="event.purpose"
[isBranded]="event.branded" />
<ion-icon *ngIf="event.eventIcon && !event.moduleIcon" [name]="event.eventIcon" slot="start"
aria-hidden="true" />
<ion-label>
Expand Down
1 change: 1 addition & 0 deletions src/addons/calendar/pages/event/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ <h1 *ngIf="event">
<ion-item class="ion-text-wrap addon-calendar-event" collapsible [ngClass]="['addon-calendar-eventtype-'+event.eventtype]">
<core-mod-icon *ngIf="event.moduleIcon" [modicon]="event.moduleIcon" [showAlt]="false" [modname]="event.modulename"
[componentId]="event.instance" slot="start" [purpose]="event.purpose" />
<!-- TODO MOBILE-4530 Add isBranded when available -->
<ion-icon *ngIf=" event.eventIcon && !event.moduleIcon" [name]="event.eventIcon" aria-hidden="true" slot="start" />
<ion-label>
<!-- Add the icon title so accessibility tools read it. -->
Expand Down
3 changes: 2 additions & 1 deletion src/addons/competency/pages/competency/competency.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ <h1 *ngIf="competency">
</p>
<ion-item class="ion-text-wrap" *ngFor="let activity of coursemodules" [href]="activity.url"
[attr.aria-label]="activity.name" core-link capture="true">
<core-mod-icon slot="start" [modicon]="activity.iconurl" [showAlt]="false" *ngIf="activity.iconurl" />
<core-mod-icon slot="start" [modicon]="activity.iconurl" [showAlt]="false" *ngIf="activity.iconurl"
[colorize]="false" />
<ion-label>
<core-format-text [text]="activity.name" contextLevel="module" [contextInstanceId]="activity.id"
[courseId]="courseId" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ <h2 class="ion-margin-horizontal" *ngIf="courseCompetencies && courseCompetencie
</p>
<ion-item class="ion-text-wrap core-course-module-handler" [attr.aria-label]="activity.name" core-link
*ngFor="let activity of competency.coursemodules" [href]="activity.url" capture="true">
<core-mod-icon slot="start" [modicon]="activity.iconurl" [showAlt]="false" *ngIf="activity.iconurl" />
<core-mod-icon slot="start" [modicon]="activity.iconurl" [showAlt]="false" *ngIf="activity.iconurl"
[colorize]="false" />
<ion-label>
<core-format-text [text]="activity.name" contextLevel="module" [contextInstanceId]="activity.id"
[courseId]="courseId" />
Expand Down
17 changes: 13 additions & 4 deletions src/addons/competency/services/competency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core';
import { CoreSiteWSPreSets } from '@classes/sites/authenticated-site';
import { CoreSite } from '@classes/sites/site';
import { CoreCommentsArea } from '@features/comments/services/comments';
import { CoreCourseSummary, CoreCourseModuleSummary } from '@features/course/services/course';
import { CoreCourseSummary } from '@features/course/services/course';
import { CoreUserSummary } from '@features/user/services/user';
import { CoreSites } from '@services/sites';
import { CoreUtils } from '@services/utils/utils';
Expand Down Expand Up @@ -877,12 +877,14 @@ type AddonCompetencyDataForUserCompetencySummaryInCourseWSParams = {
};

/**
* Data returned by competency's user_competency_summary_in_course_exporter.
* Data returned by tool_lp_data_for_user_competency_summary_in_course WS.
*
* WS Description: Load a summary of a user competency.
*/
export type AddonCompetencyDataForUserCompetencySummaryInCourseWSResponse = {
usercompetencysummary: AddonCompetencyDataForUserCompetencySummaryWSResponse;
course: CoreCourseSummary;
coursemodules: CoreCourseModuleSummary[]; // Coursemodules.
coursemodules: AddonCompetencyCourseModuleInfo[]; // Coursemodules.
plans: AddonCompetencyPlan[]; // @since 3.7. Plans.
pluginbaseurl: string; // @since 3.7. Pluginbaseurl.
};
Expand Down Expand Up @@ -1009,7 +1011,7 @@ export type AddonCompetencyDataForCourseCompetenciesPageWSResponse = {
export type AddonCompetencyDataForCourseCompetenciesPageCompetency = {
competency: AddonCompetencyCompetency;
coursecompetency: AddonCompetencyCourseCompetency;
coursemodules: CoreCourseModuleSummary[];
coursemodules: AddonCompetencyCourseModuleInfo[];
usercompetencycourse?: AddonCompetencyUserCompetencyCourse;
ruleoutcomeoptions: {
value: number; // The option value.
Expand All @@ -1020,6 +1022,13 @@ export type AddonCompetencyDataForCourseCompetenciesPageCompetency = {
plans: AddonCompetencyPlan[]; // @since 3.7.
};

type AddonCompetencyCourseModuleInfo = {
id: number; // Id.
name: string; // Name.
url?: string; // Url.
iconurl: string; // Iconurl.
};

/**
* Params of core_competency_user_competency_plan_viewed and core_competency_user_competency_viewed_in_plan WS.
*/
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/addons/mod/bigbluebuttonbn/services/handlers/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class AddonModBBBModuleHandlerService extends CoreModuleHandlerBase imple
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_OTHER,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_COMMUNICATION,
};

/**
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/addons/mod/h5pactivity/services/handlers/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class AddonModH5PActivityModuleHandlerService extends CoreModuleHandlerBa
[CoreConstants.FEATURE_GRADE_HAS_GRADE]: true,
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_CONTENT,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_INTERACTIVECONTENT,
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/imscp/services/handlers/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class AddonModImscpModuleHandlerService extends CoreModuleHandlerBase imp
[CoreConstants.FEATURE_GRADE_OUTCOMES]: false,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_CONTENT,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_INTERACTIVECONTENT,
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/lesson/services/handlers/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class AddonModLessonModuleHandlerService extends CoreModuleHandlerBase im
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_CONTENT,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_INTERACTIVECONTENT,
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/lti/services/handlers/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class AddonModLtiModuleHandlerService extends CoreModuleHandlerBase imple
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_CONTENT,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_OTHER,
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/scorm/services/handlers/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class AddonModScormModuleHandlerService extends CoreModuleHandlerBase imp
[CoreConstants.FEATURE_GRADE_OUTCOMES]: true,
[CoreConstants.FEATURE_BACKUP_MOODLE2]: true,
[CoreConstants.FEATURE_SHOW_DESCRIPTION]: true,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_CONTENT,
[CoreConstants.FEATURE_MOD_PURPOSE]: ModPurpose.MOD_PURPOSE_INTERACTIVECONTENT,
};

/**
Expand Down
31 changes: 14 additions & 17 deletions src/addons/notifications/notifications.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
@use "theme/globals" as *;

:host {
--extra-icon-size: 16px;
--icon-size: 24px;
--icon-size: 32px;
--core-avatar-size: var(--icon-size);
--extra-icon-size: 12px;

::ng-deep core-user-avatar {
.core-avatar-extra-img,
core-mod-icon {
.core-avatar-extra-img {
margin: 0 !important;
position: absolute;
right: -4px;
bottom: -4px;
--padding: 0.2rem;
--module-icon-padding: 0.2rem;
}

.core-avatar-extra-img {
Expand All @@ -20,37 +20,34 @@
img {
max-width: var(--extra-icon-size);
max-height: var(--extra-icon-size);
width: var(--extra-icon-size);
height: var(--extra-icon-size);
display: block;
}
}

core-mod-icon {
--size: var(--extra-icon-size);
}
}

div.core-notification-icon {
max-width: var(--icon-size);
max-height: var(--icon-size);
img {
width: var(--icon-size);
height: var(--icon-size);
height: var(--icon-size);
}
ion-icon {
font-size: var(--icon-size);
}
padding: 0.7rem;
padding: 0px;
background: var(--background-color);
border-radius: var(--radius-xs);
}

.core-notification-icon {
--module-icon-size: var(--icon-size);
@include margin(6px, 8px, 6px, 0px);
}

.core-notification-img {
@include margin(6px, 8px, 6px, 0px);
width: var(--core-avatar-size);
height: var(--core-avatar-size);
width: var(--icon-size);
height: var(--icon-size);
object-fit: cover;
border-radius: var(--core-avatar-radius);
}
}
2 changes: 1 addition & 1 deletion src/addons/notifications/pages/list/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h1>{{ 'addon.notifications.notifications' | translate }}</h1>
[profileUrl]="notification.profileimageurlfrom" [fullname]="notification.userfromfullname"
[userId]="notification.useridfrom">
<div class="core-avatar-extra-img" *ngIf="notification.iconurl">
<img [src]="notification.iconurl" alt="" role="presentation">
<img [src]="notification.iconurl" alt="" role="presentation" core-external-content>
</div>
</core-user-avatar>

Expand Down
12 changes: 1 addition & 11 deletions src/addons/notifications/pages/list/list.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use "theme/globals" as *;

ion-item.addon-notification-item {

ion-label {
margin-top: 8px;
margin-bottom: 8px;
Expand Down Expand Up @@ -32,17 +33,6 @@ ion-item.addon-notification-item {
align-self: start;
margin-top: 16px;
}

--icon-size: 16px;
--extra-icon-size: 12px;
--core-avatar-size: 32px;

div.core-notification-icon,
core-mod-icon.core-notification-icon {
--padding: 8px;
max-width: var(--core-avatar-size);
max-height: var(--core-avatar-size);
}
}

.mark-all-as-read {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1>{{ 'addon.notifications.notifications' | translate }}</h1>
<core-user-avatar *ngIf="notification.useridfrom > 0" slot="start" [userId]="notification.useridfrom"
[profileUrl]="notification.profileimageurlfrom" [fullname]="notification.userfromfullname">
<div class="core-avatar-extra-img" *ngIf="notification.iconurl">
<img [src]="notification.iconurl" alt="" role="presentation">
<img [src]="notification.iconurl" alt="" role="presentation" core-external-content>
</div>
</core-user-avatar>

Expand Down
2 changes: 2 additions & 0 deletions src/addons/notifications/pages/notification/notification.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@use "theme/globals" as *;

:host {
--icon-size: 44px;
--extra-icon-size: 16px;

.core-notification-title {
[slot=start] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ <h1>{{ 'addon.storagemanager.coursedownloads' | translate }}</h1>
<ion-item class="core-course-storage-activity"
*ngIf="downloadEnabled || (!module.calculatingSize && module.totalSize > 0)">
<core-mod-icon slot="start" *ngIf="module.handlerData.icon" [modicon]="module.handlerData.icon"
[modname]="module.modname" [componentId]="module.instance" [fallbackTranslation]="module.modplural" />
[modname]="module.modname" [componentId]="module.instance" [fallbackTranslation]="module.modplural"
[isBranded]="module.branded" />
<ion-label class="ion-text-wrap">
<p class="item-heading {{module.handlerData!.class}} addon-storagemanager-module-size">
<core-format-text [text]="module.handlerData.title" [courseId]="module.course" contextLevel="module"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ ion-badge {
}

ion-item core-mod-icon {
--size: 18px;
--padding: 9px;
--module-icon-size: 24px;
--module-legacy-icon-size: 16px;

--margin-vertical: 8px;
--margin-end: 8px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/assets/img/mod/assign.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/img/mod/bigbluebuttonbn.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 59cc4bd

Please sign in to comment.