feat(web) Individual assets shared mechanism (#1317)

* Create shared link modal for individual asset

* Added API to create asset shared link

* Added viewer for individual shared link

* Added multiselection app bar

* Refactor gallery viewer to its own component

* Refactor

* Refactor

* Add and remove asset from shared link

* Fixed test

* Fixed notification card doesn't wrap

* Add check asset access when created asset shared link

* pr feedback
This commit is contained in:
Alex
2023-01-14 23:49:47 -06:00
committed by GitHub
parent b9b2b559a1
commit e9fda40b2b
66 changed files with 2085 additions and 242 deletions

View File

@@ -17,61 +17,85 @@ void main() {
// final instance = AlbumApi();
group('tests for AlbumApi', () {
//
//
//Future<AddAssetsResponseDto> addAssetsToAlbum(String albumId, AddAssetsDto addAssetsDto) async
test('test addAssetsToAlbum', () async {
// TODO
});
//
//
//Future<AlbumResponseDto> addUsersToAlbum(String albumId, AddUsersDto addUsersDto) async
test('test addUsersToAlbum', () async {
// TODO
});
//
//
//Future<AlbumResponseDto> createAlbum(CreateAlbumDto createAlbumDto) async
test('test createAlbum', () async {
// TODO
});
//
//
//Future<SharedLinkResponseDto> createAlbumSharedLink(CreateAlbumShareLinkDto createAlbumShareLinkDto) async
test('test createAlbumSharedLink', () async {
// TODO
});
//
//
//Future deleteAlbum(String albumId) async
test('test deleteAlbum', () async {
// TODO
});
//
//
//Future<Object> downloadArchive(String albumId, { num skip }) async
test('test downloadArchive', () async {
// TODO
});
//
//
//Future<AlbumCountResponseDto> getAlbumCountByUserId() async
test('test getAlbumCountByUserId', () async {
// TODO
});
//
//
//Future<AlbumResponseDto> getAlbumInfo(String albumId) async
test('test getAlbumInfo', () async {
// TODO
});
//
//
//Future<List<AlbumResponseDto>> getAllAlbums({ bool shared, String assetId }) async
test('test getAllAlbums', () async {
// TODO
});
//
//
//Future<AlbumResponseDto> removeAssetFromAlbum(String albumId, RemoveAssetsDto removeAssetsDto) async
test('test removeAssetFromAlbum', () async {
// TODO
});
//
//
//Future removeUserFromAlbum(String albumId, String userId) async
test('test removeUserFromAlbum', () async {
// TODO
});
//
//
//Future<AlbumResponseDto> updateAlbumInfo(String albumId, UpdateAlbumDto updateAlbumDto) async
test('test updateAlbumInfo', () async {
// TODO

View File

@@ -17,26 +17,36 @@ void main() {
// final instance = APIKeyApi();
group('tests for APIKeyApi', () {
//
//
//Future<APIKeyCreateResponseDto> createKey(APIKeyCreateDto aPIKeyCreateDto) async
test('test createKey', () async {
// TODO
});
//
//
//Future deleteKey(num id) async
test('test deleteKey', () async {
// TODO
});
//
//
//Future<APIKeyResponseDto> getKey(num id) async
test('test getKey', () async {
// TODO
});
//
//
//Future<List<APIKeyResponseDto>> getKeys() async
test('test getKeys', () async {
// TODO
});
//
//
//Future<APIKeyResponseDto> updateKey(num id, APIKeyUpdateDto aPIKeyUpdateDto) async
test('test updateKey', () async {
// TODO

View File

@@ -31,21 +31,36 @@ void main() {
// TODO
});
//
//
//Future<SharedLinkResponseDto> createAssetsSharedLink(CreateAssetsShareLinkDto createAssetsShareLinkDto) async
test('test createAssetsSharedLink', () async {
// TODO
});
//
//
//Future<List<DeleteAssetResponseDto>> deleteAsset(DeleteAssetDto deleteAssetDto) async
test('test deleteAsset', () async {
// TODO
});
//
//
//Future<Object> downloadFile(String assetId, { bool isThumb, bool isWeb }) async
test('test downloadFile', () async {
// TODO
});
//
//
//Future<Object> downloadFiles(DownloadFilesDto downloadFilesDto) async
test('test downloadFiles', () async {
// TODO
});
//
//
//Future<Object> downloadLibrary({ num skip }) async
test('test downloadLibrary', () async {
// TODO
@@ -65,36 +80,50 @@ void main() {
// TODO
});
//
//
//Future<List<AssetResponseDto>> getAssetByTimeBucket(GetAssetByTimeBucketDto getAssetByTimeBucketDto) async
test('test getAssetByTimeBucket', () async {
// TODO
});
//
//
//Future<AssetCountByTimeBucketResponseDto> getAssetCountByTimeBucket(GetAssetCountByTimeBucketDto getAssetCountByTimeBucketDto) async
test('test getAssetCountByTimeBucket', () async {
// TODO
});
//
//
//Future<AssetCountByUserIdResponseDto> getAssetCountByUserId() async
test('test getAssetCountByUserId', () async {
// TODO
});
//
//
//Future<List<String>> getAssetSearchTerms() async
test('test getAssetSearchTerms', () async {
// TODO
});
//
//
//Future<Object> getAssetThumbnail(String assetId, { ThumbnailFormat format }) async
test('test getAssetThumbnail', () async {
// TODO
});
//
//
//Future<List<CuratedLocationsResponseDto>> getCuratedLocations() async
test('test getCuratedLocations', () async {
// TODO
});
//
//
//Future<List<CuratedObjectsResponseDto>> getCuratedObjects() async
test('test getCuratedObjects', () async {
// TODO
@@ -107,11 +136,15 @@ void main() {
// TODO
});
//
//
//Future<List<AssetResponseDto>> searchAsset(SearchAssetDto searchAssetDto) async
test('test searchAsset', () async {
// TODO
});
//
//
//Future<Object> serveFile(String assetId, { bool isThumb, bool isWeb }) async
test('test serveFile', () async {
// TODO
@@ -124,6 +157,15 @@ void main() {
// TODO
});
//
//
//Future<SharedLinkResponseDto> updateAssetsInSharedLink(UpdateAssetsToSharedLinkDto updateAssetsToSharedLinkDto) async
test('test updateAssetsInSharedLink', () async {
// TODO
});
//
//
//Future<AssetFileUploadResponseDto> uploadFile(MultipartFile assetData) async
test('test uploadFile', () async {
// TODO

View File

@@ -17,26 +17,36 @@ void main() {
// final instance = AuthenticationApi();
group('tests for AuthenticationApi', () {
//
//
//Future<AdminSignupResponseDto> adminSignUp(SignUpDto signUpDto) async
test('test adminSignUp', () async {
// TODO
});
//
//
//Future<UserResponseDto> changePassword(ChangePasswordDto changePasswordDto) async
test('test changePassword', () async {
// TODO
});
//
//
//Future<LoginResponseDto> login(LoginCredentialDto loginCredentialDto) async
test('test login', () async {
// TODO
});
//
//
//Future<LogoutResponseDto> logout() async
test('test logout', () async {
// TODO
});
//
//
//Future<ValidateAccessTokenResponseDto> validateAccessToken() async
test('test validateAccessToken', () async {
// TODO

View File

@@ -0,0 +1,42 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:openapi/api.dart';
import 'package:test/test.dart';
// tests for CreateAssetsShareLinkDto
void main() {
// final instance = CreateAssetsShareLinkDto();
group('test CreateAssetsShareLinkDto', () {
// List<String> assetIds (default value: const [])
test('to test the property `assetIds`', () async {
// TODO
});
// String expiredAt
test('to test the property `expiredAt`', () async {
// TODO
});
// bool allowUpload
test('to test the property `allowUpload`', () async {
// TODO
});
// String description
test('to test the property `description`', () async {
// TODO
});
});
}

View File

@@ -31,6 +31,8 @@ void main() {
// TODO
});
//
//
//Future<DeviceInfoResponseDto> upsertDeviceInfo(UpsertDeviceInfoDto upsertDeviceInfoDto) async
test('test upsertDeviceInfo', () async {
// TODO

View File

@@ -17,16 +17,22 @@ void main() {
// final instance = JobApi();
group('tests for JobApi', () {
//
//
//Future<AllJobStatusResponseDto> getAllJobsStatus() async
test('test getAllJobsStatus', () async {
// TODO
});
//
//
//Future<JobStatusResponseDto> getJobStatus(JobId jobId) async
test('test getJobStatus', () async {
// TODO
});
//
//
//Future<num> sendJobCommand(JobId jobId, JobCommandDto jobCommandDto) async
test('test sendJobCommand', () async {
// TODO

View File

@@ -17,26 +17,36 @@ void main() {
// final instance = OAuthApi();
group('tests for OAuthApi', () {
//
//
//Future<LoginResponseDto> callback(OAuthCallbackDto oAuthCallbackDto) async
test('test callback', () async {
// TODO
});
//
//
//Future<OAuthConfigResponseDto> generateConfig(OAuthConfigDto oAuthConfigDto) async
test('test generateConfig', () async {
// TODO
});
//
//
//Future<UserResponseDto> link(OAuthCallbackDto oAuthCallbackDto) async
test('test link', () async {
// TODO
});
//
//
//Future mobileRedirect() async
test('test mobileRedirect', () async {
// TODO
});
//
//
//Future<UserResponseDto> unlink() async
test('test unlink', () async {
// TODO

View File

@@ -17,21 +17,29 @@ void main() {
// final instance = ServerInfoApi();
group('tests for ServerInfoApi', () {
//
//
//Future<ServerInfoResponseDto> getServerInfo() async
test('test getServerInfo', () async {
// TODO
});
//
//
//Future<ServerVersionReponseDto> getServerVersion() async
test('test getServerVersion', () async {
// TODO
});
//
//
//Future<ServerStatsResponseDto> getStats() async
test('test getStats', () async {
// TODO
});
//
//
//Future<ServerPingResponse> pingServer() async
test('test pingServer', () async {
// TODO

View File

@@ -17,26 +17,36 @@ void main() {
// final instance = ShareApi();
group('tests for ShareApi', () {
//
//
//Future<SharedLinkResponseDto> editSharedLink(String id, EditSharedLinkDto editSharedLinkDto) async
test('test editSharedLink', () async {
// TODO
});
//
//
//Future<List<SharedLinkResponseDto>> getAllSharedLinks() async
test('test getAllSharedLinks', () async {
// TODO
});
//
//
//Future<SharedLinkResponseDto> getMySharedLink() async
test('test getMySharedLink', () async {
// TODO
});
//
//
//Future<SharedLinkResponseDto> getSharedLinkById(String id) async
test('test getSharedLinkById', () async {
// TODO
});
//
//
//Future<String> removeSharedLink(String id) async
test('test removeSharedLink', () async {
// TODO

View File

@@ -17,21 +17,29 @@ void main() {
// final instance = SystemConfigApi();
group('tests for SystemConfigApi', () {
//
//
//Future<SystemConfigDto> getConfig() async
test('test getConfig', () async {
// TODO
});
//
//
//Future<SystemConfigDto> getDefaults() async
test('test getDefaults', () async {
// TODO
});
//
//
//Future<SystemConfigTemplateStorageOptionDto> getStorageTemplateOptions() async
test('test getStorageTemplateOptions', () async {
// TODO
});
//
//
//Future<SystemConfigDto> updateConfig(SystemConfigDto systemConfigDto) async
test('test updateConfig', () async {
// TODO

View File

@@ -17,26 +17,36 @@ void main() {
// final instance = TagApi();
group('tests for TagApi', () {
//
//
//Future<TagResponseDto> create(CreateTagDto createTagDto) async
test('test create', () async {
// TODO
});
//
//
//Future delete(String id) async
test('test delete', () async {
// TODO
});
//
//
//Future<List<TagResponseDto>> findAll() async
test('test findAll', () async {
// TODO
});
//
//
//Future<TagResponseDto> findOne(String id) async
test('test findOne', () async {
// TODO
});
//
//
//Future<TagResponseDto> update(String id, UpdateTagDto updateTagDto) async
test('test update', () async {
// TODO

View File

@@ -0,0 +1,27 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:openapi/api.dart';
import 'package:test/test.dart';
// tests for UpdateAssetsToSharedLinkDto
void main() {
// final instance = UpdateAssetsToSharedLinkDto();
group('test UpdateAssetsToSharedLinkDto', () {
// List<String> assetIds (default value: const [])
test('to test the property `assetIds`', () async {
// TODO
});
});
}

View File

@@ -17,51 +17,71 @@ void main() {
// final instance = UserApi();
group('tests for UserApi', () {
//
//
//Future<CreateProfileImageResponseDto> createProfileImage(MultipartFile file) async
test('test createProfileImage', () async {
// TODO
});
//
//
//Future<UserResponseDto> createUser(CreateUserDto createUserDto) async
test('test createUser', () async {
// TODO
});
//
//
//Future<UserResponseDto> deleteUser(String userId) async
test('test deleteUser', () async {
// TODO
});
//
//
//Future<List<UserResponseDto>> getAllUsers(bool isAll) async
test('test getAllUsers', () async {
// TODO
});
//
//
//Future<UserResponseDto> getMyUserInfo() async
test('test getMyUserInfo', () async {
// TODO
});
//
//
//Future<Object> getProfileImage(String userId) async
test('test getProfileImage', () async {
// TODO
});
//
//
//Future<UserResponseDto> getUserById(String userId) async
test('test getUserById', () async {
// TODO
});
//
//
//Future<UserCountResponseDto> getUserCount({ bool admin }) async
test('test getUserCount', () async {
// TODO
});
//
//
//Future<UserResponseDto> restoreUser(String userId) async
test('test restoreUser', () async {
// TODO
});
//
//
//Future<UserResponseDto> updateUser(UpdateUserDto updateUserDto) async
test('test updateUser', () async {
// TODO