Skip to content

Commit

Permalink
chore(lint): run linters after updates
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed Jul 20, 2023
1 parent ae688cb commit 0728de1
Show file tree
Hide file tree
Showing 168 changed files with 562 additions and 554 deletions.
2 changes: 1 addition & 1 deletion packages/-ember-caluma/app/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default class ApplicationController extends Controller {
get distributionIsActive() {
return this.router.isActive(
"demo.distribution",
"4222ab21-9c89-47de-98be-d62a8ed0ebeb"
"4222ab21-9c89-47de-98be-d62a8ed0ebeb",
);
}
}
4 changes: 2 additions & 2 deletions packages/-ember-caluma/app/routes/demo/form-rendering.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class DemoFormRenderingRoute extends Route {
}
`,
},
"allDocuments.edges"
"allDocuments.edges",
);

if (!documents.length) {
Expand All @@ -44,7 +44,7 @@ export default class DemoFormRenderingRoute extends Route {
},
},
},
"saveDocument.document.id"
"saveDocument.document.id",
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/-ember-caluma/app/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class IndexRoute extends Route {
}
`,
},
"allDocuments.edges"
"allDocuments.edges",
);

return decodeId(response[0]?.node.id);
Expand Down
4 changes: 2 additions & 2 deletions packages/-ember-caluma/app/services/caluma-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class CustomCalumaOptionsService extends CalumaOptionsService {
.peekAll(type)
.map((obj) => String(obj[this[`${type}IdentifierProperty`]]));
const uncachedIdentifiers = identifiers.filter(
(identifier) => !cachedIdentifiers.includes(String(identifier))
(identifier) => !cachedIdentifiers.includes(String(identifier)),
);

if (uncachedIdentifiers.length) {
Expand Down Expand Up @@ -88,7 +88,7 @@ export default class CustomCalumaOptionsService extends CalumaOptionsService {
...all,
[type]: response.filter((group) => group.get("type.name") === type),
}),
{}
{},
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/-ember-caluma/app/templates/docs/migration-v11.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ import ApolloService from "ember-apollo-client/services/apollo";

export default class CustomApolloService extends ApolloService.extend(
CalumaApolloServiceMixin,
{}
{},
) {
@service session;

Expand Down
8 changes: 4 additions & 4 deletions packages/analytics/addon/components/ca-field-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class CaFieldFormComponent extends Component {
this.field = Changeset(
new Field(),
lookupValidator(FieldValidations),
FieldValidations
FieldValidations,
);
}

Expand Down Expand Up @@ -73,15 +73,15 @@ export default class CaFieldFormComponent extends Component {

if (this.field.isInvalid) {
this.notification.danger(
this.intl.t(`caluma.analytics.notification.field-invalid`)
this.intl.t(`caluma.analytics.notification.field-invalid`),
);
} else if (
this.analyticsFields.find(
(existing) => existing.alias === this.field.get("alias")
(existing) => existing.alias === this.field.get("alias"),
)
) {
this.notification.danger(
this.intl.t(`caluma.analytics.notification.alias-exists`)
this.intl.t(`caluma.analytics.notification.alias-exists`),
);
} else {
const { id, alias, dataSource, aggregateFunction, showOutput } =
Expand Down
6 changes: 3 additions & 3 deletions packages/analytics/addon/components/ca-field-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class CaFieldSelectComponent extends Component {
update(value) {
assert(
"A listener for updates on CaFieldSelectComponent has to be set.",
this.args.onSelect
this.args.onSelect,
);
set(this, "_selectedOption", value);
this.args.onSelect(this._selectedOption);
Expand All @@ -87,15 +87,15 @@ export default class CaFieldSelectComponent extends Component {
prefix: this.args.parentPath ?? "",
},
},
"analyticsTable.availableFields"
"analyticsTable.availableFields",
);
this.fetchedFor = this.isRoot ? "_root_" : this.args.parentPath;
this.options = options.edges.map((edge) => edge.node);
}
} catch (error) {
console.error(error);
this.notification.danger(
this.intl.t("caluma.analytics.notification.fetch-error")
this.intl.t("caluma.analytics.notification.fetch-error"),
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/analytics/addon/components/ca-field-selector-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class CaFieldSelectorListComponent extends Component {
} catch (error) {
console.error(error);
this.notification.danger(
this.intl.t("caluma.analytics.notification.delete-error")
this.intl.t("caluma.analytics.notification.delete-error"),
);
}
}
Expand All @@ -72,12 +72,12 @@ export default class CaFieldSelectorListComponent extends Component {
});

this.notification.success(
this.intl.t("caluma.analytics.notification.reorder-success")
this.intl.t("caluma.analytics.notification.reorder-success"),
);
this._fields = null;
} catch (e) {
this.notification.danger(
this.intl.t("caluma.analytics.notification.reorder-error")
this.intl.t("caluma.analytics.notification.reorder-error"),
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class CaFieldSelectorListCaFieldFunctionSelectComponent extends C
@tracked aggregationFunctions = trackedTask(
this,
this.getAggregationFunctions,
() => [this.args.field, this.args.tableSlug]
() => [this.args.field, this.args.tableSlug],
);

@task
Expand All @@ -32,17 +32,17 @@ export default class CaFieldSelectorListCaFieldFunctionSelectComponent extends C
prefix,
},
},
"analyticsTable.availableFields"
"analyticsTable.availableFields",
);
const fields = options.edges.map((edge) => edge.node);
const field = fields.find(
(field) => field.sourcePath === this.args.field.dataSource
(field) => field.sourcePath === this.args.field.dataSource,
);
return field?.supportedFunctions ?? [];
} catch (error) {
console.error(error);
this.notification.danger(
this.intl.t("caluma.analytics.notification.fetch-error")
this.intl.t("caluma.analytics.notification.fetch-error"),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/addon/components/ca-filter-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class CaFilterModalComponent extends Component {
const filter = this.newFilter.trim();
if (this.filters.includes(filter)) {
this.notification.warning(
this.intl.t("caluma.analytics.notification.filter-exists")
this.intl.t("caluma.analytics.notification.filter-exists"),
);
} else {
this.filters = [filter, ...this.filters];
Expand Down
6 changes: 3 additions & 3 deletions packages/analytics/addon/components/ca-report-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ export default class CaReportBuilderComponent extends Component {
input,
},
},
"saveAnalyticsTable.analyticsTable"
"saveAnalyticsTable.analyticsTable",
);
yield this.args.onAdd?.(
this.args.analyticsTable.slug,
this.args.analyticsTable.startingObject
this.args.analyticsTable.startingObject,
);
this.router.transitionTo("reports.edit", data.slug);
} catch (error) {
console.error(error);
this.notification.danger(
this.intl.t(`caluma.analytics.notification.create-error`)
this.intl.t(`caluma.analytics.notification.create-error`),
);
}
}
Expand Down
10 changes: 5 additions & 5 deletions packages/analytics/addon/components/ca-report-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class CaReportPreviewComponent extends Component {
slug: this.args.slug,
},
},
"analyticsTable"
"analyticsTable",
);
const headings = result.fields.edges
.filter(({ node: { showOutput } }) => showOutput)
Expand All @@ -36,14 +36,14 @@ export default class CaReportPreviewComponent extends Component {
headings.map(({ alias }) =>
node.edges
.map(({ node }) => node)
.find((node) => node.alias === alias)
)
.find((node) => node.alias === alias),
),
),
summary: result.resultData.summary.edges.length
? headings.map(({ alias: headingAlias }) =>
result.resultData.summary.edges
.map(({ node }) => node)
.find(({ alias }) => alias === headingAlias)
.find(({ alias }) => alias === headingAlias),
)
: null,

