Skip to content
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

PE-6723: Release ArDrive v2.54.0 #1847

Merged
merged 19 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
24899f6
enhance upload ui by using new components
thiagocarvalhodev Sep 6, 2024
6285538
Merge branch 'PE-6654-assign-existing-name-and-undername-to-new-publi…
thiagocarvalhodev Sep 6, 2024
cab1582
Update upload_form.dart
thiagocarvalhodev Sep 6, 2024
9060f37
feat(upload UI)
thiagocarvalhodev Sep 9, 2024
6677e9a
Merge branch 'PE-6654-assign-existing-name-and-undername-to-new-publi…
thiagocarvalhodev Sep 9, 2024
ff60f0e
Merge branch 'PE-6654-fix-license-plus-arns-name' into PE-6654-new-up…
thiagocarvalhodev Sep 9, 2024
e82d599
fix modal for conflicting files
thiagocarvalhodev Sep 9, 2024
c9feb56
fix replace failed uploads modal
thiagocarvalhodev Sep 9, 2024
583c9b6
feat(upload ui)
thiagocarvalhodev Sep 9, 2024
a30434c
Merge branch 'PE-6654-assign-existing-name-and-undername-to-new-publi…
thiagocarvalhodev Sep 9, 2024
71f8b37
Update drive_explorer_item_tile.dart
thiagocarvalhodev Sep 9, 2024
b85d419
Update upload_cubit.dart
thiagocarvalhodev Sep 9, 2024
f41eb46
fix back button
thiagocarvalhodev Sep 9, 2024
fc470ad
Update assign_name_modal.dart
thiagocarvalhodev Sep 10, 2024
ff0dba9
Merge branch 'dev' into PE-6654-new-upload-UI
thiagocarvalhodev Sep 11, 2024
58f3378
Merge pull request #1833 from ardriveapp/PE-6654-new-upload-UI
thiagocarvalhodev Sep 11, 2024
53c2dae
Merge branch 'master' into PE-6723-release-ar-drive-v-2-54-0
thiagocarvalhodev Sep 11, 2024
277ddfb
bump version and release notes
thiagocarvalhodev Sep 11, 2024
053ba2b
Merge pull request #1846 from ardriveapp/PE-6723-release-ar-drive-v-2…
thiagocarvalhodev Sep 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/fastlane/metadata/android/en-US/changelogs/150.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Improved upload flow styling
16 changes: 11 additions & 5 deletions lib/arns/presentation/assign_name_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ class __NameSelectorDropdownState<T> extends State<_NameSelectorDropdown<T>> {
final colorTokens = ArDriveTheme.of(context).themeData.colorTokens;

double maxHeight;

double maxWidth = 500;
if (48 * widget.names.length.toDouble() > 240) {
maxHeight = 240;
} else if (widget.names.isEmpty) {
Expand All @@ -399,6 +399,10 @@ class __NameSelectorDropdownState<T> extends State<_NameSelectorDropdown<T>> {
maxHeight = 48 * widget.names.length.toDouble();
}

if (maxWidth >= MediaQuery.of(context).size.width) {
maxWidth = MediaQuery.of(context).size.width - 32;
}

return ArDriveDropdown(
hasBorder: false,
hasDivider: false,
Expand All @@ -409,7 +413,7 @@ class __NameSelectorDropdownState<T> extends State<_NameSelectorDropdown<T>> {
),
showScrollbars: true,
maxHeight: maxHeight,
items: _buildList(widget.names),
items: _buildList(widget.names, maxWidth),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand Down Expand Up @@ -439,7 +443,7 @@ class __NameSelectorDropdownState<T> extends State<_NameSelectorDropdown<T>> {
),
],
),
width: 500,
width: maxWidth,
height: 56,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
Expand Down Expand Up @@ -480,7 +484,7 @@ class __NameSelectorDropdownState<T> extends State<_NameSelectorDropdown<T>> {
return name;
}

List<ArDriveDropdownItem> _buildList(List<T> items) {
List<ArDriveDropdownItem> _buildList(List<T> items, double maxWidth) {
List<ArDriveDropdownItem> list = [];

for (var item in items) {
Expand All @@ -494,13 +498,15 @@ class __NameSelectorDropdownState<T> extends State<_NameSelectorDropdown<T>> {
},
content: Container(
alignment: Alignment.centerLeft,
width: 500,
width: maxWidth,
height: 48,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Text(
_getName(item),
style: ArDriveTypographyNew.of(context).paragraphLarge(),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
),
Expand Down
45 changes: 32 additions & 13 deletions lib/blocs/upload/upload_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ class UploadCubit extends Cubit<UploadState> {
showArnsNameSelectionCheckBoxValue = showArnsNameSelection;
}

void showArnsNameSelection() {
emit((state as UploadReady).copyWith(showArnsNameSelection: true));
void showArnsNameSelection(UploadReady readyState) {
emit(readyState.copyWith(showArnsNameSelection: true));
}

void hideArnsNameSelection() {
emit((state as UploadReady).copyWith(showArnsNameSelection: false));
void hideArnsNameSelection(UploadReady readyState) {
emit(readyState.copyWith(showArnsNameSelection: false));
}

void setUploadMethod(
Expand Down Expand Up @@ -118,7 +118,8 @@ class UploadCubit extends Cubit<UploadState> {
isDragNDrop: isDragNDrop,
isNextButtonEnabled: canUpload,
isArConnect: (state as UploadReadyToPrepare).isArConnect,
showArnsCheckbox: hasUndernames && files.length == 1,
showArnsCheckbox:
hasUndernames && files.length == 1 && _targetDrive.isPublic,
showArnsNameSelection: false,
),
);
Expand All @@ -128,7 +129,7 @@ class UploadCubit extends Cubit<UploadState> {
void initialScreenUpload() {
if (state is UploadReady) {
if (showArnsNameSelectionCheckBoxValue) {
showArnsNameSelection();
showArnsNameSelection(state as UploadReady);
} else {
final readyState = state as UploadReady;
startUpload(
Expand Down Expand Up @@ -201,6 +202,13 @@ class UploadCubit extends Cubit<UploadState> {
licenseCategory: licenseCategory,
);
emit(prevState);
} else if (state is UploadReviewWithArnsName) {
final reviewWithArnsName = state as UploadReviewWithArnsName;
final readyState = reviewWithArnsName.readyState.copyWith(
showArnsNameSelection: false,
);

emit(readyState);
}
}

Expand All @@ -214,6 +222,8 @@ class UploadCubit extends Cubit<UploadState> {
reviewWithLicense.readyState.paymentInfo.uploadPlanForTurbo,
licenseStateConfigured: reviewWithLicense.licenseState,
);
} else if (state is UploadReviewWithArnsName) {
startUploadWithArnsName();
}
}

Expand Down Expand Up @@ -575,15 +585,23 @@ class UploadCubit extends Cubit<UploadState> {

logger.d('Selected undername: $_selectedUndername');

final readyState = state as UploadReady;
final readyState = (state as UploadReady).copyWith(
params: (state as UploadReady).params.copyWith(
arnsUnderName: getSelectedUndername(),
),
);

emit(readyState.copyWith(
showArnsNameSelection: false,
));
emit(UploadReviewWithArnsName(readyState: readyState));
}

void startUploadWithArnsName() {
final reviewWithArnsName = state as UploadReviewWithArnsName;

startUpload(
uploadPlanForAr: readyState.paymentInfo.uploadPlanForAR!,
uploadPlanForTurbo: readyState.paymentInfo.uploadPlanForTurbo,
uploadPlanForAr:
reviewWithArnsName.readyState.paymentInfo.uploadPlanForAR!,
uploadPlanForTurbo:
reviewWithArnsName.readyState.paymentInfo.uploadPlanForTurbo,
);
}

Expand Down Expand Up @@ -927,13 +945,14 @@ class UploadCubit extends Cubit<UploadState> {
(tasks) async {
if (tasks.length == 1) {
final task = tasks.first;
if (task is FileUploadTask) {
if (task is FileUploadTask && task.status != UploadStatus.canceled) {
final metadata = task.metadata;
if (_selectedAntRecord != null || _selectedUndername != null) {
final updatedTask = task.copyWith(
status: UploadStatus.assigningUndername,
);

/// Emits
emit(
UploadInProgressUsingNewUploader(
progress: UploadProgress(
Expand Down
6 changes: 6 additions & 0 deletions lib/blocs/upload/upload_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ class UploadConfiguringLicense extends UploadState {
'UploadConfiguringLicense { paymentInfo: ${readyState.paymentInfo} }';
}

class UploadReviewWithArnsName extends UploadState {
final UploadReady readyState;

UploadReviewWithArnsName({required this.readyState});
}

/// [UploadReviewWithLicense] means that the upload + license is being reviewed by the user and awaiting confirmation to begin upload.
class UploadReviewWithLicense extends UploadState {
final UploadReady readyState;
Expand Down
Loading
Loading