Code Monkey home page Code Monkey logo

backstage-plugin-qeta's Introduction

backstage-plugin-qeta

CI

Backstage.io plugin for Q&A. This plugin is both frontend and backend that manages and displays questions and answers within Backstage. This plugin provides:

Setup

Find installation instructions in our documentation.

IMPORTANT: From version 2.0.0 forward, this plugin only works with the new backend system. If you are still using the old backend system, please use version 1.24.5.

Examples

Questions list:

Questions list

Posting question:

Questions list

Answering question:

Questions list

Tags page:

Tags page

Contributing

All contributions are very welcome. See CONTRIBUTING for more information.

License

This library is under the MIT license.

backstage-plugin-qeta'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  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

backstage-plugin-qeta's Issues

feat: filtering of issues

There should be a filter possibility in the question list that allows

  • Changing the order of the issues (latest activity, score, latest)
  • Changing the number of issues shown on a single page
  • Filtering only questions without answers
  • Filtering only questions without a correct answer
  • Filtering questions with tags

The filters should be hidden behind a button that opens these options for the user. The filters should also include the filters the page adds (for example user or tag)

feat: user statistics

User page should be able to show statistics of user activity. This could also include some badges to identify active users. Discussion open what should be implemented.

Back to questions does not redirect back to entity page

If you have embedded Q&A page as a tab into entity page, like this:
image

After selecting question there is a button called Back to questions.

But that redirect the user back to all questions, not the ones that relates to the entity to begin with.

Should we embed question page under the entity page as well, so there would be no reason to have the button in the first place or is there any other ideas how to handle? Maybe carry entity reference in URL?

Possibility to customize the question page

Context

Before using the Q&A as our center for questions from the development teams, we used another tool that allowed us to add specific fields for us as the team responsible for answering or maybe some specific subject that helped us to quantify the main doubts of each subject or team.

Proposal

We have the possibility to customize the Ask Question page, maybe inspired by the format that TechDocs does or adding the possibility of passing new options as a props to the AskForm.

bug: Duplicate questions

We have noticed that currently, some of our users end up clicking more than once on the button, creating more than one question.

My suggestion would be to add some loading just to prevent the user from clicking more than once while the insert is running.

feat: deleting questions and answers

Users should be able to delete their own questions/answers. This should be possible only for their own questions and answers. Delete should always be confirmed with a modal. API in the backend already exists for this so it's mostly a frontend feature.

Search result opens in a new tab

Clicking on search result for Q&A opens in new tab. Its not same for other results.

In the screenshot below, if I click on Test Question, Question page opens in a new tab.
image

feat: increase visualization of inline code

Why

Increase readability of questions containing inline code.

current preview

proposed preview

Issue

The proposed solution uses the import 'react-mde/lib/styles/css/react-mde-preview.css' style provided by react-mde. The issue is that this also seems to alter the multiline code block in Backstage. MarkdownEditor.tsx

Example:
proposed preview with issue

feat: answer card thread / replies

Had a situation where a question got several answers and resulted in a new discussion in which users were responding to each other out of sync. Think it would be a great feature to add a reply option on the AnswerCard component that would create a thread on that answer. Thoughts?

feat: tags page

There should be a new page that shows all tags used in questions and where users can navigate to see the questions under that tag. The tags should be shown by default with the most used first. Also, additional information can be added such as how many questions are there under a tag.

feat: trending questions

A new list of trending questions should be added to the home page of qeta. The trending questions should be questions with lots of attention lately or/and compared to other questions (views, votes, answers). Top 5 trending questions should be shown in the list. Ideas welcome.

chore: add frontend tests

Add frontend tests using jest. Minimum is to have snapshot tests for each component, even better if actual functionality of the components can be tested (with something).

feat: track user discussions

What

It would be nice if the plugin had easy access to questions created by you.

The current navigation doesn't offer a friendly interface to manage your entries, especially if the organization has many questions
Captura de Tela 2023-01-31 às 23 01 26

Possible implementation

There is already a great path built to check the questions of a specific user. A button on the main page redirecting to your user questions would be a great addition.

Captura de Tela 2023-01-31 às 23 01 39

feat: Improve visualization and tracking of latest activity on questions

My purpose with this issue is to bring up a discussion on how to improve the tracking of new interactions on the questions.

For example, currently, when I ask a question, the only way to know if someone answered is by going to the Q&A page, filtering by My Questions and visiting each question that I want to check. A similar happens when the user wants to keep up with answers of some questions.

The Favorite feature can help with this usecase, however, is still necessary that the user goes to the Q&A page, set the filter and visit each question.

I see the ideal solution would be using this notification feature backstage/backstage#10652.

As this is not ready yet, I was thinking about having a simpler mechanism to improve this experience. My suggestion is to have a Card with the Latest and Favorites questions where we could show the number of activities made on the questions since the last visit. The activities countable would be all the new answers and comments. A column with Last Updated value could also be convenient. This card would be useful on Backstage Homepage.

