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;
|
articleToSend.qrCode = articleDTO.qrCode;
|
||||||
widget.onChanged(jsonEncode(articleToSend).toString());
|
widget.onChanged(jsonEncode(articleToSend).toString());
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
true, // don't show titles
|
||||||
|
false // show description
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -168,7 +170,7 @@ class _ArticleConfigState extends State<ArticleConfig> {
|
|||||||
right: 15,
|
right: 15,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
var result = await showNewOrUpdateImageSlider(null, appContext, context, false, false);
|
var result = await showNewOrUpdateImageSlider(null, appContext, context, false, true);
|
||||||
if (result != null)
|
if (result != null)
|
||||||
{
|
{
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@ -11,13 +11,17 @@ class ListViewCardImage extends StatefulWidget {
|
|||||||
final List<ImageDTO> listItems;
|
final List<ImageDTO> listItems;
|
||||||
final AppContext appContext;
|
final AppContext appContext;
|
||||||
final ValueChanged<List<ImageDTO>> onChanged;
|
final ValueChanged<List<ImageDTO>> onChanged;
|
||||||
|
final bool showTitleTranslations;
|
||||||
|
final bool showDescriptionTranslations;
|
||||||
|
|
||||||
ListViewCardImage(
|
ListViewCardImage(
|
||||||
this.listItems,
|
this.listItems,
|
||||||
this.index,
|
this.index,
|
||||||
this.key,
|
this.key,
|
||||||
this.appContext,
|
this.appContext,
|
||||||
this.onChanged
|
this.onChanged,
|
||||||
|
this.showTitleTranslations,
|
||||||
|
this.showDescriptionTranslations
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -78,8 +82,8 @@ class _ListViewCard extends State<ListViewCardImage> {
|
|||||||
widget.listItems[widget.index],
|
widget.listItems[widget.index],
|
||||||
widget.appContext,
|
widget.appContext,
|
||||||
context,
|
context,
|
||||||
true,
|
widget.showTitleTranslations,
|
||||||
true
|
widget.showDescriptionTranslations
|
||||||
);
|
);
|
||||||
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
|
|||||||
@ -89,7 +89,9 @@ class _SliderConfigState extends State<SliderConfig> {
|
|||||||
sliderToSend.images = testToSend;
|
sliderToSend.images = testToSend;
|
||||||
widget.onChanged(jsonEncode(sliderToSend).toString());
|
widget.onChanged(jsonEncode(sliderToSend).toString());
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
|
true, // show titles
|
||||||
|
true // show descriptions
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -162,7 +162,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
StringInputContainer(
|
StringInputContainer(
|
||||||
label: "Nom :",
|
label: "Identifiant :",
|
||||||
initialValue: sectionDTO != null ? sectionDTO.label : "",
|
initialValue: sectionDTO != null ? sectionDTO.label : "",
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
sectionDTO.label = value;
|
sectionDTO.label = value;
|
||||||
|
|||||||
@ -164,7 +164,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
StringInputContainer(
|
StringInputContainer(
|
||||||
label: "Nom :",
|
label: "Identifiant :",
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
initialValue: configurationDTO.label,
|
initialValue: configurationDTO.label,
|
||||||
onChanged: (value) {
|
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/fetch_resource_icon.dart';
|
||||||
import 'package:manager_app/Components/multi_select_container.dart';
|
import 'package:manager_app/Components/multi_select_container.dart';
|
||||||
import 'package:manager_app/Components/string_input_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/app_context.dart';
|
||||||
import 'package:manager_app/constants.dart';
|
import 'package:manager_app/constants.dart';
|
||||||
import 'package:managerapi/api.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);
|
List<ResourceDTO> resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId:(appContext.getContext() as ManagerAppContext).instanceId);
|
||||||
if (onGetResult != null && isImage) {
|
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).toList();
|
||||||
}
|
}
|
||||||
return resources;
|
return resources;
|
||||||
}
|
}*/
|
||||||
|
|||||||
@ -42,6 +42,7 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
|
|||||||
future: getResources(widget.onGetResult, widget.isImage, appContext),
|
future: getResources(widget.onGetResult, widget.isImage, appContext),
|
||||||
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
|
if(snapshot.data != null) {
|
||||||
var tempOutput = new List<ResourceDTO>.from(snapshot.data);
|
var tempOutput = new List<ResourceDTO>.from(snapshot.data);
|
||||||
// tempOutput.add(ResourceDTO(id: null));
|
// tempOutput.add(ResourceDTO(id: null));
|
||||||
return ResourceBodyGrid(resources: tempOutput, isImage: widget.isImage, isAddButton: widget.isAddButton, onSelect: (value) async {
|
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);
|
widget.onGetResult(value);
|
||||||
}
|
}
|
||||||
},);//bodyGrid(tempOutput, size, appContext);
|
},);//bodyGrid(tempOutput, size, appContext);
|
||||||
|
} else {
|
||||||
|
return Text("No data");
|
||||||
|
}
|
||||||
} else if (snapshot.connectionState == ConnectionState.none) {
|
} else if (snapshot.connectionState == ConnectionState.none) {
|
||||||
return Text("No data");
|
return Text("No data");
|
||||||
} else {
|
} else {
|
||||||
@ -80,7 +84,7 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
|
|||||||
Future<void> getResources(Function onGetResult, bool isImage, AppContext appContext) async {
|
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);
|
List<ResourceDTO> resources = await (appContext.getContext() as ManagerAppContext).clientAPI.resourceApi.resourceGet(instanceId: (appContext.getContext() as ManagerAppContext).instanceId);
|
||||||
if (onGetResult != null && isImage) {
|
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;
|
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);
|
showNotification(Colors.green, kWhite, 'La ressource a été créée avec succès', context, null);
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} 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;
|
break;
|
||||||
case ResourceType.imageUrl:
|
case ResourceType.imageUrl:
|
||||||
|
|||||||
@ -26,6 +26,7 @@ class ResourceType {
|
|||||||
static const video = ResourceType._(r'Video');
|
static const video = ResourceType._(r'Video');
|
||||||
static const imageUrl = ResourceType._(r'ImageUrl');
|
static const imageUrl = ResourceType._(r'ImageUrl');
|
||||||
static const videoUrl = ResourceType._(r'VideoUrl');
|
static const videoUrl = ResourceType._(r'VideoUrl');
|
||||||
|
static const audio = ResourceType._(r'Audio');
|
||||||
|
|
||||||
/// List of all possible values in this [enum][ResourceType].
|
/// List of all possible values in this [enum][ResourceType].
|
||||||
static const values = <ResourceType>[
|
static const values = <ResourceType>[
|
||||||
@ -33,6 +34,7 @@ class ResourceType {
|
|||||||
video,
|
video,
|
||||||
imageUrl,
|
imageUrl,
|
||||||
videoUrl,
|
videoUrl,
|
||||||
|
audio
|
||||||
];
|
];
|
||||||
|
|
||||||
static ResourceType fromJson(dynamic value) =>
|
static ResourceType fromJson(dynamic value) =>
|
||||||
@ -69,6 +71,7 @@ class ResourceTypeTypeTransformer {
|
|||||||
case r'Video': return ResourceType.video;
|
case r'Video': return ResourceType.video;
|
||||||
case r'ImageUrl': return ResourceType.imageUrl;
|
case r'ImageUrl': return ResourceType.imageUrl;
|
||||||
case r'VideoUrl': return ResourceType.videoUrl;
|
case r'VideoUrl': return ResourceType.videoUrl;
|
||||||
|
case r'Audio': return ResourceType.audio;
|
||||||
default:
|
default:
|
||||||
if (allowNull == false) {
|
if (allowNull == false) {
|
||||||
throw ArgumentError('Unknown enum value to decode: $data');
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user