Skip to content
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

Mobile 4638 #4153

Merged
merged 2 commits into from
Aug 19, 2024
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
2 changes: 1 addition & 1 deletion scripts/langindex.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@
"addon.mod_choice.userchoosethisoption": "choice",
"addon.mod_choice.yourselection": "choice",
"addon.mod_data.actionsmenu": "data",
"addon.mod_data.addentries": "data",
"addon.mod_data.add": "data",
"addon.mod_data.advancedsearch": "data",
"addon.mod_data.alttext": "data",
"addon.mod_data.approve": "data",
Expand Down
2 changes: 1 addition & 1 deletion src/addons/messages/pages/discussion/discussion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
groupMessagingEnabled: boolean;
isGroup = false;
members: {[id: number]: AddonMessagesConversationMember} = {}; // Members that wrote a message, indexed by ID.
favouriteIcon = 'fa-star';
favouriteIcon = 'fas-star';
deleteIcon = 'fas-trash';
blockIcon = 'fas-user-lock';
addRemoveIcon = 'fas-user-plus';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<ion-icon name="fas-magnifying-glass" slot="icon-only" aria-hidden="true" />
</ion-button>
<core-context-menu>
<core-context-menu-item [priority]="500" *ngIf="canAdd" [content]="'addon.mod_data.addentries' | translate" iconAction="fas-plus"
(action)="gotoAddEntries()" />
<core-context-menu-item [priority]="500" *ngIf="canAdd" [content]="'addon.mod_data.add' | translate" iconAction="fas-plus"
(action)="gotoAddEntry()" />
<core-context-menu-item [priority]="400" *ngIf="firstEntry" [content]="'addon.mod_data.single' | translate" iconAction="fas-file"
(action)="gotoEntry(firstEntry)" />
</core-context-menu>
Expand Down Expand Up @@ -111,8 +111,8 @@


<ion-fab slot="fixed" core-fab vertical="bottom" horizontal="end" *ngIf="canAdd">
<ion-fab-button (click)="gotoAddEntries()" [attr.aria-label]="'addon.mod_data.addentries' | translate">
<ion-fab-button (click)="gotoAddEntry()" [attr.aria-label]="'addon.mod_data.add' | translate">
<ion-icon name="fas-plus" aria-hidden="true" />
<span class="sr-only">{{ 'addon.mod_data.addentries' | translate }}</span>
<span class="sr-only">{{ 'addon.mod_data.add' | translate }}</span>
</ion-fab-button>
</ion-fab>
4 changes: 2 additions & 2 deletions src/addons/mod/data/components/index/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp
}