Draft UI Card suggestion:
image

feat: upload images on questions

Why

I know that this might not be trivial, but images are a core thing while asking a question, and really helps with problem resolution.

What

I was thinking of creating an annexes button, that saves some image files, to be shown later in the question

feat: Configure max-width of the content on the question page

Hey!

Currently the content on the question page fills the entire remaining space.
This makes questions and answers a bit annoying to read on bigger screens as you need to move your head/eyes to read all of the text.

It would be cool if it was possible to set a max-width and have it be centered similarly to how it is on stackoverflow: random stackoverflow question.

As an example, you can set maxWidth for a Container(from material ui) this way, using breakpoints.
<Container maxWidth="md"></Container>

Add ability to notify entity owners when new question is asked about an entity

One of my end users asked if there was a way to know when a new question was asked about an entity they own as they have to login to see any questions at all and it appears that this is not possible. I would like to have potentially multiple routes to notify end user owners of new questions

E.G.: Email, teams notification, slack notification, banner for end user when they login to backstage(albeit this is half measure as the end user still has to navigate to backstage to even see this)

feat: unanswered questions

There should be a list on the front page that shows questions that do not have any answers. This would allow users to find something they can contribute to. The questions should be ordered randomly so that older and newer questions appear in the list. Maximum of 5 questions should be shown in the list.

ux: Light Theme Accessibility

Description

Backstage instances that use a Custom Theme (or the builtin Light Theme) have a few accessibility issues when it comes to some of the component variant usage/colors.

Primarily, the Buttons to Create new Questions blend in with the background and look like they are disabled and not actionable at an immediate glance

Examples

Landing Page with no Questions Asked

image

  • The Go Ahead and Ask One! button looks like just plain text
  • The Ask Question in the top right doesn't look actionable and is hard to see immediately

Asking a Question

image

  • The POST button in the bottom left to submit the Form looks like it is disabled and not actionable when the question is properly filled out

Answering a Question

image

Similar issues, most buttons blend into background or look disabled

Expected Behavior

These buttons should respect the configured primary theme colors defined in a Backstage instance

For example, our theme uses a Lighter Green for Primary actions/buttons
image

Ideally, this plugin continued using the theme for actions/buttons.

feat: favorite questions

It should be possible to make some question favorites for the user. This would be saved in a new table user_favorites and a new list could be shown perhaps on a new page with only the favorite questions. The question page should have a star button to mark the question as a favorite under the current voting buttons.

chore: move common types to qeta-common package

There are some common types like Question, Answer, QetaDocument, etc. that are now living inside the backend package. These should be moved to the common package to be able to use them more conveniently in the application.

Allowing other users to make edits to questions

It can be helpful to allow other users to edit questions, particularly to fix tags or add a missing entity reference. Right now, the edit action is restricted to only questions you've authored directly.

For simple environments, it's usually pretty comfortable to allow this permission globally to all users. What do you think about adding an allowAllUsersToEditQuestions app-config? This could be false by default.

feat: editing questions and answers

The user should be able to edit their own questions and answers. Preferably this should be done inline in the page but can also be a separate page. Editing a question should also add/update the updated and updatedBy columns of the question/answer. Later there might be a possibility for other users to edit someone else's questions but for now, this is limited to the author.

bug: Internal server error on search.

We frequently experience internal server errors from Backstage's search function. Debugging this lead to this line failing, because it expects all indexable fields to be a string. When there was a match within tags (array) or score (number), this crashes the search.

The backstage documentation is not entirely clear about it, but it looks like an IndexableDocument may only have string fields.

feat: remember filter panel options

When filtering questions in list, the options should be remembered when navigating between questions. This could be done either with local storage or adding the values to the URL as query parameters.

feat: Resolve author username to displayName

In the Backstage User entity specification, it's shown that a User entity can have a displayName (spec.profile.displayName) which is commonly used rather that the username in the frontend for better readabiltiy - so I'd propose to try to resolve also in the frontend qeta plugin to this displayName.

Proposed implementation can follow along the UserProfileCard of the org-plugin: https://github.com/backstage/backstage/blob/master/plugins/org/src/components/Cards/User/UserProfileCard/UserProfileCard.tsx#L65-L77

Descriptive qeta search document

There are a few values in the current qeta search document. I think it could be helpful to have a document that is a bit more descriptive so we can have more information available in the client side.

We could include a docType value to identify document type individually, author, answersCount and score.
The result example of this document would look like this:

{
  "document": {
    "title": "Hello Ask",
    "text": "Hello this is a sample question",
    "location": "/qeta/questions/1",
    "docType": "qeta",
    "author": "user:default/user",
    "answers": 0,
    "score": 1
  }
}

In my team we take advantage of the docType value with Backstage's Search API to have buckets of documents by docType. This could be something that could be helpful for other customers when making queries with the search API.

