TF-4370 Handle create new a label with description
This commit is contained in:
@@ -11,6 +11,8 @@ extension LabelExtension on Label {
|
|||||||
|
|
||||||
String get safeDisplayName => displayName ?? '';
|
String get safeDisplayName => displayName ?? '';
|
||||||
|
|
||||||
|
String get safeDescription => description ?? '';
|
||||||
|
|
||||||
Color? get backgroundColor {
|
Color? get backgroundColor {
|
||||||
if (id?.value == moreLabelId) {
|
if (id?.value == moreLabelId) {
|
||||||
return AppColor.grayBackgroundColor;
|
return AppColor.grayBackgroundColor;
|
||||||
@@ -32,12 +34,14 @@ extension LabelExtension on Label {
|
|||||||
KeyWordIdentifier? keyword,
|
KeyWordIdentifier? keyword,
|
||||||
String? displayName,
|
String? displayName,
|
||||||
HexColor? color,
|
HexColor? color,
|
||||||
|
String? description,
|
||||||
}) {
|
}) {
|
||||||
return Label(
|
return Label(
|
||||||
id: id ?? this.id,
|
id: id ?? this.id,
|
||||||
displayName: displayName ?? this.displayName,
|
displayName: displayName ?? this.displayName,
|
||||||
keyword: keyword ?? this.keyword,
|
keyword: keyword ?? this.keyword,
|
||||||
color: color ?? this.color,
|
color: color ?? this.color,
|
||||||
|
description: description ?? this.description,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ class LabelApi
|
|||||||
final newLabelCreated = labelCreated!.copyWith(
|
final newLabelCreated = labelCreated!.copyWith(
|
||||||
displayName: labelData.displayName,
|
displayName: labelData.displayName,
|
||||||
color: labelData.color,
|
color: labelData.color,
|
||||||
|
description: labelData.description,
|
||||||
);
|
);
|
||||||
return newLabelCreated;
|
return newLabelCreated;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ class _CreateNewLabelModalState extends State<CreateNewLabelModal> {
|
|||||||
if (selectedLabel != null) {
|
if (selectedLabel != null) {
|
||||||
_nameInputController.text = selectedLabel.safeDisplayName;
|
_nameInputController.text = selectedLabel.safeDisplayName;
|
||||||
_nameInputFocusNode.requestFocus();
|
_nameInputFocusNode.requestFocus();
|
||||||
|
_descriptionInputController.text = selectedLabel.safeDescription;
|
||||||
_createLabelStateNotifier.value = true;
|
_createLabelStateNotifier.value = true;
|
||||||
_labelSelectedColorNotifier.value = _selectedColor;
|
_labelSelectedColorNotifier.value = _selectedColor;
|
||||||
}
|
}
|
||||||
@@ -370,6 +371,7 @@ class _CreateNewLabelModalState extends State<CreateNewLabelModal> {
|
|||||||
color: _selectedColor != null
|
color: _selectedColor != null
|
||||||
? HexColor(_selectedColor!.toHexTriplet())
|
? HexColor(_selectedColor!.toHexTriplet())
|
||||||
: null,
|
: null,
|
||||||
|
description: _descriptionInputController.text,
|
||||||
);
|
);
|
||||||
widget.onLabelActionCallback(newLabel);
|
widget.onLabelActionCallback(newLabel);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user