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

Fixed count, error state and created empty state component for scheduled post and draft #8626

Open
wants to merge 12 commits into
base: scheduled-post-options
Choose a base branch
from

Conversation

Rajat-Dabade
Copy link
Contributor

Summary

Ticket Link

Checklist

  • Added or updated unit tests (required for all new features)
  • Has UI changes
  • Includes text changes and localization file updates
  • Have tested against the 5 core themes to ensure consistency between them.
  • Have run E2E tests by adding label E2E iOS tests for PR.

Device Information

This PR was tested on:

Screenshots

Release Note


@Rajat-Dabade Rajat-Dabade marked this pull request as ready for review February 24, 2025 08:30
@Rajat-Dabade Rajat-Dabade self-assigned this Feb 24, 2025
@Rajat-Dabade Rajat-Dabade added the 2: Dev Review Requires review by a core commiter label Feb 24, 2025
const preferences = queryDisplayNamePreferences(database).
observeWithColumns(['value']);
const isMilitaryTime = preferences.pipe(map((prefs) => getDisplayNamePreferenceAsBool(prefs, 'use_military_time')));

// TODO: fix the count for DM's and GM's and Thread
Copy link
Member

Choose a reason for hiding this comment

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

Can you create a Jira ticket to track this is planing to do it later?

const preferences = queryDisplayNamePreferences(database).
observeWithColumns(['value']);
const isMilitaryTime = preferences.pipe(map((prefs) => getDisplayNamePreferenceAsBool(prefs, 'use_military_time')));

// TODO: fix the count for DM's and GM's and Thread
const scheduledPostCount = currentTeamId.pipe(switchMap((teamId) => observeScheduledPostCountForChannel(database, teamId, channelId)));
Copy link
Member

Choose a reason for hiding this comment

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

  1. We need to include thread ID as well (root post's ID) as when in a thread, we need to show only that thread's count. Similarly when in channels, we need to exclude thread scheduled posts from the count.

  2. You also need to fetch the scheduled post if count is 1, and replace the hardcoded value in the component where there's a todo //TODO: remove this hardcoded value with actual value with the scheduled post's scheduled at time. We need to display that time if there is only a single scheduled post in channel/thread.

Copy link
Contributor

Choose a reason for hiding this comment

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

Only when crt is enabled, correct?

Copy link
Contributor Author

@Rajat-Dabade Rajat-Dabade Feb 25, 2025

Choose a reason for hiding this comment

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

Yup, added crt checks as well.

scheduledPostCount = observeScheduledPostCountForDMsAndGMs(database, channelId, isCRTEnabled);
} else if (channelType === 'O' && channelId) {
scheduledPostCount = currentTeamId.pipe(switchMap((teamId) => observeScheduledPostCountForChannel(database, teamId, channelId, isCRTEnabled)));
} else if (rootId) {
Copy link
Member

Choose a reason for hiding this comment

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

If its a thread in open channel, the code will go the the above else if, not this else, right? That looks wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have reverted the code, Now we will be checking firstly if rootId is present or not, if present that means we have to extract the count of the thread. If not then extract the count of the channel, DMs and GMs.

@Rajat-Dabade Rajat-Dabade force-pushed the empty-state-scheduled-post branch from 1bdb012 to 39e11d0 Compare February 25, 2025 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core commiter release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants