-
Notifications
You must be signed in to change notification settings - Fork 296
Add submission details page #5716
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
Open
AlexVelezLl
wants to merge
13
commits into
learningequality:unstable
Choose a base branch
from
AlexVelezLl:new-channel-details
base: unstable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,533
−143
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
025f6b0
Add page setup and channel info header
AlexVelezLl 1eadd00
Add Channel details accordion
AlexVelezLl c54fb2e
Add ActivityHistory component
AlexVelezLl a060864
Add activity line
AlexVelezLl 034be9b
Polish submission details modal
AlexVelezLl 3e555fc
Display SubmissionDetailsModal on channel admin table
AlexVelezLl efa791b
Fix StudioImmersiveModal always hiding html scroll
AlexVelezLl 71cd097
Refactor and rename Accordion component
AlexVelezLl 410ced7
Fix failing tests
AlexVelezLl 55bea6c
Store notifications tab on route
AlexVelezLl 8cead6d
Address PR comments
AlexVelezLl daeb11a
Align with figma specs
AlexVelezLl ca24715
address PR comments
AlexVelezLl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| <template> | ||
|
|
||
| <SidePanelModal | ||
| v-if="isModalVisible" | ||
| alignment="right" | ||
| sidePanelWidth="700px" | ||
| @closePanel="$emit('close')" | ||
|
|
@@ -20,7 +21,15 @@ | |
| class="submission-info-text" | ||
| > | ||
| <span class="author-name">{{ authorName }}</span> | ||
| <div class="editor-chip">Editor</div> | ||
| <div | ||
| class="editor-chip" | ||
| :style="{ | ||
| color: chipTextColor, | ||
| backgroundColor: chipColor, | ||
| }" | ||
| > | ||
| Editor | ||
| </div> | ||
| <span> | ||
| submitted | ||
| <ActionLink | ||
|
|
@@ -39,7 +48,10 @@ | |
| <div v-else>Error loading submission data.</div> | ||
|
|
||
| <div class="details"> | ||
| <span class="detail-annotation">Country(s)</span> | ||
| <span | ||
| class="detail-annotation" | ||
| :style="{ color: annotationColor }" | ||
| >Country(s)</span> | ||
| <span | ||
| v-if="countriesString" | ||
| data-test="countries" | ||
|
|
@@ -49,7 +61,10 @@ | |
| <template v-else> | ||
| <KEmptyPlaceholder /> | ||
| </template> | ||
| <span class="detail-annotation">Language(s)</span> | ||
| <span | ||
| class="detail-annotation" | ||
| :style="{ color: annotationColor }" | ||
| >Language(s)</span> | ||
| <span | ||
| v-if="languagesString" | ||
| data-test="languages" | ||
|
|
@@ -59,7 +74,10 @@ | |
| <template v-else> | ||
| <KEmptyPlaceholder /> | ||
| </template> | ||
| <span class="detail-annotation">Categories</span> | ||
| <span | ||
| class="detail-annotation" | ||
| :style="{ color: annotationColor }" | ||
| >Categories</span> | ||
| <span | ||
| v-if="categoriesString" | ||
| data-test="categories" | ||
|
|
@@ -69,7 +87,10 @@ | |
| <template v-else> | ||
| <KEmptyPlaceholder /> | ||
| </template> | ||
| <span class="detail-annotation">License(s)</span> | ||
| <span | ||
| class="detail-annotation" | ||
| :style="{ color: annotationColor }" | ||
| >License(s)</span> | ||
| <span | ||
| v-if="licensesString" | ||
| data-test="licenses" | ||
|
|
@@ -79,7 +100,10 @@ | |
| <template v-else> | ||
| <KEmptyPlaceholder /> | ||
| </template> | ||
| <span class="detail-annotation">Status</span> | ||
| <span | ||
| class="detail-annotation" | ||
| :style="{ color: annotationColor }" | ||
| >Status</span> | ||
| <div | ||
| v-if="submissionIsFinished" | ||
| style="display: flex" | ||
|
|
@@ -91,8 +115,16 @@ | |
| </template> | ||
| </div> | ||
|
|
||
| <div class="box"> | ||
| <h3 class="box-title">Submission notes</h3> | ||
| <div | ||
| class="box" | ||
| :style="{ backgroundColor: boxBackgroundColor }" | ||
| > | ||
| <h3 | ||
| class="box-title" | ||
| :style="{ color: boxTitleColor }" | ||
| > | ||
| Submission notes | ||
| </h3> | ||
| <span | ||
| v-if="submissionNotes" | ||
| data-test="submission-notes" | ||
|
|
@@ -239,6 +271,7 @@ | |
| CommunityLibraryStatusChip, | ||
| }, | ||
| setup(props, { emit }) { | ||
| const isModalVisible = ref(true); | ||
| const tokensTheme = themeTokens(); | ||
| const paletteTheme = themePalette(); | ||
|
|
||
|
|
@@ -476,6 +509,8 @@ | |
|
|
||
| showSnackbar({ text: snackbarText }); | ||
| updateStatusInStore(statusChoice.value); | ||
| emit('change'); | ||
| emit('close'); | ||
| } catch (error) { | ||
| showSnackbar({ text: 'Changing channel status failed' }); | ||
| } finally { | ||
|
|
@@ -489,13 +524,19 @@ | |
| actionText: 'Cancel', | ||
| actionCallback: () => { | ||
| clearTimeout(timer); | ||
| // Do not emit close just yet, so that the component isn't unmounted | ||
| // this will keep the component live until the submit function finishes, allowing | ||
| // to keep communicating with the parent component, and in particular allowing the | ||
| // "change" event to be emitted. It also allows us to keep the working information | ||
| // on the component, and show the side panel in the same state if the user cancels | ||
| isModalVisible.value = true; | ||
|
Comment on lines
+527
to
+532
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was the best way I found to manage this. It is similar to what we were doing initially for the BUM side panels, where the side panel component was still live until the user rejected the "undo" modal. |
||
| currentlySubmitting.value = false; | ||
| showSnackbar({ | ||
| text: 'Action cancelled', | ||
| }); | ||
| }, | ||
| }); | ||
|
|
||
| emit('close'); | ||
| isModalVisible.value = false; | ||
| } | ||
|
|
||
| const chipColor = computed(() => paletteTheme.grey.v_200); | ||
|
|
@@ -519,6 +560,7 @@ | |
|
|
||
| return { | ||
| isLoading, | ||
| isModalVisible, | ||
| chipColor, | ||
| chipTextColor, | ||
| annotationColor, | ||
|
|
@@ -596,8 +638,6 @@ | |
| height: 20px; | ||
| padding: 2px 5px; | ||
| font-size: 10px; | ||
| color: v-bind('chipTextColor'); | ||
| background-color: v-bind('chipColor'); | ||
| border-radius: 16px; | ||
| } | ||
|
|
||
|
|
@@ -612,15 +652,13 @@ | |
|
|
||
| .detail-annotation { | ||
| grid-column-start: 1; | ||
| color: v-bind('annotationColor'); | ||
| } | ||
|
|
||
| .box { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 8px; | ||
| padding: 12px; | ||
| background-color: v-bind('boxBackgroundColor'); | ||
| border-radius: 8px; | ||
| } | ||
|
|
||
|
|
@@ -634,7 +672,6 @@ | |
| .box-title { | ||
| font-size: 12px; | ||
| font-weight: 600; | ||
| color: v-bind('boxTitleColor'); | ||
| } | ||
|
|
||
| .details-box-title { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It seems that
v-bindhas some difficulties when the nodes their styles are applied to are removed from the DOM, and then reinserted again. (In this case thev-if=isModalVisibleupdate made it appear). It seems that when the nodes are removed, the CSS variables are removed too, but if they are re-inserted, the CSS variables are not. So, just came back these colors to be declared in inline styles. And flagging that this is something that can happen with Vue 2.7's v-bind method.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.
Interesting - feels like that's some magic that's happening under the hood when Vue SFCs are compiled and have v-binds in them!
Seems like it may make this less useful overall, unfortunately!
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.
Unfortunately, yes :/. Perhaps this is solved in Vue 3, let's see.