Show only title translations on article images + audio resourcetype + Nom to Identifiant
This commit is contained in:
parent
0f4fd94735
commit
ddda68c911
@ -148,7 +148,9 @@ class _ArticleConfigState extends State<ArticleConfig> {
|
||||
articleToSend.qrCode = articleDTO.qrCode;
|
||||
widget.onChanged(jsonEncode(articleToSend).toString());
|
||||
});
|
||||
}
|
||||
},
|
||||
true, // don't show titles
|
||||
false // show description
|
||||
);
|
||||
},
|
||||
),
|
||||
@ -168,7 +170,7 @@ class _ArticleConfigState extends State<ArticleConfig> {
|
||||
right: 15,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
var result = await showNewOrUpdateImageSlider(null, appContext, context, false, false);
|
||||
var result = await showNewOrUpdateImageSlider(null, appContext, context, false, true);
|
||||
if (result != null)
|
||||
{
|
||||
setState(() {
|
||||
|
||||
@ -11,13 +11,17 @@ class ListViewCardImage extends StatefulWidget {
|
||||
final List<ImageDTO> listItems;
|
||||
final AppContext appContext;
|
||||
final ValueChanged<List<ImageDTO>> onChanged;
|
||||
final bool showTitleTranslations;
|
||||
final bool showDescriptionTranslations;
|
||||
|
||||
ListViewCardImage(
|
||||
this.listItems,
|
||||
this.index,
|
||||
this.key,
|
||||
this.appContext,
|
||||
this.onChanged
|
||||
this.onChanged,
|
||||
this.showTitleTranslations,
|
||||
this.showDescriptionTranslations
|
||||
);
|
||||
|
||||
@override
|
||||
@ -78,8 +82,8 @@ class _ListViewCard extends State<ListViewCardImage> {
|
||||
widget.listItems[widget.index],
|
||||
widget.appContext,
|
||||
context,
|
||||
true,
|
||||
true
|
||||
widget.showTitleTranslations,
|
||||
widget.showDescriptionTranslations
|
||||
);
|
||||
|
||||
if (result != null) {
|
||||
|
||||
@ -89,7 +89,9 @@ class _SliderConfigState extends State<SliderConfig> {
|
||||
sliderToSend.images = testToSend;
|
||||
widget.onChanged(jsonEncode(sliderToSend).toString());
|
||||
});
|
||||
}
|
||||
},
|
||||
true, // show titles
|
||||
true // show descriptions
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@ -162,7 +162,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
StringInputContainer(
|
||||
label: "Nom :",
|
||||
label: "Identifiant :",
|
||||
initialValue: sectionDTO != null ? sectionDTO.label : "",
|
||||
onChanged: (value) {
|
||||
sectionDTO.label = value;
|
||||
|
||||
@ -164,7 +164,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
StringInputContainer(
|
||||
label: "Nom :",
|
||||
label: "Identifiant :",
|
||||
fontSize: 20,
|
||||
initialValue: configurationDTO.label,
|
||||
onChanged: (value) {
|
||||
|
||||
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:manager_app/Components/fetch_resource_icon.dart';
|
||||
import 'package:manager_app/Components/multi_select_container.dart';
|
||||
import 'package:manager_app/Components/string_input_container.dart';
|
||||
import 'package:manager_app/Models/managerContext.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
import 'package:managerapi/api.dart';
|
||||
@ -234,10 +233,10 @@ boxDecoration(dynamic resourceDetailDTO, appContext) {
|
||||
}
|
||||
|
||||
|
||||
Future<List<ResourceDTO>> getResources(Function onGetResult, bool isImage, AppContext appContext) async {
|
||||
/*Future<List<ResourceDTO>> getResources(Function onGetResult, bool isImage, AppContext appContext) async {
|
||||
List<ResourceDTO> resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId:(appContext.getContext() as ManagerAppContext).instanceId);
|
||||
if (onGetResult != null && isImage) {
|
||||
resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl).toList();
|
||||
}
|
||||
return resources;
|
||||
}
|
||||
}*/
|
||||
|
||||
@ -42,6 +42,7 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
|
||||
future: getResources(widget.onGetResult, widget.isImage, appContext),
|
||||
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
if(snapshot.data != null) {
|
||||
var tempOutput = new List<ResourceDTO>.from(snapshot.data);
|
||||
// tempOutput.add(ResourceDTO(id: null));
|
||||
return ResourceBodyGrid(resources: tempOutput, isImage: widget.isImage, isAddButton: widget.isAddButton, onSelect: (value) async {
|
||||
@ -62,6 +63,9 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
|
||||
widget.onGetResult(value);
|
||||
}
|
||||
},);//bodyGrid(tempOutput, size, appContext);
|
||||
} else {
|
||||
return Text("No data");
|
||||
}
|
||||
} else if (snapshot.connectionState == ConnectionState.none) {
|
||||
return Text("No data");
|
||||
} else {
|
||||
@ -80,7 +84,7 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
|
||||
Future<void> getResources(Function onGetResult, bool isImage, AppContext appContext) async {
|
||||
List<ResourceDTO> resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId: (appContext.getContext() as ManagerAppContext).instanceId);
|
||||
if (onGetResult != null && isImage) {
|
||||
resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl).toList();
|
||||
resources = resources.where((element) => element.type == ResourceType.image || element.type == ResourceType.imageUrl || element.type == ResourceType.audio).toList();
|
||||
}
|
||||
return resources;
|
||||
}
|
||||
@ -128,7 +132,7 @@ Future<ResourceDTO> create(ResourceDTO resourceDTO, List<File> files, List<Platf
|
||||
showNotification(Colors.green, kWhite, 'La ressource a été créée avec succès', context, null);
|
||||
return null;
|
||||
} else {
|
||||
showNotification(kPrimaryColor, kWhite, 'Une erreur est survenue lors de la création de la ressource', context, null);
|
||||
showNotification(kPrimaryColor, kWhite, 'Erreur, attention, la taille de la ressource doit être inférieure à 2Mb', context, null);
|
||||
}
|
||||
break;
|
||||
case ResourceType.imageUrl:
|
||||
|
||||
@ -26,6 +26,7 @@ class ResourceType {
|
||||
static const video = ResourceType._(r'Video');
|
||||
static const imageUrl = ResourceType._(r'ImageUrl');
|
||||
static const videoUrl = ResourceType._(r'VideoUrl');
|
||||
static const audio = ResourceType._(r'Audio');
|
||||
|
||||
/// List of all possible values in this [enum][ResourceType].
|
||||
static const values = <ResourceType>[
|
||||
@ -33,6 +34,7 @@ class ResourceType {
|
||||
video,
|
||||
imageUrl,
|
||||
videoUrl,
|
||||
audio
|
||||
];
|
||||
|
||||
static ResourceType fromJson(dynamic value) =>
|
||||
@ -69,6 +71,7 @@ class ResourceTypeTypeTransformer {
|
||||
case r'Video': return ResourceType.video;
|
||||
case r'ImageUrl': return ResourceType.imageUrl;
|
||||
case r'VideoUrl': return ResourceType.videoUrl;
|
||||
case r'Audio': return ResourceType.audio;
|
||||
default:
|
||||
if (allowNull == false) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user