-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Выгрузка Хранилища значений в файлы #1488
feat: Выгрузка Хранилища значений в файлы #1488
Conversation
Для сохранения типа значения в Хранилище
run tests |
VanessaAutomation/Forms/ПодготовкаИЗагрузкаДанных/Ext/Form/Module.bsl
Outdated
Show resolved
Hide resolved
VanessaAutomation/Forms/ПодготовкаИЗагрузкаДанных/Ext/Form/Module.bsl
Outdated
Show resolved
Hide resolved
EndIf; | ||
|
||
Path = ParamsValueStorage.PathToUpload | ||
+ ?(Right(ParamsValueStorage.PathToUpload, 1) = "/", "", "/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а если будет обратный слешь?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не будет. При инициализации структуры слеши приводятся к единому типу
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну тогда может там сразу и сделать приведение к одному виду? Зачем это тянуть ниже. Оно же не один раз встречается
@@ -2274,7 +2389,7 @@ Procedure FormatGerkinTable(TableArray) | |||
ParametersRow = "| "; | |||
For Kkk = 0 To LengthArray.Count() - 1 Do | |||
Ch = TrimAll(ParametersArray[Kkk]); | |||
While StrLen(Ch) < LengthArray[Kkk] Do | |||
While StrLen(Ch) < min(LengthArray[Kkk], 1024) Do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
магическое число
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это уже было
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну так так код и рефакторится, кто то задел, кто то заметил, вот и качество растет :) Но судя по коду, числа раньше там не было, а это новый код.
run tests |
run tests |
run tests |
@@ -820,6 +827,31 @@ Procedure ReplaceRefByAttributeOnChange(Item) | |||
ChangeReplaceRefByAttribute(); | |||
EndProcedure | |||
|
|||
&AtClient | |||
Procedure PathToUploadНачалоВыбора(Item, Choose, StandardProcessing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
если уж на инглише, то пусть будет все на инглишще :)
If Not (StrStartsWith(TypeName, "CatalogRef") Or StrStartsWith(TypeName, "DocumentRef") Or StrStartsWith(TypeName, "ChartOfCharacteristicTypesRef")) | ||
Or DataValue.IsEmpty() | ||
Or Dependencies.Find(DataValue, "Item") <> Undefined Then | ||
If Not (Documents.AllRefsType().ContainsType(TypeVal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вынеси лучше условие в отдельную переменную и дай внятное название, а то я что то не могу понять что это за код. Уже не помню :)
EndProcedure | ||
|
||
&AtServerNoContext | ||
Function ParseStringValue(Val ParsingValue, Val ValueType) | ||
Function ParseStringValue(Val ParsingValue, Val ValueType, workspaceRoot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workspaceRoot тоже везде пробрасывается, может его проще вынести тоже в экспортные? Зачем его везде передавать и про него помнить. Так получится сделать?
@@ -1528,6 +1563,17 @@ Function ParseStringValue(Val ParsingValue, Val ValueType) | |||
Result = ReadXML(Reader); | |||
Return Result; | |||
EndIf; | |||
If Left(ParsingValue, 17) = "ValueStoragePath:" Then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Магическое число. Надо в переменную внятную вынести
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну тут очевидно же. от увеличения переменной когнитивная нагрузка только вырастет. как ее назвать? КоличествоБуквВСтрокеValueStoragePathДвоеточие?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я думаю это следствие того, что нет поддержки СтрНачинаетсяС, так сказать альтернативный вариант. Я бы использовал СтрНайти - но для единообразия всего кода - такой вариант
Reader.Close(); | ||
|
||
Return Result; | ||
EndIf; | ||
If Left(ParsingValue, 16) = "FindByAttribute:" Then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
магические числа
EndIf; | ||
|
||
Path = ParamsValueStorage.PathToUpload | ||
+ ?(Right(ParamsValueStorage.PathToUpload, 1) = "/", "", "/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну тогда может там сразу и сделать приведение к одному виду? Зачем это тянуть ниже. Оно же не один раз встречается
@@ -2274,7 +2389,7 @@ Procedure FormatGerkinTable(TableArray) | |||
ParametersRow = "| "; | |||
For Kkk = 0 To LengthArray.Count() - 1 Do | |||
Ch = TrimAll(ParametersArray[Kkk]); | |||
While StrLen(Ch) < LengthArray[Kkk] Do | |||
While StrLen(Ch) < min(LengthArray[Kkk], 1024) Do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну так так код и рефакторится, кто то задел, кто то заметил, вот и качество растет :) Но судя по коду, числа раньше там не было, а это новый код.
В целом - круто, если не видишь смысла исправлять мои замечания - просто пометь их как закрытые и все. |
Да, согласен. |
Поправил замечания. И тесты |
run tests |
@KrapivinAndrey |
@KrapivinAndrey |
@Pr-Mex Вечная проблема с / в КаталогПроекта и workspaceRoot |
Run tests |
@Pr-Mex надо перезапустить тесты |
Run tests |
@KrapivinAndrey |
Спасибо! |
Сделанные изменения