Skip to content

Conversation

JPKribs
Copy link
Member

@JPKribs JPKribs commented Dec 11, 2024

Summary

This creates a view to edit existing Access Schedules for a User and Add a new schedule to a user. Schedules are periods of time where a user is allowed to access Jellyfin and consists of a Start Time, End Time, and a Day/DayOfWeek.

🎉 This is the last new PR needed for the Admin Dashboard. 🎉

Context below:

I still need to work out the User Profile Picture & Username on #1328 but change reworks some existing code so I'd like to focus on that and knock it all out in one go. This PR can sit for a bit since it's new functionality I can weave into other PRs without too many merge items.

Access Tags are still on the list but I'm considering moving that to a later date since BlockedTags exists in 10.8 but AllowedTags need 10.10 (Maybe 10.9?) SDK to work. This means I would need to come back later to finish this regardless so I would feel better just doing it all at once when we're on the 10.10 SDK.

Screenshots

View View
Single Delete Single Delete
Multi-Select Multi-Select
Add View Add View
Dropdown Dropdown
Duplicate Schedule Duplicate Schedule

@JPKribs JPKribs marked this pull request as ready for review December 12, 2024 02:07
@JPKribs
Copy link
Member Author

JPKribs commented Dec 12, 2024

This should be ready to go. The only thing missing I would like to do is that the current version of this spits out an error if you save a duplicate. I would rather this worked like how the AddServerTaskTrigger works:

Screenshot 2024-12-11 at 19 08 27

The only reason I wasn't able to do this is because the AccessSchedule's StartHour and EndHour formats are just bad. Instead of a regular time, or dateTime, or even ticks, it's represented as ##.#. So, 10:30pm is 22.5. As a result of this, I have to add in some extra processing on Save to make get this into format. So getting it from Date Components to String or from Date to Double I couldn't find a clean way to appropriately check if an Access Schedule existed.

I settled on the error on creation which is more than we're currently doing for web now but if there is a smarter way to handle this where it's more preemptive that would be ideal.

There is a tiny bit of cleanup where I'm trying to get the Admin Dashboard to be a little less chaotic. So, I've taken this for both the Server Tasks and the Server User Access Schedules since they have Edit & Add Views:
Screenshot 2024-12-11 at 19 12 16

@JPKribs JPKribs changed the title [WIP] [iOS] Admin Dashboard - User Access Schedules [iOS] Admin Dashboard - User Access Schedules Dec 12, 2024
Copy link
Member

@LePips LePips left a comment

Choose a reason for hiding this comment

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

Implemented being able to check for duplicate schedules and some cleanup.

This list should also have been insetGrouped (automatic) because it isn't showing much complex information like users, devices, or media elements do. This more closely matches the task triggers and custom device profiles. Also, having the Add button in the list for empty data cases helps so that the user doesn't have to go through the menu and matches other design like for the task triggers and custom device profiles. I missed checking this stuff on EditItemElementView, but that needs to be migrated to this as well.

Also, I reverted the Add trigger -> Add Trigger casing. I haven't been strong on casing before, but I think we should strongly move to Sentence case over Title Case where appropriate. I may have missed other casing changes before but don't want to move pre-existing strings to Title Case for now.

@LePips LePips merged commit d001a96 into jellyfin:main Dec 12, 2024
4 checks passed
@JPKribs JPKribs deleted the serverUserSchedule branch December 12, 2024 20:47
ddrccw added a commit to ddrccw/Swiftfin that referenced this pull request Jan 26, 2025
* upstream/main: (392 commits)
  [tvOS] Add pin prompt to sign-in screen (jellyfin#1383)
  [iOS] Admin Dashboard - User Access Tags (jellyfin#1377)
  [Meta] 2025 Disclaimer (jellyfin#1381)
  [tvOS] Delete User from User Selection Screen (jellyfin#1359)
  [iOS] Media Item Menu - Identify Media Item (jellyfin#1369)
  [iOS] Admin Dashboard - User Profiles (jellyfin#1328)
  [iOS] Select all Users When Editing (jellyfin#1373)
  [Meta] Automatic String Organization (jellyfin#1372)
  [iOS & tvOS] Unused Localization Cleanup (jellyfin#1362)
  [tvOS] SelectServerView Change to Menu (jellyfin#1363)
  [tvOS] Update ConnectToServerView & UserSignInView (jellyfin#1365)
  Trim Fastlane Options (jellyfin#1367)
  Update Fastlane Runner (jellyfin#1366)
  [iOS & tvOS] Localize Existing Strings (jellyfin#1361)
  [iOS] Admin Dashboard - User Access Schedules (jellyfin#1358)
  [iOS] Admin Dashboard - Parental Ratings (jellyfin#1353)
  [iOS & tvOS] Error Cleanup (jellyfin#1357)
  update (jellyfin#1356)
  Fix possible duplicate ids (jellyfin#1354)
  [tvOS] Media Item Menu - Refresh / Delete Items (jellyfin#1348)
  ...

Signed-off-by: ddrccw <ddrccw@gmail.com>
@JPKribs JPKribs added the enhancement New feature or request label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants