Skip to content

Commit

Permalink
export queries use order by feature name (#3051)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Feb 6, 2023
1 parent f43adb6 commit 09ab4e4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions frontend/src/component/project/Project/Project.styles.ts
Expand Up @@ -17,9 +17,8 @@ export const StyledColumn = styled('div')(() => ({
flexDirection: 'column',
}));

export const StyledName = styled('h1')(({ theme }) => ({
export const StyledName = styled('span')(({ theme }) => ({
fontSize: theme.typography.h1.fontSize,
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
}));
Expand Down
4 changes: 3 additions & 1 deletion src/lib/db/feature-environment-store.ts
Expand Up @@ -112,7 +112,9 @@ export class FeatureEnvironmentStore implements IFeatureEnvironmentStore {
features: string[],
environment?: string,
): 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) {
rows = rows.where({ environment });
}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/db/feature-strategy-store.ts
Expand Up @@ -209,7 +209,8 @@ class FeatureStrategiesStore implements IFeatureStrategiesStore {
const query = this.db
.select(COLUMNS)
.from<IFeatureStrategiesTable>(T.featureStrategies)
.whereIn('feature_name', features);
.whereIn('feature_name', features)
.orderBy('feature_name', 'asc');
if (environment) {
query.where('environment', environment);
}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/db/feature-tag-store.ts
Expand Up @@ -109,7 +109,8 @@ class FeatureTagStore implements IFeatureTagStore {
const query = this.db
.select(COLUMNS)
.from<FeatureTagTable>(TABLE)
.whereIn('feature_name', features);
.whereIn('feature_name', features)
.orderBy('feature_name', 'asc');
const rows = await query;
return rows.map((row) => ({
featureName: row.feature_name,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/db/feature-toggle-store.ts
Expand Up @@ -104,7 +104,7 @@ export default class FeatureToggleStore implements IFeatureToggleStore {
}

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) {
query.whereIn('name', names);
}
Expand Down

0 comments on commit 09ab4e4

Please sign in to comment.