In the client side this could be leveraged to show more details to users:

Screen Shot 2023-07-13 at 14 01 45

I would like to know your thoughts on this suggestion @drodil.

feat: automatic release notes

Upon releasing, GitHub actions should generate automatic release notes to CHANGELOG.md file and push it to the main branch. Tool selection should allow using conventional commit messages.

feat: Moderator access

Anyway we can add moderator access? I think a quick solution would be to allow to paste in a userid's in the config under a stanza like "moderator" so something like

qeta
    moderators: ['user:/anestor6', ...]
    ...

moderator access would allow these user to delete and edit existing questions. Thoughts?

feat: remove kind and namespace from users

User name is shown in questions and in user page in entity reference format kind:namespace/name. Remove the kind and namespace from those and possibly split the username by dots and format it correctly. This should only be used for authors where kind is user and only when it's used as showing, not when referencing (for example in URLs).

fix: enable catalog api only in local development

This part of the plugin creation should only be enabled in local dev:
https://github.com/drodil/backstage-plugin-qeta/blob/main/plugins/qeta/src/plugin.ts#L24

Tried with env variables but seems like they are not taking effect. If the catalog API is created here and the plugin is deployed to actual backstage instance, the frontend will fail to start with error:

Plugin catalog tried to register duplicate or forbidden API factory for apiRef{plugin.catalog.service}

feat: add questions per page to question list

Add select input to select questions per page. Options should be 5, 10, 25, 50 and 100 with default of 10. The number of questions should be saved to URL parameters like current page is at the moment.

feat: Export event handlers to allow for customization

I think it could useful to allow us to add custom functions to events like post question, post answer, post reply, upvote, etc. In our case, we used the patch-package library to add a POST requests to a backend route with a custom Slack integration with the question payload in the body to notify users when a question is asked / answer is posted. But it would be handy if these operations were exposed in the client to add a bit of customization on how we handle notifiable events. Perhaps in the QuestionContainer component and the AskForm, only thing would be to ensure these event handlers have all the appropriate information, for example, question title, content, time, reporter, entities, etc. And in the case of the reply, the reporter and the replier. Another thing for consideration would be on the editing of a question and how that argument would look. Thoughts? @drodil

Cannot find module '@drodil/backstage-plugin-qeta-backend'

After following the installation instructions, I'm getting the Cannot find module '@drodil/backstage-plugin-qeta-backend' message. Looking deeper it looks like de backend package is not built correctly, or something like that.

❯ tree ./node_modules/@drodil/backstage-plugin-qeta-backend/dist 
./node_modules/@drodil/backstage-plugin-qeta-backend/dist
├── main.05256229b1275fd3efba.hot-update.js
├── main.05256229b1275fd3efba.hot-update.json
├── main.20eaf34914d662a622d4.hot-update.js
├── main.20eaf34914d662a622d4.hot-update.json
├── main.3fa5c261f5c9dabeeef7.hot-update.js
├── main.3fa5c261f5c9dabeeef7.hot-update.json
├── main.459352cc2fed5ae6e0c9.hot-update.js
├── main.459352cc2fed5ae6e0c9.hot-update.json
├── main.4a4f904542185539c204.hot-update.js
├── main.4a4f904542185539c204.hot-update.json
├── main.57bb0d456721a5a5f281.hot-update.js
├── main.57bb0d456721a5a5f281.hot-update.json
├── main.68250dcf5acf7134a446.hot-update.js
├── main.68250dcf5acf7134a446.hot-update.json
├── main.764f7469059d6b292088.hot-update.js
├── main.764f7469059d6b292088.hot-update.json
├── main.869292e6bfcaee3b0d4d.hot-update.js
├── main.869292e6bfcaee3b0d4d.hot-update.json
├── main.91c4b7e4841b81c8ece5.hot-update.js
├── main.91c4b7e4841b81c8ece5.hot-update.json
├── main.c525b843d8944f3fb792.hot-update.js
├── main.c525b843d8944f3fb792.hot-update.json
├── main.d469fc9863c7624b8a8c.hot-update.js
├── main.d469fc9863c7624b8a8c.hot-update.json
└── main.js

0 directories, 25 files

By contrast, here is the 0.1.30 version folder structure.

❯ tree ./node_modules/@drodil/backstage-plugin-qeta-backend/dist
./node_modules/@drodil/backstage-plugin-qeta-backend/dist
├── index.cjs.js
├── index.cjs.js.map
└── index.d.ts

0 directories, 3 files

Am I missing something?

feat: allow configuration of types of components

When attaching components to questions, all types of components are available. Add config value that can be used to limit the types of components that can be selected for a question (optional array for example [Component, Service, Api]. The config value should be read and used in query when fetching components for AskForm. Also rename the input to be "Entities" instead "Components" as it is more describing.

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.