Skip to content

Conversation

@taoerman
Copy link
Member

Summary

  1. Updated the Submit to Community Library side panel UI according to the issue's specs.
  2. Backend supports multiple submissions ; users can resubmit with the same channel and version without deleting existing records, with all PENDING submissions kept in the review queue.

References

Fixes #5450

Reviewer guidance

run new unit tests;
test the updated UI manually.

Copy link
Member

@AlexVelezLl AlexVelezLl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @taoerman!! This is looking :chefs-kiss:. I've found a couple of minor issues that can be improved, but overall, this looks great!!

.box {
padding: 8px;
color: v-bind('boxTextColor');
padding: 12px 16px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the box should have a vertical and horizontal padding of 10px to match the specs styles.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! Thanks!

class="box-content"
>
<div class="box-icon">
<KIcon :icon="icon" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we set the font-size of this icon to 18px? Right now, it feels a bit small compared to the spec.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it! Thanks!

v-else-if="latestSubmissionIsFinished"
class="info-section"
>
<div class="info-text">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we set the color of this node to gray.v_700 to match the specs? Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it! Thanks!

Comment on lines 42 to 48
<div
class="more-details-link"
data-test="more-details-button"
@click="showingMoreDetails = true"
>
{{ moreDetailsButton$() }}
</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use the KButton component with the appearance set to basic-link? That'd work fine, although the specs do not look as a link, but it's okay.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it! Thanks!

<div class="info-text">
<template v-if="latestSubmissionStatus === null">
<template v-if="showingMoreDetails">
<div>{{ infoBoxPrimaryText }} {{ moreDetails$() }}</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we show the moreDetails$ in a different paragraph? Rather than having it next to the primary text, separated by a space.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it! Thanks!

<div class="channel-title">{{ channel.name }}</div>
<div>
<div class="field-annotation">{{ languagesDetected$() }}</div>
<div class="channel-title">{{ channel.name }} v{{ channel.version }}</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having the title string composed by

{{ channel.name }} v{{ channel.version }} is not internationalizable, because if in any other languages a different character is used to separate text, or a different character is used to display versions, then this structure won't apply.

I think we can perhaps create a new "channelVersion$" string that receives the channel name and its version, so it can be translated properly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Alex, I created a placeholders {name} and {version} in communityChannelsStrings.js.

);
const canBeEdited = computed(() => {
if (!isPublished.value || isPublic.value) return false;
return !isCurrentVersionAlreadySubmitted.value || needsReplacementConfirmation.value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, I think we can allow editing the form, but prevent the user from submitting it, so they don't have to check this first before editing anything else in the modal.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it, Thanks!

Comment on lines 426 to 427
replacementConfirmed.value = false;
description.value = '';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to clear these values here. Because by this point, the modal was already unmounted, it doesn't make any difference.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it, Thanks!

Comment on lines 594 to 599
color: #4368f5;
cursor: pointer;
}
.more-details-link:hover {
color: #4368f5;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these styles will be removed because we may use KButton instead, but just as a general note: Something very weird should happen for us to use burned colors, in the vast majority of cases, we will always use the themeTokens or themePalette colors.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it, Thanks!

Comment on lines 2677 to 2682
constraints = [
models.UniqueConstraint(
fields=["channel", "channel_version"],
name="unique_channel_with_channel_version",
),
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, it seems I didn't explain this well 😅. Apologies. This constraint still applies; we should not allow creating multiple submissions of the same channel version. If the user wants to create a new submission for the same channel, they must publish a new version first.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. There is little issue I found if we still use props.channel.version to get channel version, it would get the previous channel version. So I used a computed property of currentChannel to instead of. It works much better than props.channel.version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Alex, I have fixed the logic of checkbox. Only show checkbox if there's a pending submission AND the version has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Info messages about previous submissions in create submission side panel

2 participants