1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00
Unleash is the open source feature toggle service.
Go to file
Thomas Heartman ff9b7298b6
feat: add paging to event log (#7793)
Adds sticky pagination to the event log:


![image](https://github.com/user-attachments/assets/c426f30d-bb64-44a5-b3b4-8c295207b249)

This PR uses the sticky pagination bar that we use on other tables to
navigate the event search results.

## Decisions / discussion points

The trickiest issue here is how we calculate the next and previous page
offsets. This is tricky because we don't expose the page number to the
API, but the raw offset itself. This abstraction makes it possible to
set an offset that isn't a multiple of the page size.

Say the page size is 25. If you manually set an offset of 30 (through
changing the URL), what do you expect should happen when you:
- load the page? Should you see results 31 to 55? 26 to 50?
- go to the next page? Should your next offset be 55 or 50?
- previous page: should your previous page offset be 5? 25? 0?

The current implementation has taken what I thought would be the easiest
way out: If your offset is between two multiples of the page size, we'll
consider it to be the lower of the two.
- The next page's offset is the next multiple of the page size that is
higher than the current offset (50 in the example above).
- The previous page's offset will be not the nearest lower page size,
but the one below. So if you set offset 35 and page size 25, your next
page will take you back to 0 (as if the offset was 25).

We could instead update the API to accept `page` instead of offset, but
that wouldn't align with how other tables do it.

Comparing to the global flags table, if you set an offset that isn't a
multiple of the page size, we force the offset to 0. We can look at
handling it like that in a follow-up, though I'd argue that forcing it
to be the next lower multiple of the page size would make more sense.

One issue that appears when you can set custom offsets is that the
little "showing x-y items out of z" gets out of whack (because it only
operates on multiples of the page size (seemingly))

![image](https://github.com/user-attachments/assets/ec9df89c-2717-45d9-97dd-5c4e8ebc24cc)

## The Event Log as a table

While we haven't used the HTML `table` element to render the event log,
I would argue that it _is_ actually a table. It displays tabular data.
Each card (row) has an id, a project, etc.

The current implementation forces the event log search to act as a table
state manager, but we could transform the event list into an events
table to better align the pagination handling. The best part? We can
keep the exact same design too. A table doesn't have to _look_ like a
table to be a table.
2024-08-07 15:08:01 +02:00
.do fix: DigitalOcean template (#4287) 2023-07-20 12:13:44 +00:00
.floe docs: spelling and grammar (#6007) 2024-01-23 19:52:10 +01:00
.github feat: wait for postgres to boot before running tests (#7790) 2024-08-07 11:12:45 +03:00
.husky chore: integration events API (#7639) 2024-07-23 10:09:19 +01:00
.vscode chore: adds Biome as a recommended extension for vscode (#4909) 2023-10-02 14:13:28 +01:00
.yarn/releases task: Yarn v4 (#7457) 2024-06-27 12:52:43 +02:00
coverage
docker task: Yarn v4 (#7457) 2024-06-27 12:52:43 +02:00
docs/api/oas
examples
frontend feat: add paging to event log (#7793) 2024-08-07 15:08:01 +02:00
scripts task: Yarn v4 (#7457) 2024-06-27 12:52:43 +02:00
src feat: archive project service (#7794) 2024-08-07 12:09:00 +02:00
test-migrations task: Yarn v4 (#7457) 2024-06-27 12:52:43 +02:00
website Updated <title> for 11 principles article (#7779) 2024-08-07 09:08:24 +02:00
.dockerignore task: Yarn v4 (#7457) 2024-06-27 12:52:43 +02:00
.editorconfig
.gitignore task: Yarn v4 (#7457) 2024-06-27 12:52:43 +02:00
.lycheeignore docs: added oidc example to lycheeignore 2024-07-23 09:36:20 +02:00
.mergify.yml
.node-version chore(deps): update dependency node to v20.16.0 (#7766) 2024-08-06 02:18:04 +00:00
.npmignore task: Yarn v4 (#7457) 2024-06-27 12:52:43 +02:00
.nvmrc Node20 (#7095) 2024-05-23 14:14:09 +02:00
.yarnrc.yml task: Yarn v4 (#7457) 2024-06-27 12:52:43 +02:00
app.json chore: Update app.json (#7078) 2024-05-20 14:18:48 +02:00
biome.json chore: bump biome to 1.8.3 (#7540) 2024-07-09 16:01:22 +02:00
CHANGELOG.md chore: bump version to 6.1.0+main 2024-08-07 10:29:59 +00:00
cliff.toml chore(deps): added task as valid prefix for miscellaneuous task 2023-10-18 12:25:20 +02:00
CODE_OF_CONDUCT.md Proposed version 2.1 2023-05-16 15:14:03 +02:00
CODEOWNERS Made Melinda a code owner for the docs (#7783) 2024-08-06 14:21:13 +00:00
CONTRIBUTING.md task: Yarn v4 (#7457) 2024-06-27 12:52:43 +02:00
docker-compose.yml chore: update DATABASE_URL to use the database created via POSTGRES_D… (#4836) 2023-09-28 13:07:03 +02:00
Dockerfile chore(deps): update dependency node to v20.16.0 (#7766) 2024-08-06 02:18:04 +00:00
LICENSE
package.json chore: bump version to 6.1.0+main 2024-08-07 10:29:59 +00:00
README.md chore: remove toggle reference apart from existing links (#7148) 2024-05-27 10:46:26 +03:00
renovate.json fix: freezing navigation (#6090) 2024-01-31 11:33:39 +01:00
tsconfig.json fix(import): making all imports relative and removing baseUrl (#5847) 2024-01-17 15:33:03 +02:00
USERS.md chore: customer requested to CS to be removed from this list. 2024-07-02 10:10:56 +02:00
yarn.lock fix(deps): update dependency ajv to v8.17.1 (#7786) 2024-08-07 06:58:24 +00:00

What is Unleash?

Unleash is a powerful open source solution for feature management. It streamlines your development workflow, accelerates software delivery, and empowers teams to control how and when they roll out new features to end users. With Unleash, you can deploy code to production in smaller, more manageable releases at your own pace.

Feature flags in Unleash let you test your code with real production data, reducing the risk of negatively impacting your users' experience. It also enables your team to work on multiple features simultaneously without the need for separate feature branches.

Unleash is the most popular open source solution for feature flagging on GitHub. It supports 15 official client and server SDKs and over 15 community SDKs. You can even create your own SDK if you wish. Unleash is compatible with any language and framework.


Getting Started with Unleash

1. Setting Up Unleash

To get started with Unleash, you need git and docker installed on your machine.

Execute the following commands:

git clone git@github.com:Unleash/unleash.git
cd unleash
docker compose up -d

Then point your browser to localhost:4242 and log in using:

  • username: admin
  • password: unleash4all

If you'd rather run the source code in this repo directly via Node.js, see the step-by-step instructions to get up and running in the contributing guide.

2. Connect your SDK

Find your preferred SDK in our list of official SDKs and import it into your project. Follow the setup guides for your specific SDK.

If you use the docker compose file from the previous step, here's the configuration details you'll need to get going:

  • For front-end SDKs, use:
    • URL: http://localhost:4242/api/frontend/
    • clientKey: default:development.unleash-insecure-frontend-api-token
  • For server-side SDKs, use:
    • Unleash API URL: http://localhost:4242/api/
    • API token: default:development.unleash-insecure-api-token

If you use a different setup, your configuration details will most likely also be different.

Check a feature flag

Checking the state of a feature flag in your code is easy! The syntax will vary depending on your language, but all you need is a simple function call to check whether a flag is available. Here's how it might look in Java:

if (unleash.isEnabled("AwesomeFeature")) {
  // do new, flashy thing
} else {
  // do old, boring stuff
}

Run Unleash on a service?

If you don't want to run Unleash locally, we also provide easy deployment setups for Heroku and Digital Ocean:

Deploy to Heroku Deploy to DigitalOcean

Configure and run Unleash anywhere

The above sections show you how to get up and running quickly and easily. When you're ready to start configuring and customizing Unleash for your own environment, check out the documentation for getting started with self-managed deployments, Unleash configuration options, or running Unleash locally via docker.


Online demo

Try out the Unleash online demo.

The Unleash online demo


Community and help — sharing is caring

We know that learning a new tool can be hard and time-consuming. We have a growing community that loves to help out. Please don't hesitate to reach out for help.

Join Unleash on Slack

💬 Join Unleash on Slack if you want ask open questions about Unleash, feature toggling or discuss these topics in general.

💻 Create a GitHub issue if you have found a bug or have ideas on how to improve Unleash.

📚 Visit the documentation for more in-depth descriptions, how-to guides, and more.

📖 Learn more about the principles of building and scaling feature flag solutions.


Contribute to Unleash

Unleash is the largest open source feature flag solution on GitHub. Building Unleash is a collaborative effort, and we owe a lot of gratitude to many smart and talented individuals. Building it together with the community ensures that we build a product that solves real problems for real people. We'd love to have your help too: Please feel free to open issues or provide pull requests.

Check out the CONTRIBUTING.md file for contribution guidelines and the Unleash developer guide for tips on environment setup, running the tests, and running Unleash from source.

Contributors

The Unleash contributors


Features our users love

Flexibility and adaptability

Security and performance

  • Privacy by design (GDPR and Schrems II). End-user data never leaves your application.
  • Audit logs
  • Enforce OWASP's secure headers via the strict HTTPS-only mode
  • Flexible hosting options: host it on premise or in the cloud (any cloud)
  • Scale the Unleash Proxy independently of the Unleash server to support any number of front-end clients without overloading your Unleash instance

Looking for more features?

If you're looking for one of the following features, please take a look at our Pro and Enterprise plans:


Architecture

Read more in the system overview section of the Unleash documentation.


Unleash SDKs

To connect your application to Unleash you'll need to use a client SDK for your programming language.

Official server-side SDKs:

Official front-end SDKs:

The front-end SDKs connects via the Unleash Proxy in order to ensure privacy, scalability and security.

Community SDKs:

If none of the official SDKs fit your need, there's also a number of community-developed SDKs where you might find an implementation for your preferred language (such as Elixir, Dart, Clojure, and more).


Users of Unleash

Unleash is trusted by thousands of companies all over the world.

Proud Open-Source users: (send us a message if you want to add your logo here)

The Unleash logo encircled by logos for Finn.no, nav (the Norwegian Labour and Welfare Administration), Budgets, Otovo, and Amedia. The encircling logos are all connected to the Unleash logo.


Migration guides

Unleash has evolved significantly over the past few years, and we know how hard it can be to keep software up to date. If you're using the current major version, upgrading shouldn't be an issue. If you're on a previous major version, check out the Unleash migration guide!


Want to know more about Unleash?

Videos and podcasts

Articles and more