Expand All @@ -52,7 +52,7 @@ export default class CaReportPreviewComponent extends Component {
} catch (error) {
console.error(error);
this.notification.danger(
this.intl.t("caluma.analytics.notification.fetch-error")
this.intl.t("caluma.analytics.notification.fetch-error"),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/addon/controllers/reports/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class ReportsEditController extends Controller {
} catch (error) {
console.error(error);
this.notification.danger(
this.intl.t(`caluma.analytics.notification.delete-error`)
this.intl.t(`caluma.analytics.notification.delete-error`),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/addon/routes/reports/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class ReportsIndexRoute extends Route {
fetchPolicy: "network-only",
query: getAllAnalyticsTableQuery,
},
"allAnalyticsTables"
"allAnalyticsTables",
);

return tables.edges.map((edge) => edge.node);
Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/addon/routes/reports/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class ReportsNewRoute extends Route {
startingObject: "CASES",
}),
lookupValidator(AnalyticsTableValidations),
AnalyticsTableValidations
AnalyticsTableValidations,
);
}
}
4 changes: 2 additions & 2 deletions packages/analytics/addon/tasks/get-analytics-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ export default function* getAnalyticsTable(slug) {
fetchPolicy: "cache-and-network",
variables: { slug },
},
"analyticsTable"
"analyticsTable",
);
} catch (error) {
console.error(error);
this.notification.danger(
this.intl.t("caluma.notification.table-not-found")
this.intl.t("caluma.notification.table-not-found"),
);
}
}
4 changes: 2 additions & 2 deletions packages/analytics/addon/tasks/save-analytics-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export default function* (input) {
variables: { input },
});
this.notification.success(
this.intl.t("caluma.analytics.notification.field-saved")
this.intl.t("caluma.analytics.notification.field-saved"),
);
return mutation;
} catch (error) {
console.error(error);
this.notification.danger(
this.intl.t("caluma.analytics.notification.create-error")
this.intl.t("caluma.analytics.notification.create-error"),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module("Integration | Component | ca-field-select", function (hooks) {
assert.expect(2);

await render(
hbs`<CaFieldSelect @path="" @child={{true}} @onSelect={{this.update}} />`
hbs`<CaFieldSelect @path="" @child={{true}} @onSelect={{this.update}} />`,
);

assert.dom(this.element).exists();
Expand All @@ -39,7 +39,7 @@ module("Integration | Component | ca-field-select", function (hooks) {
// TODO: setup mirage to satisfy *fetchOptions

await render(
hbs`<CaFieldSelect @selectedPath={{this.path}} @onSelect={{this.update}} />`
hbs`<CaFieldSelect @selectedPath={{this.path}} @onSelect={{this.update}} />`,
);

assert
Expand Down Expand Up @@ -96,11 +96,11 @@ module("Integration | Component | ca-field-select", function (hooks) {
this.set("path", "grandpa.father.son");

await render(
hbs`<CaFieldSelect @selectedPath={{this.path}} @onSelect={{this.update}} />`
hbs`<CaFieldSelect @selectedPath={{this.path}} @onSelect={{this.update}} />`,
);
selectChoose(".ember-power-select-trigger", "father");

assert.verifySteps(["selection"]);
}
},
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,15 @@ module("Integration | Component | ca-field-selector-list", function (hooks) {

test("it renders fields", async function (assert) {
await render(
hbs`<CaFieldSelectorList @analyticsTable={{this.analyticsTable}} />`
hbs`<CaFieldSelectorList @analyticsTable={{this.analyticsTable}} />`,
);

assert.dom("tbody tr").exists({ count: 3 });
});

test("it reorders", async function (assert) {
await render(
hbs`<CaFieldSelectorList @analyticsTable={{this.analyticsTable}} />`
hbs`<CaFieldSelectorList @analyticsTable={{this.analyticsTable}} />`,
);

assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module(
hbs`<CaFieldSelectorList::CaFieldAliasInput
@value={{this.alias}}
@onInput={{this.onSave}}
/>`
/>`,
);
assert.dom("[data-test-field-alias-input]").hasValue(this.alias);

Expand All @@ -33,5 +33,5 @@ module(
assert.verifySteps(["save"]);
assert.dom("[data-test-field-alias-input]").hasValue("changed alias");
});
}
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ module(
@update={{this.update}}
@field={{this.field}}
@tableSlug={{"test"}}
/>`
/>`,
);

const requests = this.server.pretender.handledRequests;
assert.equal(requests.length, 1);
assert.dom(".ember-power-select-trigger").exists({ count: 1 });
assert.ok(requests[0].sendArguments[0].includes("AllAnalyticsFields"));
});
}
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ module("Integration | Component | ca-report-builder", function (hooks) {
todo("it is not possible to create invalid fields", async function () {});
todo(
"the field object will reset after submitting a new field",
async function () {}
async function () {},
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module("Integration | Component | ca-report-list", function (hooks) {
this.set("itemRoute", "demo.builder");

await render(
hbs`<CaReportList @reports={{this.reports}} @itemRoute={{this.itemRoute}} />`
hbs`<CaReportList @reports={{this.reports}} @itemRoute={{this.itemRoute}} />`,
);

assert.dom(this.element).containsText("t:caluma.analytics.list.list-title");
Expand Down
Loading

0 comments on commit 0728de1

Please sign in to comment.