Giter Site home page Giter Site logo

mattermost-community / mattermost-plugin-custom-attributes Goto Github PK

View Code? Open in Web Editor NEW
45.0 39.0 22.0 33.53 MB

Mattermost plugin for adding custom attributes to users!

License: Apache License 2.0

Makefile 14.45% Go 35.40% JavaScript 42.26% TypeScript 7.89%
hacktoberfest mattermost mattermost-plugin

mattermost-plugin-custom-attributes's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mattermost-plugin-custom-attributes's Issues

Group Id field should be hidden from UI when not applicable with current license

When a server is running Team Edition the Admin UI will still show the Group ID field for Custom Attributes configuration.

This is of no value as LDAP group sync is unavailable and is confusing to use.

Group ID field should only be available when the current licence supports LDAP groups.


LDAP Groups are available in Enterprise Edition. In order to test the changes in this ticket, please open a PR as WIP first and a Mattermost Core Comitter can set up an EE server for testing.

Blank GroupIDs cause a Go error when parsing the config.

Summary

If you leave the groupIDs blank in the config and save, it stores the value as a string instead of an empty array. This throws an error when the plugin loads.

Steps to reproduce

Add a custom attribute without a group ID, save. Restart mattermost.

Expected behavior

Everything appears to work, just this error is thrown in the mattermost.log

Observed behavior

Error:

{"level":"info","ts":1626363133.3211172,"caller":"[email protected]/stream.go:15","msg":"2021/07/15 15:32:13 LoadPluginConfiguration API failed to unmarshal: json: cannot unmarshal string into Go struct field CustomAttribute.CustomAttributes.GroupIDs of type []string","plugin_id":"com.mattermost.custom-attributes","source":"plugin_stderr"}

Below is how it renders in the config.json

{
                        "GroupIDs": "",
                        "Name": "test",
                        "TeamIDs": [
                            "1wke6g5u5i8d8y58eax4yr66eo"
                        ],
                        "UserIDs": [
                            "sda1qerd3jrzpdpe1tmarejthh"
                        ]
                    }

Possible fixes

This error is removed when you replace the config.json with the below:

{
                        "GroupIDs": [],
                        "Name": "test",
                        "TeamIDs": [
                            "1wke6g5u5i8d8y58eax4yr66eo"
                        ],
                        "UserIDs": [
                            "sda1qerd3jrzpdpe1tmarejthh"
                        ]
                    }

https://github.com/mattermost/mattermost-plugin-custom-attributes/blob/2800ede9ab3d5be1eaefb0b6701369c2d1a88737/webapp/src/components/admin_settings/custom_attribute_settings.jsx#L111

This seems like we can swap the default '' to a [] and this is resolved. I tested this locally and this appeared to fix the issue with no impacts.

When Attribute has ":" and no spaces it renders as a link

To Reproduce:

  • Create an Atrribute such as "Timezone:PST"
  • Save
  • look at ausers profile popover, it is a link that opens a blank tab.
  • If you add a space between the text and the ":" it no longer renders as a link.

Expected:
Don't render as a link even if no spaces.

Custom Profile Attributes are not showing up

Hi, I can't get the custom user attributes plugin to work. Here's what I did:

  1. enabled the plugin in admin console.
  2. I added the example here (but I did not add groupId because I'm not sure what groupId is).
  3. Restarted the server with sudo systemctl restart mattermost and then I click on a user, and my custom attribute did not show up.

Version 5.20.1
Schema Version: 5.20.0
Postgres

Custom attributes visible next to user's name

Hi everyone,

I'm looking for a mattermost plugin that allows decorating the user's name with arbitrary messages/symbols/emoji representing different status in the community.
If using emoji, these could be ⭐ (moderators), πŸ‘ (supporters), and so on.

The current plugin already provides most of the customization capabilities I'm after but I do not see any mention of the ability to display the information next to the user's name.
Note that by this I mean, shown next to the name on every message written by the user, not in the floating pop-up with the profile information.

Is this something that can be achieved with the current plugin and/or mattermost's customization capabilities?

Thanks

When there is 2 custom attribute and i delete 1st attribute then i delete the 2nd attribute then i'm not able to delete the 2nd attribute.

Steps :- 1) Create 2 attribute.
2) Now delete 1st attribute by click on the delete button.
3) now click on the delete icon of the 2nd attribute
issue:- Now Confirmation popup will not visible and user will get the error in the Console, but if the user delete 2nd attribute then delete 1st attribute then issue will not generate.
IMG_20211028_163735

