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

Support administrative_contact and technical_contact in the Console #6162

Merged
merged 37 commits into from
Jul 26, 2023

Conversation

ryaplots
Copy link
Contributor

@ryaplots ryaplots commented Apr 17, 2023

Summary

Closes #6112

Changes

  • Add contacts to relevant entities.
Screenshots Screenshot 2023-07-10 at 11 22 15 Screenshot 2023-07-10 at 11 22 05

Testing

Manually

Notes for Reviewers

I decided to add this in the entity general settings, as this is the place where I have access to the collaborator's rights for the entity, and not in the user settings as we initially thought.

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@github-actions github-actions bot added the ui/web This is related to a web interface label Apr 17, 2023
@kschiffer
Copy link
Contributor

I think we'll have to rework the UX here a bit. See also my comment here:
#6112 (comment)

I'll look into this later this week/next week. Should not affect the implementation as a whole too much though.

@adriansmares adriansmares changed the base branch from v3.25 to v3.26 May 5, 2023 10:05
@kschiffer
Copy link
Contributor

Currently blocked, so reopening once #6112 is merged.

@kschiffer kschiffer closed this Jun 19, 2023
@ryaplots
Copy link
Contributor Author

ryaplots commented Jul 7, 2023

This is unblocked.

@ryaplots ryaplots reopened this Jul 7, 2023
@ryaplots ryaplots changed the base branch from v3.26 to v3.27 July 7, 2023 10:14
@ryaplots ryaplots added the in progress We're working on it label Jul 7, 2023
@ryaplots ryaplots force-pushed the feature/admin-tech-contacts branch from 151aa13 to 44d54ba Compare July 10, 2023 09:02
@ryaplots ryaplots requested a review from kschiffer July 18, 2023 13:24
@adriansmares
Copy link
Contributor

Does this take in account that in certain deployments collaborators can set only themselves as contacts, but not others (#6378) ?

@ryaplots
Copy link
Contributor Author

Does this take in account that in certain deployments collaborators can set only themselves as contacts, but not others (#6378) ?

Should we inform those users of that, with a notification? @kschiffer

@kschiffer
Copy link
Contributor

kschiffer commented Jul 20, 2023

As far as I understand, we can determine this based on the IS configration fetched from the backend. If indeed the user fan only set itself, the console should deactivate the selector field and render a button 'Set yourself as contact' to the fields. Clicking the button will then put the user into the field.

There should also be a notification above the field saying:

You can only set yourself as a contact. If you would like another collaborator set as contact, please contact this collaborator to self-assign as contact.

@ryaplots ryaplots force-pushed the feature/admin-tech-contacts branch from 9876218 to 284993b Compare July 20, 2023 14:20
Copy link
Contributor

@kschiffer kschiffer left a comment

Choose a reason for hiding this comment

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

EDIT: Disregard; didn't pull latest changes.

@kschiffer
Copy link
Contributor

diff --git a/pkg/webui/lib/store/selectors/collaborators.js b/pkg/webui/lib/store/selectors/collaborators.js
index 8293e4f83..940b6f468 100644
--- a/pkg/webui/lib/store/selectors/collaborators.js
+++ b/pkg/webui/lib/store/selectors/collaborators.js
@@ -12,6 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+import { createSelector } from 'reselect'
+
 import { createFetchingSelector } from '@ttn-lw/lib/store/selectors/fetching'
 import { createErrorSelector } from '@ttn-lw/lib/store/selectors/error'
 import {
@@ -59,8 +61,10 @@ const createSelectCollaboratorsFetchingSelector = createFetchingSelector(
 )
 const createSelectCollaboratorsErrorSelector = createErrorSelector(GET_COLLABORATORS_LIST_BASE)
 
-export const selectCollaborators = state =>
-  createSelectCollaboratorsIdsSelector(state).map(id => selectCollaboratorById(state, id))
+export const selectCollaborators = createSelector(
+  [createSelectCollaboratorsIdsSelector, selectCollaboratorsEntitiesStore],
+  (collaboratorIds, collaborators) => collaboratorIds.map(id => collaborators[id]),
+)
 export const selectCollaboratorsTotalCount = state =>
   createSelectCollaboratorsTotalCountSelector(state)
 export const selectCollaboratorsFetching = state => createSelectCollaboratorsFetchingSelector(state)

Please also apply this change to remove the warning in the Console, and please make sure to not ignore warnings:
image

@ryaplots ryaplots merged commit 33a4146 into v3.27 Jul 26, 2023
@ryaplots ryaplots deleted the feature/admin-tech-contacts branch July 26, 2023 08:21
@KrishnaIyer KrishnaIyer added this to the v3.27.1 milestone Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui/web This is related to a web interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support administrative_contact and technical_contact in the Console
4 participants