MOBILE-3814 ux: Improve storage manager strings

main
Pau Ferrer Ocaña 2022-02-11 12:23:21 +01:00
parent bb28a899bd
commit b5c0275a44
18 changed files with 129 additions and 114 deletions

View File

@ -1104,14 +1104,19 @@
"addon.report_insights.notapplicable": "analytics", "addon.report_insights.notapplicable": "analytics",
"addon.report_insights.notuseful": "analytics", "addon.report_insights.notuseful": "analytics",
"addon.report_insights.useful": "analytics", "addon.report_insights.useful": "analytics",
"addon.storagemanager.alldata": "tool_wp",
"addon.storagemanager.confirmdeleteallsitedata": "local_moodlemobileapp",
"addon.storagemanager.confirmdeletecourses": "local_moodlemobileapp",
"addon.storagemanager.confirmdeletedatafrom": "local_moodlemobileapp",
"addon.storagemanager.coursedownloads": "local_moodlemobileapp", "addon.storagemanager.coursedownloads": "local_moodlemobileapp",
"addon.storagemanager.courseinfo": "local_moodlemobileapp", "addon.storagemanager.courseinfo": "local_moodlemobileapp",
"addon.storagemanager.coursesspaceusage": "local_moodlemobileapp", "addon.storagemanager.deleteallsitedata": "local_moodlemobileapp",
"addon.storagemanager.deletecourse": "local_moodlemobileapp", "addon.storagemanager.deleteallsitedatainfo": "local_moodlemobileapp",
"addon.storagemanager.deletecourses": "local_moodlemobileapp", "addon.storagemanager.deletecourses": "local_moodlemobileapp",
"addon.storagemanager.deletedata": "local_moodlemobileapp", "addon.storagemanager.deletedata": "local_moodlemobileapp",
"addon.storagemanager.deletedatafrom": "local_moodlemobileapp", "addon.storagemanager.deletedatafrom": "local_moodlemobileapp",
"addon.storagemanager.downloadedcourses": "local_moodlemobileapp", "addon.storagemanager.downloadedcourses": "local_moodlemobileapp",
"addon.storagemanager.errordeletedownloadeddata": "local_moodlemobileapp",
"addon.storagemanager.managedownloads": "local_moodlemobileapp", "addon.storagemanager.managedownloads": "local_moodlemobileapp",
"addon.storagemanager.totaldownloads": "local_moodlemobileapp", "addon.storagemanager.totaldownloads": "local_moodlemobileapp",
"addon.storagemanager.totalspaceusage": "local_moodlemobileapp", "addon.storagemanager.totalspaceusage": "local_moodlemobileapp",
@ -1531,8 +1536,6 @@
"core.course.completion_setby:manual:done": "course", "core.course.completion_setby:manual:done": "course",
"core.course.completion_setby:manual:markdone": "course", "core.course.completion_setby:manual:markdone": "course",
"core.course.completionrequirements": "course", "core.course.completionrequirements": "course",
"core.course.confirmdeletemodulefiles": "local_moodlemobileapp",
"core.course.confirmdeletestoreddata": "local_moodlemobileapp",
"core.course.confirmdownload": "local_moodlemobileapp", "core.course.confirmdownload": "local_moodlemobileapp",
"core.course.confirmdownloadunknownsize": "local_moodlemobileapp", "core.course.confirmdownloadunknownsize": "local_moodlemobileapp",
"core.course.confirmdownloadzerosize": "local_moodlemobileapp", "core.course.confirmdownloadzerosize": "local_moodlemobileapp",
@ -2161,8 +2164,6 @@
"core.settings.currentlanguage": "moodle", "core.settings.currentlanguage": "moodle",
"core.settings.debugdisplay": "admin", "core.settings.debugdisplay": "admin",
"core.settings.debugdisplaydescription": "local_moodlemobileapp", "core.settings.debugdisplaydescription": "local_moodlemobileapp",
"core.settings.deletesitefiles": "local_moodlemobileapp",
"core.settings.deletesitefilestitle": "local_moodlemobileapp",
"core.settings.developeroptions": "local_moodlemobileapp", "core.settings.developeroptions": "local_moodlemobileapp",
"core.settings.deviceinfo": "local_moodlemobileapp", "core.settings.deviceinfo": "local_moodlemobileapp",
"core.settings.deviceos": "local_moodlemobileapp", "core.settings.deviceos": "local_moodlemobileapp",
@ -2178,7 +2179,6 @@
"core.settings.enablerichtexteditordescription": "local_moodlemobileapp", "core.settings.enablerichtexteditordescription": "local_moodlemobileapp",
"core.settings.enablesyncwifi": "local_moodlemobileapp", "core.settings.enablesyncwifi": "local_moodlemobileapp",
"core.settings.entriesincache": "local_moodlemobileapp", "core.settings.entriesincache": "local_moodlemobileapp",
"core.settings.errordeletesitefiles": "local_moodlemobileapp",
"core.settings.errorsyncsite": "local_moodlemobileapp", "core.settings.errorsyncsite": "local_moodlemobileapp",
"core.settings.estimatedfreespace": "local_moodlemobileapp", "core.settings.estimatedfreespace": "local_moodlemobileapp",
"core.settings.filesystemroot": "local_moodlemobileapp", "core.settings.filesystemroot": "local_moodlemobileapp",
@ -2215,7 +2215,6 @@
"core.settings.siteplugins": "local_moodlemobileapp", "core.settings.siteplugins": "local_moodlemobileapp",
"core.settings.sites": "moodle", "core.settings.sites": "moodle",
"core.settings.spaceusage": "local_moodlemobileapp", "core.settings.spaceusage": "local_moodlemobileapp",
"core.settings.spaceusagehelp": "local_moodlemobileapp",
"core.settings.synchronization": "local_moodlemobileapp", "core.settings.synchronization": "local_moodlemobileapp",
"core.settings.synchronizenow": "local_moodlemobileapp", "core.settings.synchronizenow": "local_moodlemobileapp",
"core.settings.synchronizenowhelp": "local_moodlemobileapp", "core.settings.synchronizenowhelp": "local_moodlemobileapp",
@ -2339,8 +2338,8 @@
"core.user.webpage": "moodle", "core.user.webpage": "moodle",
"core.userdeleted": "moodle", "core.userdeleted": "moodle",
"core.userdetails": "moodle", "core.userdetails": "moodle",
"core.usernotfullysetup": "error",
"core.usernologin": "local_moodlemobileapp", "core.usernologin": "local_moodlemobileapp",
"core.usernotfullysetup": "error",
"core.users": "moodle", "core.users": "moodle",
"core.usersuspended": "tool_reportbuilder", "core.usersuspended": "tool_reportbuilder",
"core.view": "moodle", "core.view": "moodle",

View File

@ -1,13 +1,18 @@
{ {
"deletedata": "Delete offline data", "alldata": "All data",
"deletecourse": "Delete offline data from this course", "confirmdeleteallsitedata": "Delete all site downloaded data?",
"deletecourses": "Delete offline data from all courses", "confirmdeletecourses": "Delete downloaded data from all courses?",
"deletedatafrom": "Delete offline data from {{name}}", "confirmdeletedatafrom": "Delete all downloaded data from '{{name}}'?",
"courseinfo": "Download course content to work offline. Your activity will sync automatically when your device is back online.",
"managedownloads": "Manage downloads",
"coursedownloads": "Course downloads", "coursedownloads": "Course downloads",
"courseinfo": "Download course content to work offline. Your activity will sync automatically when your device is back online.",
"deleteallsitedata": "Delete all site downloaded data",
"deleteallsitedatainfo": "This will delete all downloaded data from '{{name}}', including all downloaded courses and data that allows you to work offline.",
"deletecourses": "Delete downloaded data from all courses",
"deletedata": "Delete downloaded data",
"deletedatafrom": "Delete all downloaded data from '{{name}}'",
"downloadedcourses": "Downloaded courses",
"errordeletedownloadeddata": "Error deleting downloaded data.",
"managedownloads": "Manage downloads",
"totaldownloads": "Total downloads", "totaldownloads": "Total downloads",
"totalspaceusage": "Total space usage", "totalspaceusage": "Total space used"
"coursesspaceusage": "Courses space usage",
"downloadedcourses": "Downloaded courses"
} }

View File

@ -20,7 +20,8 @@
<ion-badge color="light">{{ totalSize | coreBytesToSize }}</ion-badge> <ion-badge color="light">{{ totalSize | coreBytesToSize }}</ion-badge>
</ion-label> </ion-label>
<ion-button slot="end" (click)="deleteForCourse()" [disabled]="totalSize == 0" color="danger" fill="outline"> <ion-button slot="end" (click)="deleteForCourse()" [disabled]="totalSize == 0" color="danger" fill="outline">
<ion-icon name="fas-trash" slot="icon-only" [attr.aria-label]="'addon.storagemanager.deletecourse' | translate"> <ion-icon name="fas-trash" slot="icon-only" [attr.aria-label]="'addon.storagemanager.deletedatafrom' | translate:
{ name: title }">
</ion-icon> </ion-icon>
</ion-button> </ion-button>
</ion-item> </ion-item>

View File

@ -282,7 +282,10 @@ export class AddonStorageManagerCourseStoragePage implements OnInit, OnDestroy {
*/ */
async deleteForCourse(): Promise<void> { async deleteForCourse(): Promise<void> {
try { try {
await CoreDomUtils.showDeleteConfirm('core.course.confirmdeletestoreddata'); await CoreDomUtils.showDeleteConfirm(
'addon.storagemanager.confirmdeletedatafrom',
{ name: this.title },
);
} catch (error) { } catch (error) {
if (!CoreDomUtils.isCanceledError(error)) { if (!CoreDomUtils.isCanceledError(error)) {
throw error; throw error;
@ -312,7 +315,10 @@ export class AddonStorageManagerCourseStoragePage implements OnInit, OnDestroy {
*/ */
async deleteForSection(section: AddonStorageManagerCourseSection): Promise<void> { async deleteForSection(section: AddonStorageManagerCourseSection): Promise<void> {
try { try {
await CoreDomUtils.showDeleteConfirm('core.course.confirmdeletestoreddata'); await CoreDomUtils.showDeleteConfirm(
'addon.storagemanager.confirmdeletedatafrom',
{ name: section.name },
);
} catch (error) { } catch (error) {
if (!CoreDomUtils.isCanceledError(error)) { if (!CoreDomUtils.isCanceledError(error)) {
throw error; throw error;
@ -343,7 +349,10 @@ export class AddonStorageManagerCourseStoragePage implements OnInit, OnDestroy {
} }
try { try {
await CoreDomUtils.showDeleteConfirm('core.course.confirmdeletestoreddata'); await CoreDomUtils.showDeleteConfirm(
'addon.storagemanager.confirmdeletedatafrom',
{ name: module.name },
);
} catch (error) { } catch (error) {
if (!CoreDomUtils.isCanceledError(error)) { if (!CoreDomUtils.isCanceledError(error)) {
throw error; throw error;
@ -363,7 +372,7 @@ export class AddonStorageManagerCourseStoragePage implements OnInit, OnDestroy {
* @return Promise<void> Once deleting has finished * @return Promise<void> Once deleting has finished
*/ */
protected async deleteModules(modules: AddonStorageManagerModule[], section?: AddonStorageManagerCourseSection): Promise<void> { protected async deleteModules(modules: AddonStorageManagerModule[], section?: AddonStorageManagerCourseSection): Promise<void> {
const modal = await CoreDomUtils.showModalLoading(); const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
const promises: Promise<void>[] = []; const promises: Promise<void>[] = [];
modules.forEach((module) => { modules.forEach((module) => {

View File

@ -10,25 +10,30 @@
</ion-header> </ion-header>
<ion-content> <ion-content>
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<div class="ion-padding-horizontal ion-text-wrap" *ngIf="downloadedCourses.length">
<h2>{{ 'addon.storagemanager.alldata' | translate }}</h2>
</div>
<ion-card> <ion-card>
<ion-item class="ion-text-wrap" *ngIf="spaceUsage"> <ion-item class="ion-text-wrap total" *ngIf="spaceUsage">
<ion-label> <ion-label>
<p class="item-heading ion-text-wrap">{{ 'addon.storagemanager.totalspaceusage' | translate }}</p> <p class="item-heading ion-text-wrap">{{ 'addon.storagemanager.totalspaceusage' | translate }}</p>
<ion-badge color="light" *ngIf="spaceUsage.spaceUsage">{{ spaceUsage.spaceUsage | coreBytesToSize }}</ion-badge> <ion-badge color="light" *ngIf="spaceUsage.spaceUsage">{{ spaceUsage.spaceUsage | coreBytesToSize }}</ion-badge>
<p>
{{ 'core.settings.spaceusagehelp' | translate }}
</p>
</ion-label> </ion-label>
<ion-button fill="clear" color="danger" slot="end" (click)="deleteSiteStorage($event)" <ion-button fill="clear" color="danger" slot="end" (click)="deleteSiteStorage($event)"
[hidden]="spaceUsage.spaceUsage! + spaceUsage.cacheEntries! <= 0" [hidden]="spaceUsage.spaceUsage! + spaceUsage.cacheEntries! <= 0"
[attr.aria-label]="'core.settings.deletesitefilestitle' | translate" fill="outline"> [attr.aria-label]="'addon.storagemanager.deleteallsitedata' | translate" fill="outline">
<ion-icon name="fas-trash" slot="icon-only" aria-hidden="true"></ion-icon> <ion-icon name="fas-trash" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button> </ion-button>
</ion-item> </ion-item>
<ion-item class="size ion-text-wrap"> </ion-card>
<div class="ion-padding-horizontal ion-text-wrap" *ngIf="downloadedCourses.length">
<h2>{{ 'addon.storagemanager.downloadedcourses' | translate }}</h2>
</div>
<ion-card>
<ion-item class="size courses ion-text-wrap" lines="full">
<ion-label> <ion-label>
<h2 class="ion-text-wrap">{{ 'addon.storagemanager.coursesspaceusage' | translate }}</h2> <p class="item-heading">{{ 'addon.storagemanager.totalspaceusage' | translate }}</p>
<ion-badge color="light">{{ totalSize | coreBytesToSize }}</ion-badge> <ion-badge color="light">{{ totalSize | coreBytesToSize }}</ion-badge>
</ion-label> </ion-label>
<ion-button slot="end" (click)="deleteCompletelyDownloadedCourses($event)" <ion-button slot="end" (click)="deleteCompletelyDownloadedCourses($event)"
@ -37,33 +42,22 @@
</ion-icon> </ion-icon>
</ion-button> </ion-button>
</ion-item> </ion-item>
</ion-card> <ion-item *ngFor="let course of downloadedCourses" class="course" (click)="openCourse(course.id, course.title)" button>
<ion-label class="ion-text-wrap">
<div class="ion-padding-horizontal ion-text-wrap" *ngIf="downloadedCourses.length"> <p class="item-heading">{{ course.title }}</p>
<h2>{{ 'addon.storagemanager.downloadedcourses' | translate }}</h2> <p class="item-heading item-heading-secondary" *ngIf="course.isDownloading">
</div> {{ 'core.downloading' | translate }}
<ion-card *ngIf="downloadedCourses.length"> </p>
<ion-card-content class="ion-no-padding"> <ion-badge color="light">
<ion-list> {{ course.totalSize | coreBytesToSize }}
<ion-item *ngFor="let course of downloadedCourses" class="course" (click)="openCourse(course.id, course.title)" button> </ion-badge>
<ion-label class="ion-text-wrap"> </ion-label>
<p class="item-heading">{{ course.title }}</p> <ion-button slot="end" (click)="deleteCourse($event, course)" [disabled]="course.isDownloading" color="danger" fill="clear">
<p class="item-heading item-heading-secondary" *ngIf="course.isDownloading"> <ion-icon name="fas-trash" slot="icon-only" [attr.aria-label]="'addon.storagemanager.deletedatafrom' | translate:
{{ 'core.downloading' | translate }} { name: course.title }">
</p> </ion-icon>
<ion-badge color="light"> </ion-button>
{{ course.totalSize | coreBytesToSize }} </ion-item>
</ion-badge>
</ion-label>
<ion-button slot="end" (click)="deleteCourse($event, course)" [disabled]="course.isDownloading" color="danger"
fill="clear">
<ion-icon name="fas-trash" slot="icon-only"
[attr.aria-label]="'addon.storagemanager.deletedatafrom' | translate: { name: course.displayname }">
</ion-icon>
</ion-button>
</ion-item>
</ion-list>
</ion-card-content>
</ion-card> </ion-card>
</core-loading> </core-loading>
</ion-content> </ion-content>

View File

@ -1,10 +1,6 @@
@import "~theme/globals"; ion-item.courses,
ion-item.total {
:host { .item-heading {
ion-item.course { font-weight: bold;
.item-heading {
font-weight: bold;
}
} }
} }

View File

@ -111,7 +111,7 @@ export class AddonStorageManagerCoursesStoragePage implements OnInit, OnDestroy
event.stopPropagation(); event.stopPropagation();
try { try {
await CoreDomUtils.showDeleteConfirm('core.course.confirmdeletestoreddata'); await CoreDomUtils.showDeleteConfirm('addon.storagemanager.confirmdeletecourses');
} catch (error) { } catch (error) {
if (!CoreDomUtils.isCanceledError(error)) { if (!CoreDomUtils.isCanceledError(error)) {
throw error; throw error;
@ -120,7 +120,7 @@ export class AddonStorageManagerCoursesStoragePage implements OnInit, OnDestroy
return; return;
} }
const modal = await CoreDomUtils.showModalLoading(); const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
const deletedCourseIds = this.completelyDownloadedCourses.map((course) => course.id); const deletedCourseIds = this.completelyDownloadedCourses.map((course) => course.id);
try { try {
@ -145,7 +145,10 @@ export class AddonStorageManagerCoursesStoragePage implements OnInit, OnDestroy
event.stopPropagation(); event.stopPropagation();
try { try {
await CoreDomUtils.showDeleteConfirm('core.course.confirmdeletestoreddata'); await CoreDomUtils.showDeleteConfirm(
'addon.storagemanager.confirmdeletedatafrom',
{ name: course.title },
);
} catch (error) { } catch (error) {
if (!CoreDomUtils.isCanceledError(error)) { if (!CoreDomUtils.isCanceledError(error)) {
throw error; throw error;
@ -154,7 +157,7 @@ export class AddonStorageManagerCoursesStoragePage implements OnInit, OnDestroy
return; return;
} }
const modal = await CoreDomUtils.showModalLoading(); const modal = await CoreDomUtils.showModalLoading('core.deleting', true);
try { try {
await CoreCourseHelper.deleteCourseFiles(course.id); await CoreCourseHelper.deleteCourseFiles(course.id);

View File

@ -19,8 +19,6 @@
"completion_setby:manual:done": "{{$a.activityname}} is marked by {{$a.setby}} as done. Press to undo.", "completion_setby:manual:done": "{{$a.activityname}} is marked by {{$a.setby}} as done. Press to undo.",
"completion_setby:manual:markdone": "{{$a.activityname}} is marked by {{$a.setby}} as not done. Press to mark as done.", "completion_setby:manual:markdone": "{{$a.activityname}} is marked by {{$a.setby}} as not done. Press to mark as done.",
"completionrequirements": "Completion requirements for {{$a}}", "completionrequirements": "Completion requirements for {{$a}}",
"confirmdeletemodulefiles": "Are you sure you want to delete these files?",
"confirmdeletestoreddata": "Are you sure you want to delete the stored data?",
"confirmdownload": "You are about to download {{size}}.{{availableSpace}} Are you sure you want to continue?", "confirmdownload": "You are about to download {{size}}.{{availableSpace}} Are you sure you want to continue?",
"confirmdownloadunknownsize": "It was not possible to calculate the size of the download.{{availableSpace}} Are you sure you want to continue?", "confirmdownloadunknownsize": "It was not possible to calculate the size of the download.{{availableSpace}} Are you sure you want to continue?",
"confirmdownloadzerosize": "You are about to start downloading.{{availableSpace}} Are you sure you want to continue?", "confirmdownloadzerosize": "You are about to start downloading.{{availableSpace}} Are you sure you want to continue?",

View File

@ -499,7 +499,7 @@ export class CoreCourseHelperProvider {
try { try {
await CoreDomUtils.showDeleteConfirm('core.course.confirmdeletestoreddata'); await CoreDomUtils.showDeleteConfirm('addon.storagemanager.confirmdeletedatafrom', { name: module.name });
modal = await CoreDomUtils.showModalLoading(); modal = await CoreDomUtils.showModalLoading();

View File

@ -259,7 +259,10 @@ export class CoreCoursesCourseListItemComponent implements OnInit, OnDestroy, On
*/ */
async deleteCourseStoredData(): Promise<void> { async deleteCourseStoredData(): Promise<void> {
try { try {
await CoreDomUtils.showDeleteConfirm('core.course.confirmdeletestoreddata'); await CoreDomUtils.showDeleteConfirm(
'addon.storagemanager.confirmdeletedatafrom',
{ name: this.course.displayname || this.course.fullname },
);
} catch (error) { } catch (error) {
if (!CoreDomUtils.isCanceledError(error)) { if (!CoreDomUtils.isCanceledError(error)) {
throw error; throw error;

View File

@ -175,7 +175,10 @@ export class CoreCoursesCourseProgressComponent implements OnInit, OnDestroy, On
*/ */
async deleteCourse(): Promise<void> { async deleteCourse(): Promise<void> {
try { try {
await CoreDomUtils.showDeleteConfirm('core.course.confirmdeletestoreddata'); await CoreDomUtils.showDeleteConfirm(
'addon.storagemanager.confirmdeletedatafrom',
{ name: this.course.displayname || this.course.fullname },
);
} catch (error) { } catch (error) {
if (!CoreDomUtils.isCanceledError(error)) { if (!CoreDomUtils.isCanceledError(error)) {
throw error; throw error;

View File

@ -21,8 +21,6 @@
"currentlanguage": "Current language", "currentlanguage": "Current language",
"debugdisplay": "Display debug messages", "debugdisplay": "Display debug messages",
"debugdisplaydescription": "If enabled, error modals will display more data about the error if possible.", "debugdisplaydescription": "If enabled, error modals will display more data about the error if possible.",
"deletesitefiles": "Are you sure that you want to delete the downloaded files and cached data from the site '{{sitename}}'? You won't be able to use the app in offline mode.",
"deletesitefilestitle": "Delete site files",
"developeroptions": "Developer options", "developeroptions": "Developer options",
"deviceinfo": "Device info", "deviceinfo": "Device info",
"deviceos": "Device OS", "deviceos": "Device OS",
@ -38,7 +36,6 @@
"enablerichtexteditordescription": "If enabled, a text editor will be available when entering content.", "enablerichtexteditordescription": "If enabled, a text editor will be available when entering content.",
"enablesyncwifi": "Allow sync only when on Wi-Fi", "enablesyncwifi": "Allow sync only when on Wi-Fi",
"entriesincache": "{{$a}} entries in cache", "entriesincache": "{{$a}} entries in cache",
"errordeletesitefiles": "Error deleting site files.",
"errorsyncsite": "Error synchronising site data. Please check your Internet connection and try again.", "errorsyncsite": "Error synchronising site data. Please check your Internet connection and try again.",
"estimatedfreespace": "Estimated free space", "estimatedfreespace": "Estimated free space",
"filesystemroot": "File system root", "filesystemroot": "File system root",
@ -75,7 +72,6 @@
"siteplugins": "Site plugins", "siteplugins": "Site plugins",
"sites": "Sites", "sites": "Sites",
"spaceusage": "Space usage", "spaceusage": "Space usage",
"spaceusagehelp": "Deleting the stored information of the site will remove all the site offline data. This information allows you to use the app when offline. ",
"synchronization": "Synchronisation", "synchronization": "Synchronisation",
"synchronizenow": "Synchronise now", "synchronizenow": "Synchronise now",
"synchronizenowhelp": "Synchronising a site will send pending changes and all offline activity stored in the device and will synchronise some data like messages and notifications.", "synchronizenowhelp": "Synchronising a site will send pending changes and all offline activity stored in the device and will synchronise some data like messages and notifications.",

View File

@ -8,9 +8,6 @@
</ion-title> </ion-title>
<ion-buttons slot="end"> <ion-buttons slot="end">
<core-navbar-buttons> <core-navbar-buttons>
<ion-button (click)="showInfo()" [attr.aria-label]="'core.info' | translate">
<ion-icon name="fas-info-circle" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button>
</core-navbar-buttons> </core-navbar-buttons>
</ion-buttons> </ion-buttons>
</ion-toolbar> </ion-toolbar>
@ -28,14 +25,13 @@
</p> </p>
<p class="ion-text-wrap">{{ site.fullName }}</p> <p class="ion-text-wrap">{{ site.fullName }}</p>
<p>{{ site.siteUrlWithoutProtocol }}</p> <p>{{ site.siteUrlWithoutProtocol }}</p>
<ion-badge color="light" *ngIf="site.spaceUsage !== undefined">{{ site.spaceUsage | coreBytesToSize }}</ion-badge>
</ion-label> </ion-label>
<p *ngIf="site.spaceUsage !== undefined" slot="end">
{{ site.spaceUsage | coreBytesToSize }}
</p>
<ion-button fill="clear" color="danger" slot="end" (click)="deleteSiteStorage(site)" <ion-button fill="clear" color="danger" slot="end" (click)="deleteSiteStorage(site)"
[hidden]="site.spaceUsage! + site.cacheEntries! <= 0" [hidden]="site.spaceUsage! + site.cacheEntries! <= 0">
[attr.aria-label]="'core.settings.deletesitefilestitle' | translate"> <ion-icon name="fas-trash" slot="icon-only"
<ion-icon name="fas-trash" slot="icon-only" aria-hidden="true"></ion-icon> [attr.aria-label]="'addon.storagemanager.deletedatafrom' | translate: { name: site.siteName }">
</ion-icon>
</ion-button> </ion-button>
</ion-item> </ion-item>
<ion-item-divider> <ion-item-divider>

View File

@ -16,8 +16,6 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { IonRefresher } from '@ionic/angular'; import { IonRefresher } from '@ionic/angular';
import { CoreSiteBasicInfo, CoreSites } from '@services/sites'; import { CoreSiteBasicInfo, CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { Translate } from '@singletons';
import { CoreEventObserver, CoreEvents } from '@singletons/events'; import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreSettingsHelper, CoreSiteSpaceUsage } from '../../services/settings-helper'; import { CoreSettingsHelper, CoreSiteSpaceUsage } from '../../services/settings-helper';
@ -129,16 +127,6 @@ export class CoreSettingsSpaceUsagePage implements OnInit, OnDestroy {
} }
} }
/**
* Show information about space usage actions.
*/
showInfo(): void {
CoreDomUtils.showAlert(
Translate.instant('core.help'),
Translate.instant('core.settings.spaceusagehelp'),
);
}
/** /**
* Page destroyed. * Page destroyed.
*/ */

View File

@ -116,10 +116,13 @@ export class CoreSettingsHelperProvider {
siteName = await CoreFilter.formatText(siteName, { clean: true, singleLine: true, filter: false }, [], siteId); siteName = await CoreFilter.formatText(siteName, { clean: true, singleLine: true, filter: false }, [], siteId);
const title = Translate.instant('core.settings.deletesitefilestitle'); const title = Translate.instant('addon.storagemanager.confirmdeleteallsitedata');
const message = Translate.instant('core.settings.deletesitefiles', { sitename: siteName });
await CoreDomUtils.showConfirm(message, title, Translate.instant('core.delete')); await CoreDomUtils.showDeleteConfirm(
'addon.storagemanager.deleteallsitedatainfo',
{ name: siteName },
{ header: title },
);
const site = await CoreSites.getSite(siteId); const site = await CoreSites.getSite(siteId);
@ -143,7 +146,7 @@ export class CoreSettingsHelperProvider {
siteInfo.spaceUsage = 0; siteInfo.spaceUsage = 0;
} else { } else {
// Error, recalculate the site usage. // Error, recalculate the site usage.
CoreDomUtils.showErrorModal('core.settings.errordeletesitefiles', true); CoreDomUtils.showErrorModal('addon.storagemanager.errordeletedownloadeddata', true);
siteInfo.spaceUsage = await site.getSpaceUsage(); siteInfo.spaceUsage = await site.getSpaceUsage();
} }

View File

@ -1269,15 +1269,34 @@ export class CoreDomUtilsProvider {
showDeleteConfirm( showDeleteConfirm(
translateMessage: string = 'core.areyousure', translateMessage: string = 'core.areyousure',
translateArgs: Record<string, unknown> = {}, translateArgs: Record<string, unknown> = {},
options?: AlertOptions, options: AlertOptions = {},
): Promise<void> { ): Promise<void> {
return this.showConfirm( return new Promise((resolve, reject): void => {
Translate.instant(translateMessage, translateArgs), options.message = Translate.instant(translateMessage, translateArgs);
undefined,
Translate.instant('core.delete'), options.buttons = [
undefined, {
options, text: Translate.instant('core.cancel'),
); role: 'cancel',
handler: () => {
reject(new CoreCanceledError(''));
},
},
{
text: Translate.instant('core.delete'),
role: 'destructive',
handler: () => {
resolve();
},
},
];
if (!options.header) {
options.cssClass = (options.cssClass || '') + ' core-nohead';
}
this.showAlertWithOptions(options, 0);
});
} }
/** /**

View File

@ -414,9 +414,10 @@ ion-alert {
overflow: auto; overflow: auto;
border-radius: var(--border-radius) !important; border-radius: var(--border-radius) !important;
button.alert-button { button.alert-button.alert-button-role-destructive {
color: var(--primary); color: var(--danger);
} }
} }
.alert-message { .alert-message {

View File

@ -69,6 +69,7 @@
--core-header-toolbar-background: var(--gray-900); --core-header-toolbar-background: var(--gray-900);
--core-header-toolbar-color: var(--white); --core-header-toolbar-color: var(--white);
--core-header-toolbar-border-color: var(--stroke);
--core-tabs-background: var(--gray-800); --core-tabs-background: var(--gray-800);
--core-tab-background: var(--core-tabs-background); --core-tab-background: var(--core-tabs-background);