When.there.is.2.custome.attribute.and.i.delete.1st.attribute.then.i.delete.the.2nd.attribute.then.i.m.not.able.to.delete.the.2nd.attribute.mp4

Unable to add attribute: users and team names are not recognized

Hi,
I am unable to add a custom attribute.
I want to set the team name, but it is not recognized (it is registered as DSIMB in mattermost), neither are usernames (I tried with and without "@").

image

Here are versions infos (I installed mattermost via docker-compose):

root@www:~# docker exec -it b0fde455f218 mattermost version
Version: 5.30.0
Build Number: 5.30.0
Build Date: Fri Dec 18 06:52:48 UTC 2020
Build Hash: 25659c5b436aac171aedbee39ded4bc2ffac9838
Build Enterprise Ready: true
DB Version: 5.31.0

(I have Mattermost EE, without license key, the edition is not activated)

attribute from SAML

Would be great if the attribute can be linked to a SAML value. Not all values make sense as groups e.g. Manager for someones direct manager would not be a group I would bring in but would be awesome to be able to show it on user popups.

Unable to add Team selection to a custom attribute

When adding or updating a custom attribute the team selection no longer finds any results even when there are team names that mach the search parameter.

Steps:

  • Build and deploy the master branch of the plugin
  • Note the name of an existing team ex: dkh
  • Navigate to custom attribute settings
  • Add a new custom attribut
  • search for dkh as a team to target with the custom attribute
    Expected: DKH is returned
    Observed:
    A. No teams are returned
    B. Console shows a 400 error
    image

Add confirmation prompt when deleting a custom attributes record

When a custom attribute us deleted from the system console, no confirmation dialogue is shown to prevent user error. Since this action can't be undone (and the record could contain long cryptic lists of metadata), there should be a prompt top prevent deleting an attribute by mistake.

Steps:

  • Navigate to the admin side UI and select, Custom Attributes from the LHS
  • Create a custom attribute
  • Click the delete icon on the far right

Observed: Attribute is immediately deleted
Expected: delete confirmation dialogue

Custom Attributes data in user pop-over does not automatically update and requires refresh

When Custom Attributes data is updated, the updated version is not shown until you refresh the client.

This reproduces with versions that pre-date the admin config UI so, it is not new to v1.2

steps:

  • Configure groups in Custom Attributes
  • Navigate to user side and view the group info in the profile pop-over of a group member
  • Update info for the group name (for v1.1 do this via config and restart the server while leaving your browser session open)
  • Navigate to user side and view the group info in the profile pop-over of a group member

Expected:
New group name is displayed

Observed:

  • Previous group name is displayed
  • When you refresh the browser (desktop use clear cache) the new name is displayed.

Unable to make dist

As the plugin isn’t included in the list of installable plugins for self-hosted Team edition, I have to build it to upload it. When trying to build a dist for the plugin from the clone located in a sibling directory of mattermost, I get the following error :
at /Users/anonymous/Documents/mattermost/mattermost-plugin-custom-attributes/webapp/node_modules/babel-loader/lib/index.js:55:71 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' }
Anything I’m missing out?

What are considered as groups for this plugin?

The README states the following:

You can also add an array of Mattermost group ID's to the GroupIDs parameter. The Name will then be displayed for all memebers who are apart of that group.

I do not know about the existence of groups in Mattermost, the search in System Console does not bring up anything. All I can think of are Teams and Channels.
There are also AD/LDAP Groups, but such limitation (no teams edition support) is not stated in the README.

Thanks!

Notification settings

Currently, users can be mentioned with the group, like @cats

Mattermost allows users to silence @all, @here, etc.

It would be cool if users could silence their group mentions with a personal setting.

[Request] Badges on user icons

In addition to the cool text tags for user profiles, would it be possible to also add badges under people's profile pictures? The idea would be to have a "badge icon" for a team manager, a "computer icon" for a developer, etc. I like the way this plugin works, it would be nice to have something appear on their icon similar to their online status, so I can see these things "at a glance".

[Request] Groups (of the non AD/LDAP variety) should be supported

Mattermost confusingly has two types of groups - the ones that are like Slack groups, and also AD/LDAP groups.

My workspace has a @ group created for managers. But to use the custom attributes plugin, we had to manually add the 8 people in that group, because the 'group' field is actually trying to use AD/LDAP groups, rather than Mattermost groups!

We don't want to have a multi-team workspace. So it would be great to be able to specify a group name (not a AD/LDAP group ID) and have it figure out the rest.

System Console --> PLUGINS --> Custom User Attributes -->Blank Screen

Mattermost Version: 6.7.0
Database Schema Version: 82
Database: mysql

Once I hit : System Console --> PLUGINS --> Custom User Attributes -->Blank Screen and Developer Console shows the following:

websocket closed
react-dom.production.min.js:209 TypeError: e.map is not a function
at Tn.initAttributes (com.mattermost.custom-attributes_c968cd00178e3348_bundle.js:37:101572)
at new Tn (com.mattermost.custom-attributes_c968cd00178e3348_bundle.js:37:101510)
at Do (react-dom.production.min.js:134:171)
at Ur (react-dom.production.min.js:176:149)
at Ds (react-dom.production.min.js:263:490)
at c_ (react-dom.production.min.js:246:265)
at d_ (react-dom.production.min.js:246:194)
at a_ (react-dom.production.min.js:239:172)
at react-dom.production.min.js:123:115
at t.unstable_runWithPriority (scheduler.production.min.js:19:467)
ns @ react-dom.production.min.js:209
n.callback @ react-dom.production.min.js:226
fo @ react-dom.production.min.js:131
ss @ react-dom.production.min.js:212
F_ @ react-dom.production.min.js:255
t.unstable_runWithPriority @ scheduler.production.min.js:19
Yi @ react-dom.production.min.js:122
g_ @ react-dom.production.min.js:248
a_ @ react-dom.production.min.js:239
(anonymous) @ react-dom.production.min.js:123
t.unstable_runWithPriority @ scheduler.production.min.js:19
Yi @ react-dom.production.min.js:122
Vi @ react-dom.production.min.js:123
Ki @ react-dom.production.min.js:122
v @ react-dom.production.min.js:287
Vt @ react-dom.production.min.js:68
index.js:3404 [Util] handleError:: Uncaught TypeError: e.map is not a function
com.mattermost.agenda_6c1e12eaf003c4e3_bundle.js:16 [Util] handleError:: Uncaught TypeError: e.map is not a function
E @ com.mattermost.agenda_6c1e12eaf003c4e3_bundle.js:16
N @ com.mattermost.agenda_6c1e12eaf003c4e3_bundle.js:16
(anonymous) @ com.mattermost.agenda_6c1e12eaf003c4e3_bundle.js:16
github_1836b997ad13fd7e_bundle.js:22 [Util] handleError:: Uncaught TypeError: e.map is not a function
y @ github_1836b997ad13fd7e_bundle.js:22
R @ github_1836b997ad13fd7e_bundle.js:22
(anonymous) @ github_1836b997ad13fd7e_bundle.js:22
com.github.matterpoll.matterpoll_8d4d7b4076b9ba73_bundle.js:312 [Util] handleError:: Uncaught TypeError: e.map is not a function
b @ com.github.matterpoll.matterpoll_8d4d7b4076b9ba73_bundle.js:312
N @ com.github.matterpoll.matterpoll_8d4d7b4076b9ba73_bundle.js:312
(anonymous) @ com.github.matterpoll.matterpoll_8d4d7b4076b9ba73_bundle.js:312
focalboard_88e65f2249b46e8c_bundle.js:2 [Util] handleError:: Uncaught TypeError: e.map is not a function
react-dom.production.min.js:123 Uncaught TypeError: e.map is not a function
at Tn.initAttributes (com.mattermost.custom-attributes_c968cd00178e3348_bundle.js:37:101572)
at new Tn (com.mattermost.custom-attributes_c968cd00178e3348_bundle.js:37:101510)
at Do (react-dom.production.min.js:134:171)
at Ur (react-dom.production.min.js:176:149)
at Ds (react-dom.production.min.js:263:490)
at c_ (react-dom.production.min.js:246:265)
at d_ (react-dom.production.min.js:246:194)
at a_ (react-dom.production.min.js:239:172)
at react-dom.production.min.js:123:115
at t.unstable_runWithPriority (scheduler.production.min.js:19:467)
initAttributes @ com.mattermost.custom-attributes_c968cd00178e3348_bundle.js:37
Tn @ com.mattermost.custom-attributes_c968cd00178e3348_bundle.js:37
Do @ react-dom.production.min.js:134
Ur @ react-dom.production.min.js:176
Ds @ react-dom.production.min.js:263
c_ @ react-dom.production.min.js:246
d_ @ react-dom.production.min.js:246
a_ @ react-dom.production.min.js:239
(anonymous) @ react-dom.production.min.js:123
t.unstable_runWithPriority @ scheduler.production.min.js:19
Yi @ react-dom.production.min.js:122
Vi @ react-dom.production.min.js:123
Ki @ react-dom.production.min.js:122
v @ react-dom.production.min.js:287
Vt @ react-dom.production.min.js:68