/**
* Opens add entries form.
* Opens add entry form.
*/
gotoAddEntries(): void {
gotoAddEntry(): void {
const params: Params = {
title: this.module.name,
group: this.selectedGroup,
Expand Down
2 changes: 1 addition & 1 deletion src/addons/mod/data/lang.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"actionsmenu": "Actions menu",
"addentries": "Add entries",
"add": "Add entry",
"advancedsearch": "Advanced search",
"alttext": "Alternative text",
"approve": "Approve",
Expand Down
20 changes: 10 additions & 10 deletions src/addons/mod/data/tests/behat/entries.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Feature: Users can manage entries in database activities
Scenario: Create entry
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
Then I should find "No entries yet" in the app
When I press "Add entries" in the app
When I press "Add entry" in the app
And I set the following fields to these values in the app:
| URL | https://moodle.org/ |
| Description | Moodle community site |
Expand All @@ -48,13 +48,13 @@ Feature: Users can manage entries in database activities
And I entered the data activity "Web links" on course "Course 1" as "student1" in the app

# TODO Create and use a generator for database entries.
When I press "Add entries" in the app
When I press "Add entry" in the app
And I set the following fields to these values in the app:
| URL | https://moodle.org/ |
| Description | Moodle community site |
And I press "Save" near "Web links" in the app
And I entered the data activity "Web links" on course "Course 1" as "student2" in the app
And I press "Add entries" in the app
And I press "Add entry" in the app
And I set the following fields to these values in the app:
| URL | https://moodlecloud.com/ |
| Description | Moodle Cloud |
Expand All @@ -80,7 +80,7 @@ Feature: Users can manage entries in database activities
And I should find "Moodle Cloud" in the app

Given I entered the data activity "Data with comments" on course "Course 1" as "student1" in the app
When I press "Add entries" in the app
When I press "Add entry" in the app
And I set the following fields to these values in the app:
| Description | Moodle community site |
And I press "Save" near "Data with comments" in the app
Expand All @@ -102,7 +102,7 @@ Feature: Users can manage entries in database activities

Scenario: Students can not edit or delete other user's entries from list and single view in the app
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
And I press "Add entries" in the app
And I press "Add entry" in the app
And I set the following fields to these values in the app:
| URL | https://moodle.org/ |
| Description | Moodle community site |
Expand All @@ -119,7 +119,7 @@ Feature: Users can manage entries in database activities

Scenario: Delete entry (student) & Update entry (student)
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
And I press "Add entries" in the app
And I press "Add entry" in the app
And I set the following fields to these values in the app:
| URL | https://moodle.org/ |
| Description | Moodle community site |
Expand Down Expand Up @@ -150,7 +150,7 @@ Feature: Users can manage entries in database activities
And I should not find "Moodle Cloud" in the app

# Repeat again with single view.
Given I press "Add entries" in the app
Given I press "Add entry" in the app
And I set the following fields to these values in the app:
| URL | https://moodle.org/ |
| Description | Moodle community site |
Expand Down Expand Up @@ -185,12 +185,12 @@ Feature: Users can manage entries in database activities

Scenario: Delete entry (teacher) & Update entry (teacher)
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
And I press "Add entries" in the app
And I press "Add entry" in the app
And I set the following fields to these values in the app:
| URL | https://moodle.org/ |
| Description | Moodle community site |
And I press "Save" near "Web links" in the app
And I press "Add entries" in the app
And I press "Add entry" in the app
And I set the following fields to these values in the app:
| URL | https://telegram.org/ |
| Description | Telegram |
Expand Down Expand Up @@ -261,7 +261,7 @@ Feature: Users can manage entries in database activities
| database | type | name | description |
| data2 | number | Number | Number value |
And I entered the data activity "Number DB" on course "Course 1" as "student1" in the app
When I press "Add entries" in the app
When I press "Add entry" in the app
And I press "Save" near "Number DB" in the app
Then I should find "You did not fill out any fields!" in the app

Expand Down
6 changes: 3 additions & 3 deletions src/addons/mod/data/tests/behat/sync.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Feature: Users can store entries in database activities when offline and sync wh
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
And I switch network connection to offline
And I should find "No entries yet" in the app
When I press "Add entries" in the app
When I press "Add entry" in the app
And I set the following fields to these values in the app:
| URL | https://moodle.org/ |
| Description | Moodle community site |
Expand All @@ -49,7 +49,7 @@ Feature: Users can store entries in database activities when offline and sync wh
Scenario: Update entry (offline) & Delete entry (offline)
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
And I should find "No entries yet" in the app
And I press "Add entries" in the app
And I press "Add entry" in the app
And I set the following fields to these values in the app:
| URL | https://moodle.org/ |
| Description | Moodle community site |
Expand Down Expand Up @@ -101,7 +101,7 @@ Feature: Users can store entries in database activities when offline and sync wh
Scenario: Students can undo deleting entries to a database in the app while offline
Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app
And I should find "No entries yet" in the app
And I press "Add entries" in the app
And I press "Add entry" in the app
And I set the following fields to these values in the app:
| URL | https://moodle.org/ |
| Description | Moodle community site |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</ng-container>
</div>
<ion-icon *ngIf="question.input.correctIcon" class="core-correct-icon ion-align-self-center" slot="end"
[name]="question.input.correctIcon" [color]="[question.input.correctIconColor]" />
[name]="question.input.correctIcon" [color]="[question.input.correctIconColor]" [ariaLabel]="question.input.correctIconLabel" />
</ion-item>

<!-- Display unit options after the answer input. -->
Expand Down
6 changes: 3 additions & 3 deletions src/addons/qtype/ordering/component/addon-qtype-ordering.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

@if (dragDisabled) {
@if (item.correctClass === 'correct') {
<ion-icon name="fas-check" slot="start" />
<ion-icon name="fas-check-double" slot="start" [ariaLabel]="'core.question.correct' | translate" color="success" />
} @else if (item.correctClass === 'incorrect') {
<ion-icon name="fas-xmark" slot="start" />
<ion-icon name="fas-xmark" slot="start" [ariaLabel]="'core.question.incorrect' | translate" color="danger" />
} @else if (item.correctClass.startsWith('partial')) {
<ion-icon name="far-square-check" slot="start" />
<ion-icon name="fas-check" slot="start" [ariaLabel]="'core.question.partiallycorrect' | translate" color="warning" />
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/addons/qtype/ordering/component/ordering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ export class AddonQtypeOrderingComponent extends CoreQuestionBaseComponent<Addon
this.question.items = itemsElements.map(element => {
// Remove correctness icons from the content.
const itemContentEl = element.querySelector<HTMLElement>('[data-itemcontent]');
itemContentEl?.querySelector('.icon.fa-check, .icon.fa-remove, .icon.fa-check-square')?.remove();
itemContentEl?.querySelector(
'.icon.fa-check, .icon.fa-remove, .icon.fa-check-square, .icon.fa-check-double, .icon.fa-xmark',
)?.remove();

return {
id: element.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
[attr.name]="question.input.name" [value]="question.input.value" autocorrect="off" [disabled]="question.input.readOnly"
[label]="'addon.mod_quiz.answercolon' | translate" />
<ion-icon *ngIf="question.input.correctIcon" class="core-correct-icon" slot="end" [name]="question.input.correctIcon"
[color]="[question.input.correctIconColor]" />
[color]="[question.input.correctIconColor]" [ariaLabel]="question.input.correctIconLabel" />
</ion-item>
</ion-list>
4 changes: 2 additions & 2 deletions src/core/features/comments/tests/behat/basic_usage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Feature: Test basic usage of comments in app
Scenario: Add comments & Delete comments (database)
# Create database entry and comment as a teacher
Given I entered the data activity "Data" on course "Course 1" as "teacher1" in the app
And I press "Add entries" in the app
And I press "Add entry" in the app
And I set the field "Test field name" to "Test" in the app
And I press "Save" in the app
And I press "Actions menu" in the app
Expand Down Expand Up @@ -69,7 +69,7 @@ Feature: Test basic usage of comments in app

Scenario: Add comments offline & Delete comments offline & Sync comments (database)
Given I entered the data activity "Data" on course "Course 1" as "teacher1" in the app
And I press "Add entries" in the app
And I press "Add entry" in the app
And I set the field "Test field name" to "Test" in the app
And I press "Save" in the app
And I press "Actions menu" in the app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h1>{{ 'core.fileuploader.audiotitle' | translate }}</h1>
<div class="core-audio-recorder--control">
<ion-button shape="round" fill="clear" [ariaLabel]="'core.fileuploader.stoprecording' | translate"
(click)="stopRecording()">
<ion-icon slot="icon-only" name="fa-check" />
<ion-icon slot="icon-only" name="fas-check" aria-hidden="true" />
</ion-button>
</div>
</div>
Expand Down
15 changes: 12 additions & 3 deletions src/core/features/grades/services/grades-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,17 +553,26 @@ export class CoreGradesHelperProvider {
row.itemtype = 'agg_sum';
row.icon = 'moodle-agg-sum';
row.iconAlt = Translate.instant('core.grades.aggregatesum');
} else if (text.indexOf('/outcomes') > -1 || text.indexOf('fa-tasks') > -1 || text.indexOf('fa-list-check') > -1) {
} else if (
text.indexOf('/outcomes') > -1 ||
text.indexOf('fa-tasks') > -1 ||
text.indexOf('fa-list-check') > -1
) {
row.itemtype = 'outcome';
row.icon = 'fas-list-check';
row.iconAlt = Translate.instant('core.grades.outcome');
} else if (text.indexOf('i/folder') > -1 || text.indexOf('fa-folder') > -1 || text.indexOf('category-content') > -1) {
row.itemtype = 'category';
row.icon = 'fas-folder';
row.iconAlt = Translate.instant('core.grades.category');
} else if (text.indexOf('/manual_item') > -1 || text.indexOf('fa-square-o') > -1) {
} else if (
text.indexOf('/manual_item') > -1 ||
text.indexOf('fa-square-o') > -1 ||
text.indexOf('fa-pencil-square-o') > -1 ||
text.indexOf('fa-pen-to-square') > -1
) {
row.itemtype = 'manual';
row.icon = 'far-square';
row.icon = 'fas-pen-to-square';
row.iconAlt = Translate.instant('core.grades.manualitem');
} else if (text.indexOf('/calc') > -1 || text.indexOf('fa-calculator') > -1) {
row.itemtype = 'calc';
Expand Down
2 changes: 1 addition & 1 deletion src/core/features/mainmenu/services/mainmenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class CoreMainMenuProvider {
const id = url + '#' + type;
if (!icon) {
// Icon not defined, use default one.
icon = type == 'embedded' ? 'fa-expand' : 'fa-link'; // @todo Find a better icon for embedded.
icon = type == 'embedded' ? 'fas-expand' : 'fas-link'; // @todo Find a better icon for embedded.
}

if (!map[id]) {
Expand Down
9 changes: 7 additions & 2 deletions src/core/features/question/classes/base-question-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,18 +494,22 @@ export class CoreQuestionBaseComponent<T extends AddonModQuizQuestion = AddonMod
question.input.correctClass = 'core-question-incorrect';
question.input.correctIcon = 'fas-xmark';
question.input.correctIconColor = CoreIonicColorNames.DANGER;
question.input.correctIconLabel = 'core.question.incorrect';
} else if (input.classList.contains('correct')) {
question.input.correctClass = 'core-question-correct';
question.input.correctIcon = 'fas-check';
question.input.correctIcon = 'fas-check-double';
question.input.correctIconColor = CoreIonicColorNames.SUCCESS;
question.input.correctIconLabel = 'core.question.correct';
} else if (input.classList.contains('partiallycorrect')) {
question.input.correctClass = 'core-question-partiallycorrect';
question.input.correctIcon = 'fas-square-check';
question.input.correctIcon = 'fas-check';
question.input.correctIconColor = CoreIonicColorNames.WARNING;
question.input.correctIconLabel = 'core.question.partiallycorrect';
} else {
question.input.correctClass = '';
question.input.correctIcon = '';
question.input.correctIconColor = '';
question.input.correctIconLabel = '';
}

if (question.input.isInline) {
Expand Down Expand Up @@ -829,6 +833,7 @@ export type AddonModQuizQuestionTextInput = {
correctClass?: string;
correctIcon?: string;
correctIconColor?: string;
correctIconLabel?: string;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class CoreSearchGlobalSearchResultComponent implements OnChanges {
*/
private computeRenderedIcon(): string | null {
return this.result.module?.name === 'forum' && this.result.module.area === 'post'
? 'fa-message'
? 'fas-message'
: null;
}

Expand Down