Browse Source

[Improvement-14393][Resource Center] Remove deprecated resource description in api and UI page (#14394)

3.2.1-prepare
Aaron Wang 1 year ago committed by GitHub
parent
commit
bcd1df19b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docs/docs/en/guide/upgrade/incompatible.md
  2. 4
      docs/docs/zh/guide/upgrade/incompatible.md
  3. 18
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java
  4. 1
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/resources/ResourceComponent.java
  5. 1
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/resources/visitor/ResourceTreeVisitor.java
  6. 9
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java
  7. 24
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java
  8. 2
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ResourcesControllerTest.java
  9. 42
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ResourcesServiceTest.java
  10. 4
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/FileManageE2ETest.java
  11. 2
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/UdfManageE2ETest.java
  12. 21
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/FileManagePage.java
  13. 15
      dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/UdfManagePage.java
  14. 4
      dolphinscheduler-storage-plugin/dolphinscheduler-storage-abs/src/main/java/org/apache/dolphinscheduler/plugin/storage/abs/AbsStorageOperator.java
  15. 1
      dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/StorageEntity.java
  16. 4
      dolphinscheduler-storage-plugin/dolphinscheduler-storage-gcs/src/main/java/org/apache/dolphinscheduler/plugin/storage/gcs/GcsStorageOperator.java
  17. 3
      dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/main/java/org/apache/dolphinscheduler/plugin/storage/hdfs/HdfsStorageOperator.java
  18. 4
      dolphinscheduler-storage-plugin/dolphinscheduler-storage-oss/src/main/java/org/apache/dolphinscheduler/plugin/storage/oss/OssStorageOperator.java
  19. 4
      dolphinscheduler-storage-plugin/dolphinscheduler-storage-s3/src/main/java/org/apache/dolphinscheduler/plugin/storage/s3/S3StorageOperator.java
  20. 1
      dolphinscheduler-ui/src/service/modules/resources/types.ts
  21. 10
      dolphinscheduler-ui/src/views/resource/components/resource/create/index.tsx
  22. 9
      dolphinscheduler-ui/src/views/resource/components/resource/folder/index.tsx
  23. 9
      dolphinscheduler-ui/src/views/resource/components/resource/rename/index.tsx
  24. 5
      dolphinscheduler-ui/src/views/resource/components/resource/table/use-table.ts
  25. 1
      dolphinscheduler-ui/src/views/resource/components/resource/types.ts
  26. 10
      dolphinscheduler-ui/src/views/resource/components/resource/upload/index.tsx
  27. 1
      dolphinscheduler-ui/src/views/resource/components/resource/upload/use-form.ts
  28. 1
      dolphinscheduler-ui/src/views/resource/components/resource/use-file.ts

4
docs/docs/en/guide/upgrade/incompatible.md

@ -9,6 +9,10 @@ This document records the incompatible updates between each version. You need to
* Change the default unix shell executor from sh to bash ([#12180](https://github.com/apache/dolphinscheduler/pull/12180)).
* Remove `deleteSource` in `download()` of `StorageOperate` ([#14084](https://github.com/apache/dolphinscheduler/pull/14084))
## 3.2.0
* Remove parameter `description` from public interfaces of new resource center ([#14394](https://github.com/apache/dolphinscheduler/pull/14394))
## 3.0.0
* Copy and import workflow without 'copy' suffix [#10607](https://github.com/apache/dolphinscheduler/pull/10607)

4
docs/docs/zh/guide/upgrade/incompatible.md

@ -9,6 +9,10 @@
* Change the default unix shell executor from sh to bash ([#12180](https://github.com/apache/dolphinscheduler/pull/12180)).
* Remove `deleteSource` in `download()` of `StorageOperate` ([#14084](https://github.com/apache/dolphinscheduler/pull/14084))
## 3.2.0
* 资源中心相关接口删除请求参数 `description` ([#14394](https://github.com/apache/dolphinscheduler/pull/14394))
## 3.0.0
* Copy and import workflow without 'copy' suffix [#10607](https://github.com/apache/dolphinscheduler/pull/10607)

18
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java

@ -105,7 +105,6 @@ public class ResourcesController extends BaseController {
* @param loginUser login user
* @param type type
* @param alias alias
* @param description description
* @param pid parent id
* @param currentDir current directory
* @return create result code
@ -114,7 +113,6 @@ public class ResourcesController extends BaseController {
@Parameters({
@Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)),
@Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema = @Schema(implementation = String.class)),
@Parameter(name = "description", description = "RESOURCE_DESC", schema = @Schema(implementation = String.class)),
@Parameter(name = "pid", description = "RESOURCE_PID", required = true, schema = @Schema(implementation = int.class, example = "10")),
@Parameter(name = "currentDir", description = "RESOURCE_CURRENT_DIR", required = true, schema = @Schema(implementation = String.class))
})
@ -124,11 +122,10 @@ public class ResourcesController extends BaseController {
public Result<Object> createDirectory(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "name") String alias,
@RequestParam(value = "description", required = false) String description,
@RequestParam(value = "pid") int pid,
@RequestParam(value = "currentDir") String currentDir) {
// todo verify the directory name
return resourceService.createDirectory(loginUser, alias, description, type, pid, currentDir);
return resourceService.createDirectory(loginUser, alias, type, pid, currentDir);
}
/**
@ -140,7 +137,6 @@ public class ResourcesController extends BaseController {
@Parameters({
@Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)),
@Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema = @Schema(implementation = String.class)),
@Parameter(name = "description", description = "RESOURCE_DESC", schema = @Schema(implementation = String.class)),
@Parameter(name = "file", description = "RESOURCE_FILE", required = true, schema = @Schema(implementation = MultipartFile.class)),
@Parameter(name = "currentDir", description = "RESOURCE_CURRENT_DIR", required = true, schema = @Schema(implementation = String.class))
})
@ -150,11 +146,10 @@ public class ResourcesController extends BaseController {
public Result<Object> createResource(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "name") String alias,
@RequestParam(value = "description", required = false) String description,
@RequestParam("file") MultipartFile file,
@RequestParam(value = "currentDir") String currentDir) {
// todo verify the file name
return resourceService.createResource(loginUser, alias, description, type, file, currentDir);
return resourceService.createResource(loginUser, alias, type, file, currentDir);
}
/**
@ -163,7 +158,6 @@ public class ResourcesController extends BaseController {
* @param loginUser login user
* @param alias alias
* @param type resource type
* @param description description
* @param file resource file
* @return update result code
*/
@ -173,7 +167,6 @@ public class ResourcesController extends BaseController {
@Parameter(name = "tenantCode", description = "TENANT_CODE", required = true, schema = @Schema(implementation = String.class)),
@Parameter(name = "type", description = "RESOURCE_TYPE", required = true, schema = @Schema(implementation = ResourceType.class)),
@Parameter(name = "name", description = "RESOURCE_NAME", required = true, schema = @Schema(implementation = String.class)),
@Parameter(name = "description", description = "RESOURCE_DESC", schema = @Schema(implementation = String.class)),
@Parameter(name = "file", description = "RESOURCE_FILE", required = true, schema = @Schema(implementation = MultipartFile.class))
})
@PutMapping()
@ -184,9 +177,8 @@ public class ResourcesController extends BaseController {
@RequestParam(value = "tenantCode", required = false) String tenantCode,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "name") String alias,
@RequestParam(value = "description", required = false) String description,
@RequestParam(value = "file", required = false) MultipartFile file) {
return resourceService.updateResource(loginUser, fullName, tenantCode, alias, description, type, file);
return resourceService.updateResource(loginUser, fullName, tenantCode, alias, type, file);
}
/**
@ -409,15 +401,13 @@ public class ResourcesController extends BaseController {
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "fileName") String fileName,
@RequestParam(value = "suffix") String fileSuffix,
@RequestParam(value = "description", required = false) String description,
@RequestParam(value = "content") String content,
@RequestParam(value = "currentDir") String currentDir) {
if (StringUtils.isEmpty(content)) {
log.error("resource file contents are not allowed to be empty");
return error(RESOURCE_FILE_IS_EMPTY.getCode(), RESOURCE_FILE_IS_EMPTY.getMsg());
}
return resourceService.onlineCreateResource(loginUser, type, fileName, fileSuffix, description, content,
currentDir);
return resourceService.onlineCreateResource(loginUser, type, fileName, fileSuffix, content, currentDir);
}
/**

1
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/resources/ResourceComponent.java

@ -40,7 +40,6 @@ public abstract class ResourceComponent {
this.pid = pid;
this.name = name;
this.fullName = fullName;
this.description = description;
this.isDirctory = isDirctory;
int directoryFlag = isDirctory ? 1 : 0;
this.idValue = String.format("%s_%s", id, directoryFlag);

1
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/resources/visitor/ResourceTreeVisitor.java

@ -128,7 +128,6 @@ public class ResourceTreeVisitor implements Visitor {
tempResourceComponent.setId(resource.getId());
tempResourceComponent.setPid(resource.getPfullName());
tempResourceComponent.setIdValue(resource.getId(), resource.isDirectory());
tempResourceComponent.setDescription(resource.getDescription());
tempResourceComponent.setType(resource.getType());
return tempResourceComponent;
}

9
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java

@ -40,7 +40,6 @@ public interface ResourcesService {
*
* @param loginUser login user
* @param name alias
* @param description description
* @param type type
* @param pid parent id
* @param currentDir current directory
@ -48,7 +47,6 @@ public interface ResourcesService {
*/
Result<Object> createDirectory(User loginUser,
String name,
String description,
ResourceType type,
int pid,
String currentDir);
@ -58,7 +56,6 @@ public interface ResourcesService {
*
* @param loginUser login user
* @param name alias
* @param desc description
* @param type type
* @param file file
* @param currentDir current directory
@ -66,7 +63,6 @@ public interface ResourcesService {
*/
Result<Object> createResource(User loginUser,
String name,
String desc,
ResourceType type,
MultipartFile file,
String currentDir);
@ -75,7 +71,6 @@ public interface ResourcesService {
* update resource
* @param loginUser login user
* @param name name
* @param desc description
* @param type resource type
* @param file resource file
* @return update result code
@ -84,7 +79,6 @@ public interface ResourcesService {
String fullName,
String tenantCode,
String name,
String desc,
ResourceType type,
MultipartFile file);
@ -163,12 +157,11 @@ public interface ResourcesService {
* @param type resource type
* @param fileName file name
* @param fileSuffix file suffix
* @param desc description
* @param content content
* @return create result code
*/
Result<Object> onlineCreateResource(User loginUser, ResourceType type, String fileName, String fileSuffix,
String desc, String content, String currentDirectory);
String content, String currentDirectory);
/**
* create or update resource.

24
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java

@ -130,7 +130,6 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
*
* @param loginUser login user
* @param name alias
* @param description description
* @param type type
* @param pid parent id
* @param currentDir current directory
@ -140,7 +139,6 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
@Transactional
public Result<Object> createDirectory(User loginUser,
String name,
String description,
ResourceType type,
int pid,
String currentDir) {
@ -171,12 +169,6 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
return result;
}
if (checkDescriptionLength(description)) {
log.warn("Parameter description is too long.");
putMsg(result, Status.DESCRIPTION_TOO_LONG_ERROR);
return result;
}
String userResRootPath = ResourceType.UDF.equals(type) ? storageOperate.getUdfDir(tenantCode)
: storageOperate.getResDir(tenantCode);
String fullName = !currentDir.contains(userResRootPath) ? userResRootPath + name : currentDir + name;
@ -207,7 +199,6 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
*
* @param loginUser login user
* @param name alias
* @param desc description
* @param type type
* @param file file
* @param currentDir current directory
@ -217,7 +208,6 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
@Transactional
public Result<Object> createResource(User loginUser,
String name,
String desc,
ResourceType type,
MultipartFile file,
String currentDir) {
@ -339,7 +329,6 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
* @param resTenantCode tenantCode in the request field "resTenantCode" for tenant code owning the resource,
* can be different from the login user in the case of logging in as admin users.
* @param name name
* @param desc description
* @param type resource type
* @param file resource file
* @return update result code
@ -350,7 +339,6 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
String resourceFullName,
String resTenantCode,
String name,
String desc,
ResourceType type,
MultipartFile file) {
Result<Object> result = new Result<>();
@ -401,13 +389,6 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
return result;
}
if (file == null && name.equals(resource.getAlias()) && desc.equals(resource.getDescription())) {
log.info("Resource does not need to be updated due to no change, resource full name:{}.",
resourceFullName);
putMsg(result, Status.SUCCESS);
return result;
}
// check if updated name of the resource already exists
String originFullName = resource.getFullName();
String originResourceName = resource.getAlias();
@ -441,7 +422,6 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
resource.setAlias(name);
resource.setFileName(name);
resource.setFullName(fullName);
resource.setDescription(desc);
resource.setUpdateTime(now);
if (file != null) {
resource.setSize(file.getSize());
@ -868,7 +848,6 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
entity.setAlias(resource.getAlias());
entity.setId(resource.getId());
entity.setType(resource.getType());
entity.setDescription(resource.getDescription());
return entity;
}
@ -1177,7 +1156,6 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
* @param type resource type
* @param fileName file name
* @param fileSuffix file suffix
* @param desc description
* @param content content
* @param currentDir current directory
* @return create result code
@ -1185,7 +1163,7 @@ public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesSe
@Override
@Transactional
public Result<Object> onlineCreateResource(User loginUser, ResourceType type, String fileName, String fileSuffix,
String desc, String content, String currentDir) {
String content, String currentDir) {
Result<Object> result = new Result<>();
result = checkResourceUploadStartupState();

2
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ResourcesControllerTest.java

@ -171,7 +171,7 @@ public class ResourcesControllerTest extends AbstractControllerTest {
Result mockResult = new Result<>();
mockResult.setCode(Status.TENANT_NOT_EXIST.getCode());
Mockito.when(resourcesService
.onlineCreateResource(Mockito.any(), Mockito.any(), Mockito.anyString(), Mockito.anyString(),
.onlineCreateResource(Mockito.any(), Mockito.any(), Mockito.anyString(),
Mockito.anyString(), Mockito.anyString(), Mockito.anyString()))
.thenReturn(mockResult);

42
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ResourcesServiceTest.java

@ -169,7 +169,7 @@ public class ResourcesServiceTest {
Mockito.when(userMapper.selectById(user.getId())).thenReturn(getUser());
Mockito.when(tenantMapper.queryById(1)).thenReturn(null);
Assertions.assertThrows(ServiceException.class,
() -> resourcesService.createResource(user, "ResourcesServiceTest", "ResourcesServiceTest",
() -> resourcesService.createResource(user, "ResourcesServiceTest",
ResourceType.FILE, new MockMultipartFile("test.pdf", "test.pdf", "pdf", "test".getBytes()),
"/"));
// set tenant for user
@ -178,7 +178,7 @@ public class ResourcesServiceTest {
// HDFS_NOT_STARTUP
Mockito.when(PropertyUtils.getResUploadStartupState()).thenReturn(false);
Result<Object> result = resourcesService.createResource(user, "ResourcesServiceTest", "ResourcesServiceTest",
Result<Object> result = resourcesService.createResource(user, "ResourcesServiceTest",
ResourceType.FILE, null, "/");
logger.info(result.toString());
Assertions.assertEquals(Status.STORAGE_NOT_STARTUP.getMsg(), result.getMsg());
@ -186,7 +186,7 @@ public class ResourcesServiceTest {
// RESOURCE_FILE_IS_EMPTY
MockMultipartFile mockMultipartFile = new MockMultipartFile("test.pdf", "".getBytes());
Mockito.when(PropertyUtils.getResUploadStartupState()).thenReturn(true);
result = resourcesService.createResource(user, "ResourcesServiceTest", "ResourcesServiceTest",
result = resourcesService.createResource(user, "ResourcesServiceTest",
ResourceType.FILE, mockMultipartFile, "/");
logger.info(result.toString());
Assertions.assertEquals(Status.RESOURCE_FILE_IS_EMPTY.getMsg(), result.getMsg());
@ -195,7 +195,7 @@ public class ResourcesServiceTest {
mockMultipartFile = new MockMultipartFile("test.pdf", "test.pdf", "pdf", "test".getBytes());
Mockito.when(Files.getFileExtension("test.pdf")).thenReturn("pdf");
Mockito.when(Files.getFileExtension("ResourcesServiceTest.jar")).thenReturn("jar");
result = resourcesService.createResource(user, "ResourcesServiceTest.jar", "ResourcesServiceTest",
result = resourcesService.createResource(user, "ResourcesServiceTest.jar",
ResourceType.FILE, mockMultipartFile, "/");
logger.info(result.toString());
Assertions.assertEquals(Status.RESOURCE_SUFFIX_FORBID_CHANGE.getMsg(), result.getMsg());
@ -204,7 +204,7 @@ public class ResourcesServiceTest {
mockMultipartFile = new MockMultipartFile("ResourcesServiceTest.pdf", "ResourcesServiceTest.pdf",
"pdf", "test".getBytes());
Mockito.when(Files.getFileExtension("ResourcesServiceTest.pdf")).thenReturn("pdf");
result = resourcesService.createResource(user, "ResourcesServiceTest.pdf", "ResourcesServiceTest",
result = resourcesService.createResource(user, "ResourcesServiceTest.pdf",
ResourceType.UDF, mockMultipartFile, "/");
logger.info(result.toString());
Assertions.assertEquals(Status.UDF_RESOURCE_SUFFIX_NOT_JAR.getMsg(), result.getMsg());
@ -215,7 +215,7 @@ public class ResourcesServiceTest {
Mockito.when(Files.getFileExtension(tooLongFileName)).thenReturn("pdf");
// '/databasePath/tenantCode/RESOURCE/'
Mockito.when(storageOperate.getResDir("123")).thenReturn("/dolphinscheduler/123/resources/");
result = resourcesService.createResource(user, tooLongFileName, tooLongFileName, ResourceType.FILE,
result = resourcesService.createResource(user, tooLongFileName, ResourceType.FILE,
mockMultipartFile, "/");
logger.info(result.toString());
Assertions.assertEquals(Status.RESOURCE_FULL_NAME_TOO_LONG_ERROR.getMsg(), result.getMsg());
@ -228,7 +228,7 @@ public class ResourcesServiceTest {
user.setId(1);
user.setUserType(UserType.GENERAL_USER);
// HDFS_NOT_STARTUP
Result result = resourcesService.createDirectory(user, "directoryTest", "directory test",
Result result = resourcesService.createDirectory(user, "directoryTest",
ResourceType.FILE, -1, "/");
logger.info(result.toString());
Assertions.assertEquals(Status.STORAGE_NOT_STARTUP.getMsg(), result.getMsg());
@ -247,15 +247,9 @@ public class ResourcesServiceTest {
}
Mockito.when(PropertyUtils.getResUploadStartupState()).thenReturn(true);
Mockito.when(resourcesMapper.existResource("/directoryTest", 0)).thenReturn(true);
result = resourcesService.createDirectory(user, "directoryTest", "directory test", ResourceType.FILE, -1, "/");
result = resourcesService.createDirectory(user, "directoryTest", ResourceType.FILE, -1, "/");
logger.info(result.toString());
Assertions.assertEquals(Status.RESOURCE_EXIST.getMsg(), result.getMsg());
// Description_Lingth_ERROR
result = resourcesService.createDirectory(user, "directoryTest",
"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111",
ResourceType.FILE, -1, "/");
logger.info(result.toString());
Assertions.assertEquals(Status.DESCRIPTION_TOO_LONG_ERROR.getMsg(), result.getMsg());
}
@Test
@ -273,7 +267,7 @@ public class ResourcesServiceTest {
// HDFS_NOT_STARTUP
Result result = resourcesService.updateResource(user, "ResourcesServiceTest",
"123", "ResourcesServiceTest", "", ResourceType.FILE, null);
"123", "ResourcesServiceTest", ResourceType.FILE, null);
logger.info(result.toString());
Assertions.assertEquals(Status.STORAGE_NOT_STARTUP.getMsg(), result.getMsg());
@ -287,7 +281,7 @@ public class ResourcesServiceTest {
result = resourcesService.updateResource(user,
"/dolphinscheduler/123/resources/ResourcesServiceTest",
"123",
"ResourcesServiceTest", "", ResourceType.FILE, null);
"ResourcesServiceTest", ResourceType.FILE, null);
logger.info(result.toString());
Assertions.assertEquals(Status.NO_CURRENT_OPERATING_PERMISSION.getMsg(), result.getMsg());
@ -305,7 +299,7 @@ public class ResourcesServiceTest {
"123", ResourceType.FILE)).thenReturn(getStorageEntityResource());
result = resourcesService.updateResource(user, "/dolphinscheduler/123/resources/ResourcesServiceTest",
"123",
"ResourcesServiceTest", "", ResourceType.FILE, null);
"ResourcesServiceTest", ResourceType.FILE, null);
logger.info(result.toString());
Assertions.assertEquals(Status.SUCCESS.getMsg(), result.getMsg());
} catch (Exception e) {
@ -332,7 +326,7 @@ public class ResourcesServiceTest {
"/dolphinscheduler/123/resources/ResourcesServiceTest1.jar", e);
}
result = resourcesService.updateResource(user, "/dolphinscheduler/123/resources/ResourcesServiceTest1.jar",
"123", "ResourcesServiceTest2.jar", "", ResourceType.UDF, null);
"123", "ResourcesServiceTest2.jar", ResourceType.UDF, null);
logger.info(result.toString());
Assertions.assertEquals(Status.RESOURCE_EXIST.getMsg(), result.getMsg());
@ -340,13 +334,13 @@ public class ResourcesServiceTest {
Mockito.when(tenantMapper.queryById(Mockito.anyInt())).thenReturn(null);
Assertions.assertThrows(ServiceException.class,
() -> resourcesService.updateResource(user, "ResourcesServiceTest1.jar",
"", "ResourcesServiceTest", "", ResourceType.UDF, null));
"", "ResourcesServiceTest", ResourceType.UDF, null));
// SUCCESS
Mockito.when(tenantMapper.queryById(1)).thenReturn(getTenant());
result = resourcesService.updateResource(user, "/dolphinscheduler/123/resources/ResourcesServiceTest1.jar",
"123", "ResourcesServiceTest1.jar", "", ResourceType.UDF, null);
"123", "ResourcesServiceTest1.jar", ResourceType.UDF, null);
logger.info(result.toString());
Assertions.assertEquals(Status.SUCCESS.getMsg(), result.getMsg());
}
@ -548,7 +542,7 @@ public class ResourcesServiceTest {
Mockito.when(tenantMapper.queryById(1)).thenReturn(getTenant());
// HDFS_NOT_STARTUP
Result result = resourcesService.onlineCreateResource(user, ResourceType.FILE, "test", "jar", "desc", "content",
Result result = resourcesService.onlineCreateResource(user, ResourceType.FILE, "test", "jar", "content",
"/");
logger.info(result.toString());
Assertions.assertEquals(Status.STORAGE_NOT_STARTUP.getMsg(), result.getMsg());
@ -556,7 +550,7 @@ public class ResourcesServiceTest {
// RESOURCE_SUFFIX_NOT_SUPPORT_VIEW
Mockito.when(PropertyUtils.getResUploadStartupState()).thenReturn(true);
Mockito.when(FileUtils.getResourceViewSuffixes()).thenReturn("class");
result = resourcesService.onlineCreateResource(user, ResourceType.FILE, "test", "jar", "desc", "content",
result = resourcesService.onlineCreateResource(user, ResourceType.FILE, "test", "jar", "content",
"/");
logger.info(result.toString());
Assertions.assertEquals(Status.RESOURCE_SUFFIX_NOT_SUPPORT_VIEW.getMsg(), result.getMsg());
@ -566,7 +560,7 @@ public class ResourcesServiceTest {
Mockito.when(storageOperate.getResDir("123")).thenReturn("/dolphinscheduler/123/resources/");
Mockito.when(FileUtils.getUploadFilename(Mockito.anyString(), Mockito.anyString())).thenReturn("test");
Mockito.when(FileUtils.writeContent2File(Mockito.anyString(), Mockito.anyString())).thenReturn(true);
result = resourcesService.onlineCreateResource(user, ResourceType.FILE, "test", "jar", "desc", "content",
result = resourcesService.onlineCreateResource(user, ResourceType.FILE, "test", "jar", "content",
"/");
logger.info(result.toString());
Assertions.assertEquals(Status.SUCCESS.getMsg(), result.getMsg());
@ -965,7 +959,6 @@ public class ResourcesServiceTest {
entity.setAlias("ResourcesServiceTest");
entity.setFileName("ResourcesServiceTest");
entity.setDirectory(false);
entity.setDescription("");
entity.setUserName("123");
entity.setType(ResourceType.FILE);
entity.setFullName("/dolphinscheduler/123/resources/ResourcesServiceTest");
@ -1015,7 +1008,6 @@ public class ResourcesServiceTest {
entity.setAlias("ResourcesServiceTest1.jar");
entity.setFileName("ResourcesServiceTest1.jar");
entity.setDirectory(false);
entity.setDescription("");
entity.setUserName("123");
entity.setType(ResourceType.UDF);
entity.setFullName("/dolphinscheduler/123/resources/ResourcesServiceTest1.jar");

4
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/FileManageE2ETest.java

@ -122,7 +122,7 @@ public class FileManageE2ETest {
void testCreateDirectory() {
final FileManagePage page = new FileManagePage(browser);
page.createDirectory(testDirectoryName, "test_desc");
page.createDirectory(testDirectoryName);
await().untilAsserted(() -> assertThat(page.fileList())
.as("File list should contain newly-created file")
@ -135,7 +135,7 @@ public class FileManageE2ETest {
void testCancelCreateDirectory() {
final FileManagePage page = new FileManagePage(browser);
page.cancelCreateDirectory(testDirectoryName, "test_desc");
page.cancelCreateDirectory(testDirectoryName);
await().untilAsserted(() -> assertThat(page.fileList())
.as("File list should contain newly-created file")

2
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/UdfManageE2ETest.java

@ -120,7 +120,7 @@ public class UdfManageE2ETest {
new WebDriverWait(page.driver(), 10)
.until(ExpectedConditions.urlContains("/resource-manage"));
page.createDirectory(testDirectoryName, "test_desc");
page.createDirectory(testDirectoryName);
await().untilAsserted(() -> assertThat(page.udfList())
.as("File list should contain newly-created file")
.extracting(WebElement::getText)

21
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/FileManagePage.java

@ -93,21 +93,19 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab {
editFileBox = new EditFileBox();
}
public FileManagePage createDirectory(String name, String description) {
public FileManagePage createDirectory(String name) {
buttonCreateDirectory().click();
createDirectoryBox().inputDirectoryName().sendKeys(name);
createDirectoryBox().inputDescription().sendKeys(description);
createDirectoryBox().buttonSubmit().click();
return this;
}
public FileManagePage cancelCreateDirectory(String name, String description) {
public FileManagePage cancelCreateDirectory(String name) {
buttonCreateDirectory().click();
createDirectoryBox().inputDirectoryName().sendKeys(name);
createDirectoryBox().inputDescription().sendKeys(description);
createDirectoryBox().buttonCancel().click();
return this;
@ -131,7 +129,7 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab {
return this;
}
public FileManagePage createSubDirectory(String directoryName, String subDirectoryName, String description) {
public FileManagePage createSubDirectory(String directoryName, String subDirectoryName) {
fileList()
.stream()
.filter(it -> it.getText().contains(directoryName))
@ -143,7 +141,6 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab {
buttonCreateDirectory().click();
createDirectoryBox().inputDirectoryName().sendKeys(subDirectoryName);
createDirectoryBox().inputDescription().sendKeys(description);
createDirectoryBox().buttonSubmit().click();
return this;
@ -230,12 +227,6 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab {
})
private WebElement inputDirectoryName;
@FindBys({
@FindBy(className = "input-description"),
@FindBy(tagName = "textarea"),
})
private WebElement inputDescription;
@FindBy(className = "btn-submit")
private WebElement buttonSubmit;
@ -255,12 +246,6 @@ public class FileManagePage extends NavBarPage implements ResourcePage.Tab {
})
private WebElement inputName;
@FindBys({
@FindBy(className = "input-description"),
@FindBy(tagName = "textarea"),
})
private WebElement inputDescription;
@FindBy(className = "btn-submit")
private WebElement buttonSubmit;

15
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/resource/UdfManagePage.java

@ -70,11 +70,10 @@ public class UdfManagePage extends NavBarPage implements ResourcePage.Tab {
createDirectoryBox = new CreateDirectoryBox();
}
public UdfManagePage createDirectory(String name, String description) {
public UdfManagePage createDirectory(String name) {
buttonCreateDirectory().click();
createDirectoryBox().inputDirectoryName().sendKeys(name);
createDirectoryBox().inputDescription().sendKeys(description);
createDirectoryBox().buttonSubmit().click();
return this;
@ -150,12 +149,6 @@ public class UdfManagePage extends NavBarPage implements ResourcePage.Tab {
})
private WebElement inputName;
@FindBys({
@FindBy(className = "input-description"),
@FindBy(tagName = "textarea"),
})
private WebElement inputDescription;
@FindBy(className = "btn-submit")
private WebElement buttonSubmit;
@ -194,12 +187,6 @@ public class UdfManagePage extends NavBarPage implements ResourcePage.Tab {
})
private WebElement inputDirectoryName;
@FindBys({
@FindBy(className = "input-description"),
@FindBy(tagName = "textarea"),
})
private WebElement inputDescription;
@FindBy(className = "btn-submit")
private WebElement buttonSubmit;

4
dolphinscheduler-storage-plugin/dolphinscheduler-storage-abs/src/main/java/org/apache/dolphinscheduler/plugin/storage/abs/AbsStorageOperator.java

@ -376,7 +376,6 @@ public class AbsStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(blobItem.getName());
entity.setDirectory(true);
entity.setDescription(EMPTY_STRING);
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(0);
@ -395,7 +394,6 @@ public class AbsStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(blobItem.getName());
entity.setDirectory(false);
entity.setDescription(EMPTY_STRING);
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(blobItem.getProperties().getContentLength());
@ -423,7 +421,6 @@ public class AbsStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(path);
entity.setDirectory(true);
entity.setDescription(EMPTY_STRING);
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(0);
@ -442,7 +439,6 @@ public class AbsStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(blobClient.getBlobName());
entity.setDirectory(false);
entity.setDescription(EMPTY_STRING);
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(blobClient.getProperties().getBlobSize());

1
dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/StorageEntity.java

@ -56,7 +56,6 @@ public class StorageEntity {
*/
private String pfullName;
private boolean isDirectory;
private String description;
private int userId;
private String userName;
private ResourceType type;

4
dolphinscheduler-storage-plugin/dolphinscheduler-storage-gcs/src/main/java/org/apache/dolphinscheduler/plugin/storage/gcs/GcsStorageOperator.java

@ -387,7 +387,6 @@ public class GcsStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(blob.getName());
entity.setDirectory(true);
entity.setDescription(EMPTY_STRING);
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(0);
@ -406,7 +405,6 @@ public class GcsStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(blob.getName());
entity.setDirectory(false);
entity.setDescription(EMPTY_STRING);
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(blob.getSize());
@ -434,7 +432,6 @@ public class GcsStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(path);
entity.setDirectory(true);
entity.setDescription(EMPTY_STRING);
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(0);
@ -453,7 +450,6 @@ public class GcsStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(blob.getName());
entity.setDirectory(false);
entity.setDescription(EMPTY_STRING);
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(blob.getSize());

3
dolphinscheduler-storage-plugin/dolphinscheduler-storage-hdfs/src/main/java/org/apache/dolphinscheduler/plugin/storage/hdfs/HdfsStorageOperator.java

@ -478,7 +478,6 @@ public class HdfsStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(fullName);
entity.setDirectory(true);
entity.setDescription("");
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(fileStatus.getLen());
@ -500,7 +499,6 @@ public class HdfsStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(fullName);
entity.setDirectory(false);
entity.setDescription("");
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(fileStatus.getLen());
@ -543,7 +541,6 @@ public class HdfsStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(fullName);
entity.setDirectory(fileStatus.isDirectory());
entity.setDescription("");
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(fileStatus.getLen());

4
dolphinscheduler-storage-plugin/dolphinscheduler-storage-oss/src/main/java/org/apache/dolphinscheduler/plugin/storage/oss/OssStorageOperator.java

@ -378,7 +378,6 @@ public class OssStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(summary.getKey());
entity.setDirectory(false);
entity.setDescription("");
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(summary.getSize());
@ -400,7 +399,6 @@ public class OssStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(commonPrefix);
entity.setDirectory(true);
entity.setDescription("");
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(0);
@ -444,7 +442,6 @@ public class OssStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(path);
entity.setDirectory(true);
entity.setDescription("");
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(0);
@ -464,7 +461,6 @@ public class OssStorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(summary.getKey());
entity.setDirectory(false);
entity.setDescription("");
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(summary.getSize());

4
dolphinscheduler-storage-plugin/dolphinscheduler-storage-s3/src/main/java/org/apache/dolphinscheduler/plugin/storage/s3/S3StorageOperator.java

@ -494,7 +494,6 @@ public class S3StorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(summary.getKey());
entity.setDirectory(false);
entity.setDescription("");
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(summary.getSize());
@ -516,7 +515,6 @@ public class S3StorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(commonPrefix);
entity.setDirectory(true);
entity.setDescription("");
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(0);
@ -565,7 +563,6 @@ public class S3StorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(path);
entity.setDirectory(true);
entity.setDescription("");
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(0);
@ -585,7 +582,6 @@ public class S3StorageOperator implements Closeable, StorageOperate {
entity.setFileName(fileName);
entity.setFullName(summary.getKey());
entity.setDirectory(false);
entity.setDescription("");
entity.setUserName(tenantCode);
entity.setType(type);
entity.setSize(summary.getSize());

1
dolphinscheduler-ui/src/service/modules/resources/types.ts

@ -101,7 +101,6 @@ interface ResourceFile {
directory: boolean
fileName: string
fullName: string
description: string
size: number
createTime: string
updateTime: string

10
dolphinscheduler-ui/src/views/resource/components/resource/create/index.tsx

@ -89,16 +89,6 @@ export default defineComponent({
class='select-file-format'
/>
</NFormItem>
<NFormItem label={t('resource.file.description')} path='description'>
<NInput
allowInput={this.trim}
type='textarea'
v-model={[this.fileForm.description, 'value']}
placeholder={t('resource.file.enter_description_tips')}
style={{ width: '430px' }}
class='input-description'
/>
</NFormItem>
<NFormItem label={t('resource.file.file_content')} path='content'>
<div
style={{

9
dolphinscheduler-ui/src/views/resource/components/resource/folder/index.tsx

@ -82,15 +82,6 @@ export default defineComponent({
class='input-directory-name'
/>
</NFormItem>
<NFormItem label={t('resource.file.description')} path='description'>
<NInput
allowInput={this.trim}
type='textarea'
v-model={[this.folderForm.description, 'value']}
placeholder={t('resource.file.enter_description_tips')}
class='input-description'
/>
</NFormItem>
</NForm>
</Modal>
)

9
dolphinscheduler-ui/src/views/resource/components/resource/rename/index.tsx

@ -111,15 +111,6 @@ export default defineComponent({
class='input-name'
/>
</NFormItem>
<NFormItem label={t('resource.file.description')} path='description'>
<NInput
allowInput={this.trim}
type='textarea'
v-model={[this.renameForm.description, 'value']}
placeholder={t('resource.file.enter_description_tips')}
class='input-description'
/>
</NFormItem>
</NForm>
</Modal>
)

5
dolphinscheduler-ui/src/views/resource/components/resource/table/use-table.ts

@ -131,11 +131,6 @@ export function useTable() {
...COLUMN_WIDTH_CONFIG['name'],
key: 'file_name'
},
{
title: t('resource.file.description'),
...COLUMN_WIDTH_CONFIG['note'],
key: 'description'
},
{
title: t('resource.file.size'),
key: 'size',

1
dolphinscheduler-ui/src/views/resource/components/resource/types.ts

@ -131,7 +131,6 @@ export interface IUploadDefaultValue {
user_name: string
name: string
file: string
description: string
type: ResourceType
pid: number
currentDir: string

10
dolphinscheduler-ui/src/views/resource/components/resource/upload/index.tsx

@ -98,7 +98,6 @@ export default defineComponent({
if (props.isReupload && props.show) {
state.uploadForm.fullName = props.fullName
state.uploadForm.name = props.name
state.uploadForm.description = props.description
state.uploadForm.user_name = props.userName
}
}
@ -138,15 +137,6 @@ export default defineComponent({
class='input-file-name'
/>
</NFormItem>
<NFormItem label={t('resource.file.description')} path='description'>
<NInput
allowInput={this.trim}
type='textarea'
v-model={[this.uploadForm.description, 'value']}
placeholder={t('resource.file.enter_description_tips')}
class='input-description'
/>
</NFormItem>
<NFormItem label={t('resource.file.upload_files')} path='file'>
<NUpload
v-model={[this.uploadForm.file, 'value']}

1
dolphinscheduler-ui/src/views/resource/components/resource/upload/use-form.ts

@ -26,7 +26,6 @@ const defaultValue: IUploadDefaultValue = () => ({
user_name: '',
name: '',
file: '',
description: '',
type: undefined!,
pid: -1,
currentDir: '/'

1
dolphinscheduler-ui/src/views/resource/components/resource/use-file.ts

@ -55,7 +55,6 @@ export function useFileState(
user_name: item.userName,
directory: item.directory,
file_name: item.fileName,
description: item.description,
size: item.size,
create_time: item.createTime,
update_time: item.updateTime

Loading…
Cancel
Save