Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(ui): update to ember 5.7 and latest dependencies #1483

Merged
merged 27 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ui/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# unconventional js
/blueprints/*/files/
/blueprints/*/index.js
/vendor/

# compiled output
/dist/
/dist-prod/
/tmp/

# dependencies
Expand All @@ -14,12 +16,10 @@
/coverage/
!.*
.*/
.eslintcache

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
30 changes: 18 additions & 12 deletions ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

module.exports = {
root: true,
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
requireConfigFile: false,
babelOptions: {
plugins: [
['@babel/plugin-proposal-decorators', { decoratorsBeforeExport: true }],
],
},
},
plugins: ['ember'],
Expand All @@ -18,14 +21,23 @@ module.exports = {
],
env: {
browser: true,
node: true,
},
rules: {
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',

// TODO: remove this and fix issues raised
'ember/no-runloop': 'off',
},
rules: {},
overrides: [
// node files
{
files: [
'./.eslintrc.js',
'./.prettierrc.js',
'./.stylelintrc.js',
'./.template-lintrc.js',
'./ember-cli-build.js',
'./testem.js',
Expand All @@ -41,13 +53,7 @@ module.exports = {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
rules: {
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',
},
extends: ['plugin:n/recommended'],
},
{
// test files
Expand Down
14 changes: 5 additions & 9 deletions ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
/blueprints/*/index.js
/blueprints/*/files/
/blueprints/*/index.js

# unconventional js
/blueprints/*/files/
/vendor/

# compiled output
/dist/
/tmp/

# dependencies
/bower_components/
/node_modules/

# misc
/coverage/
!.*
.eslintcache
.lint-todo/
.*/

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
10 changes: 10 additions & 0 deletions ui/.stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# unconventional files
/blueprints/*/files/
/coverage/*

# compiled output
/dist/
/dist-prod/

# addons
/.node_modules.ember-try/
13 changes: 13 additions & 0 deletions ui/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

module.exports = {
extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
rules: {
'at-rule-no-unknown': [
true,
{
ignoreAtRules: ['/tailwind/'],
},
],
},
};
4 changes: 2 additions & 2 deletions ui/app/adapters/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ export default class ApplicationAdapter extends RESTAdapter {
return payload;
} else if (this.isInvalid(status, headers, payload)) {
return new InvalidError(
typeof payload === 'object' ? payload.details : undefined
typeof payload === 'object' ? payload.details : undefined,
);
}

const handledResponse = super.handleResponse(
status,
headers,
payload,
requestData
requestData,
);

if (handledResponse.isAdapterError) {
Expand Down
8 changes: 4 additions & 4 deletions ui/app/components/pipeline-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default class PipelineEditorComponent extends Component {
'connectorPlugin',
'pipeline',
],
}
},
);
});
}
Expand Down Expand Up @@ -179,7 +179,7 @@ export default class PipelineEditorComponent extends Component {
'connectorPlugin',
'pipeline',
],
}
},
);
this.isShowingNewConnectorModal = true;
}
Expand Down Expand Up @@ -249,7 +249,7 @@ export default class PipelineEditorComponent extends Component {
await connector.data.destroyRecord();

this.wrappedConnectors.removeObject(
this.wrappedConnectors.findBy('id', connectorId)
this.wrappedConnectors.findBy('id', connectorId),
);
this.pipelineNodeManager.regeneratePaths();
this.selectNode(null);
Expand All @@ -263,7 +263,7 @@ export default class PipelineEditorComponent extends Component {
function () {
this.selectedNode = node;
},
10
10,
);

if (event) {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/components/pipeline-editor/config-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class PipelineEditorConfigFieldComponent extends Component {
generateSelectOptions() {
const inclusionValidation = this.args.field.rawValidations.findBy(
'type',
'TYPE_INCLUSION'
'TYPE_INCLUSION',
);
return inclusionValidation.value.split(',').map((item) => {
return {
Expand Down
6 changes: 3 additions & 3 deletions ui/app/components/pipeline-editor/connector-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class PipelineEditorNewConnectorModal extends Component {
if (this.isEditing) {
this.blueprintFields = generateBlueprintFields(
this.connector.plugin.getParams(this.connector.type),
this.connector
this.connector,
);
} else {
this.blueprintFields = [];
Expand Down Expand Up @@ -149,7 +149,7 @@ export default class PipelineEditorNewConnectorModal extends Component {
this.connector.validate();
this.blueprintFields = generateBlueprintFields(
plugin.getParams(this.connector.type),
this.connector
this.connector,
);
}
this.isShowingRequiredTab = true;
Expand All @@ -162,7 +162,7 @@ export default class PipelineEditorNewConnectorModal extends Component {
if (fieldChangeset.isValid) {
this.connector.set(
`config.settings.${fieldChangeset.id}`,
fieldChangeset.value
fieldChangeset.value,
);
} else {
this.connector.set(`config.settings.${fieldChangeset.id}`, undefined);
Expand Down
6 changes: 3 additions & 3 deletions ui/app/components/pipeline-editor/connector-slide-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class PipelineEditorConnectorSlidePanel extends Component {
ConnectorTransformValidations,
{
changesetKeys: ['type', 'config', 'parent'],
}
},
);
});
}
Expand All @@ -68,7 +68,7 @@ export default class PipelineEditorConnectorSlidePanel extends Component {
ConnectorTransformValidations,
{
changesetKeys: ['type', 'config', 'parent', 'transform'],
}
},
);

this.isShowingNewTransformPanel = true;
Expand Down Expand Up @@ -136,7 +136,7 @@ export default class PipelineEditorConnectorSlidePanel extends Component {
ConnectorTransformValidations,
{
changesetKeys: ['type', 'config', 'parent', 'transform'],
}
},
);

this.addTransform(changeset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ export default class PipelineEditorConnectorSlidePanelTransformPanel extends Com
this.connectorTransform = this.args.connectorTransform;
this.blueprintFields = generateBlueprintFields(
this.connectorTransform.data.transform.blueprint,
this.connectorTransform
this.connectorTransform,
);

this.selectedTransformOnOption = this.transformOnOptions.findBy(
'value',
this.connectorTransform.type
this.connectorTransform.type,
);
}

Expand Down Expand Up @@ -52,7 +52,7 @@ export default class PipelineEditorConnectorSlidePanelTransformPanel extends Com
this.connectorTransform.type = option.value;
this.selectedTransformOnOption = this.transformOnOptions.findBy(
'value',
option.value
option.value,
);
}

Expand All @@ -63,7 +63,7 @@ export default class PipelineEditorConnectorSlidePanelTransformPanel extends Com
if (fieldChangeset.isValid) {
this.connectorTransform.set(
`config.settings.${fieldChangeset.id}`,
fieldChangeset.value
fieldChangeset.value,
);
} else {
this.connectorTransform.set(`config.${fieldChangeset.id}`, undefined);
Expand Down
2 changes: 1 addition & 1 deletion ui/app/controllers/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class PipelineController extends Controller {
pipeline.onPipelineEvent(
'onPipelineDegraded',
this,
this._handlePipelineRunError
this._handlePipelineRunError,
);
pipeline.pollPipeline.perform();
}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/modifiers/scroll-bottom.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export default modifier(
element.scrollTop = 0;
};
},
{ eager: false }
{ eager: false },
);
2 changes: 1 addition & 1 deletion ui/app/modifiers/zoom-zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ export default modifier(
select('#editor-container').on('.zoom', null);
};
},
{ eager: false }
{ eager: false },
);
2 changes: 1 addition & 1 deletion ui/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Router.map(function () {
function () {
// => this.route('index');
this.route('settings');
}
},
);
});

Expand Down
4 changes: 3 additions & 1 deletion ui/app/routes/home.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { inject as service } from '@ember/service';
import Route from '@ember/routing/route';

export default class HomeRoute extends Route {
@service('router') router;
redirect() {
this.transitionTo('pipelines');
this.router.transitionTo('pipelines');
}
}
2 changes: 1 addition & 1 deletion ui/app/routes/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class PipelineRoute extends Route {
PipelineValidations,
{
changesetKeys: ['name', 'description'],
}
},
);
pipeline.validate();
} else {
Expand Down
2 changes: 1 addition & 1 deletion ui/app/routes/pipeline/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class PipelineSettingsRoute extends Route {
PipelineValidations,
{
changesetKeys: ['name', 'description', 'tags'],
}
},
);
}

Expand Down
8 changes: 4 additions & 4 deletions ui/app/serializers/connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export default class ConnectorSerializer extends ApplicationSerializer {
const configSettings = super._replaceKeys(
snapshot.record.config.settings,
'@@',
'.'
'.',
);

snapshot.record.config.settings = configSettings;

return {
config: snapshot.record.config,
type: Object.keys(CONNECTOR_TYPE_MAP).find(
(key) => CONNECTOR_TYPE_MAP[key] === snapshot.record.type
(key) => CONNECTOR_TYPE_MAP[key] === snapshot.record.type,
),
plugin: snapshot.record.plugin.get('id'),
pipeline_id: snapshot.record.pipeline.get('id'),
Expand All @@ -33,7 +33,7 @@ export default class ConnectorSerializer extends ApplicationSerializer {
const hasOnlyType = /^(any|builtin|standalone):[\w-]+$/.test(matchTo);
const hasOnlyVersion = /^[\w-]+@v\S+$/.test(matchTo);
const hasTypeAndVersion = /^(any|builtin|standalone):[\w-]+@v\S+$/.test(
matchTo
matchTo,
);

let pluginName = matchTo;
Expand Down Expand Up @@ -126,7 +126,7 @@ export default class ConnectorSerializer extends ApplicationSerializer {
const configSettings = super._replaceKeys(
hash.config?.settings,
'.',
'@@'
'@@',
);
hash.config.settings = configSettings;
}
Expand Down
2 changes: 1 addition & 1 deletion ui/app/serializers/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class ConnectorPluginSerializer extends ApplicationSerializer {
hash.destinationParams = super._replaceKeys(
hash.destinationParams,
'.',
'@@'
'@@',
);

return super.normalize(typeClass, hash);
Expand Down
Loading