mirror of
https://github.com/nasa/openmct.git
synced 2025-06-02 23:50:49 +00:00
Move duplicate fixes (#3947)
* Changed text of form labels; * Corrected case of "Location" in Duplicate action; * changed from objects.mutate to objects.save for duplicate action name change * handling cancel of move Co-authored-by: charlesh88 <charles.f.hacskaylo@nasa.gov>
This commit is contained in:
parent
b484a4a959
commit
9d8a8b36d2
@ -71,7 +71,8 @@ export default class DuplicateAction {
|
|||||||
|
|
||||||
updateNameCheck(object, name) {
|
updateNameCheck(object, name) {
|
||||||
if (object.name !== name) {
|
if (object.name !== name) {
|
||||||
this.openmct.objects.mutate(object, 'name', name);
|
object.name = name;
|
||||||
|
this.openmct.objects.save(object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +96,7 @@ export default class DuplicateAction {
|
|||||||
cssClass: "l-input-lg"
|
cssClass: "l-input-lg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "location",
|
name: "Location",
|
||||||
cssClass: "grows",
|
cssClass: "grows",
|
||||||
control: "locator",
|
control: "locator",
|
||||||
validate: this.validate(object, parent),
|
validate: this.validate(object, parent),
|
||||||
|
@ -37,7 +37,14 @@ export default class MoveAction {
|
|||||||
let oldParent = objectPath[1];
|
let oldParent = objectPath[1];
|
||||||
let dialogService = this.openmct.$injector.get('dialogService');
|
let dialogService = this.openmct.$injector.get('dialogService');
|
||||||
let dialogForm = this.getDialogForm(object, oldParent);
|
let dialogForm = this.getDialogForm(object, oldParent);
|
||||||
let userInput = await dialogService.getUserInput(dialogForm, { name: object.name });
|
let userInput;
|
||||||
|
|
||||||
|
try {
|
||||||
|
userInput = await dialogService.getUserInput(dialogForm, { name: object.name });
|
||||||
|
} catch (err) {
|
||||||
|
// user canceled, most likely
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// if we need to update name
|
// if we need to update name
|
||||||
if (object.name !== userInput.name) {
|
if (object.name !== userInput.name) {
|
||||||
@ -104,13 +111,13 @@ export default class MoveAction {
|
|||||||
{
|
{
|
||||||
key: "name",
|
key: "name",
|
||||||
control: "textfield",
|
control: "textfield",
|
||||||
name: "Folder Name",
|
name: "Name",
|
||||||
pattern: "\\S+",
|
pattern: "\\S+",
|
||||||
required: true,
|
required: true,
|
||||||
cssClass: "l-input-lg"
|
cssClass: "l-input-lg"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "location",
|
name: "Location",
|
||||||
control: "locator",
|
control: "locator",
|
||||||
validate: this.validate(object, parent),
|
validate: this.validate(object, parent),
|
||||||
key: 'location'
|
key: 'location'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user