Integrate GolangCI-Lint

Mattermost is currently in the process of using golangci-lint as the default linter for all go projects. mattermost-community/mattermost-plugin-autolink#108 serves as an example of how the migration should look like:

  1. Copy .golangci.yml from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  2. Copy Makefile from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  3. Copy build/ from https://github.com/mattermost/mattermost-plugin-autolink/ into this repository.
  4. Run go mod tidy and make dist to ensure the build system works fine.
  5. Update linters-settings.goimports.local-prefixes to the go module path i.e. to github.com/mattermost/mattermost-plugin-aws-SNS.
  6. Run make golangci-lint and fix all issues that arise.

Fixing an linter issue is sometimes trivial but can also be quite complicated. There might be cases, where ignoring an issue using issues.exclude-rules is needed. If you don't know how to resolve an error, please reach out to @hanzei on the Mattermost Community Server or ask the question here.

reloading config.json

Hey, thanks for this useful plugin

say i regulary update my config.json with custom attributes, do i need to restart mattermost to update the users attributes in the UI ?

while editing the Custom attribute the user is able to save it with the Empty/Without data.

Steps :- 1) Create 1 custom attribute and add it.
2) now remove all the data from all the input box.
3) end of the page you will find the "SAVE" Button, click on that.
issue :- The user can see the validation message for the mandatory input box still the user is able to Save the Custom attribute with Empty data. when the validation message is visible at that time The User should not able to save the custom attribute. (Pls see the video)

The.user.can.see.the.validation.message.for.the.mandatory.input.box.still.the.user.is.able.to.Save.the.Custom.attribute.with.Empty.data.mp4

Admin Config: Implement a Groups UI Picker

When configuring a custom attribute in the System Console, you must provide the group ids in a simple text box. Implement a picker that can allow the user to search by group name and select based on a filtered list (like it currently does with the users).


LDAP Groups are available in Enterprise Edition. In order to test the changes in this ticket, please open a PR as WIP first and a Mattermost Core Comitter can set up an EE server for testing.

Delete icon in admin configuration UI looks odd

When using the new admin configuration UI to manage custom attributes, the icon to delete a records looks strange. This makes the UI unclear. The icon should be replaced with one that is rotated clockwise 45 degrees.

Delete

GitHub Releases

Hi, can you please provide a .tar.gz release? It would be super helpful. Or give instructions on how to compile?

Thanks!!

Increase Mattermost Redux package version

When implementing a fix for #50 it seems that it's using a package version that's incompatible with the way we search for teams here - #40.

The package version for redux most likely needs to be updated.

MM-47046 Use version of React DOM provided by web app

From here:

"For some more context, see here. The short version though is that we updated the web app to React 17, and there's a chance that plugins will have some issues with it because they're compiled with the React 16 version of ReactDOM. I'm submitting PRs to the 3 products, the demo plugin, and the plugin template to have them use the web app's version of React DOM to fix any immediate issues, but we'll want to properly migrate them to React 17 going forward."

Ticket Link
https://mattermost.atlassian.net/browse/MM-47046

Related Pull Requests
mattermost/mattermost-plugin-playbooks#1489
mattermost/focalboard#3861
mattermost-community/mattermost-plugin-todo#190
mattermost/mattermost-plugin-starter-template#169

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.