1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-03 01:18:43 +02:00

export queries use order by feature name (#3051)

This commit is contained in:
Mateusz Kwasniewski 2023-02-06 15:46:25 +01:00 committed by GitHub
parent f43adb60f7
commit 09ab4e42db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 6 deletions

View File

@ -17,9 +17,8 @@ export const StyledColumn = styled('div')(() => ({
flexDirection: 'column', flexDirection: 'column',
})); }));
export const StyledName = styled('h1')(({ theme }) => ({ export const StyledName = styled('span')(({ theme }) => ({
fontSize: theme.typography.h1.fontSize, fontSize: theme.typography.h1.fontSize,
overflow: 'hidden',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
})); }));

View File

@ -112,7 +112,9 @@ export class FeatureEnvironmentStore implements IFeatureEnvironmentStore {
features: string[], features: string[],
environment?: string, environment?: string,
): Promise<IFeatureEnvironment[]> { ): Promise<IFeatureEnvironment[]> {
let rows = this.db(T.featureEnvs).whereIn('feature_name', features); let rows = this.db(T.featureEnvs)
.whereIn('feature_name', features)
.orderBy('feature_name', 'asc');
if (environment) { if (environment) {
rows = rows.where({ environment }); rows = rows.where({ environment });
} }

View File

@ -209,7 +209,8 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
const query = this.db const query = this.db
.select(COLUMNS) .select(COLUMNS)
.from<IFeatureStrategiesTable>(T.featureStrategies) .from<IFeatureStrategiesTable>(T.featureStrategies)
.whereIn('feature_name', features); .whereIn('feature_name', features)
.orderBy('feature_name', 'asc');
if (environment) { if (environment) {
query.where('environment', environment); query.where('environment', environment);
} }

View File

@ -109,7 +109,8 @@ class FeatureTagStore implements IFeatureTagStore {
const query = this.db const query = this.db
.select(COLUMNS) .select(COLUMNS)
.from<FeatureTagTable>(TABLE) .from<FeatureTagTable>(TABLE)
.whereIn('feature_name', features); .whereIn('feature_name', features)
.orderBy('feature_name', 'asc');
const rows = await query; const rows = await query;
return rows.map((row) => ({ return rows.map((row) => ({
featureName: row.feature_name, featureName: row.feature_name,

View File

@ -104,7 +104,7 @@ export default class FeatureToggleStore implements IFeatureToggleStore {
} }
async getAllByNames(names: string[]): Promise<FeatureToggle[]> { async getAllByNames(names: string[]): Promise<FeatureToggle[]> {
const query = this.db<FeaturesTable>(TABLE); const query = this.db<FeaturesTable>(TABLE).orderBy('name', 'asc');
if (names.length > 0) { if (names.length > 0) {
query.whereIn('name', names); query.whereIn('name', names);
} }