Skip to content

[CLA Approved] feat: AMD -> ES6 #7029

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

Merged
merged 23 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
df7affc
feat: full amd -> es6 conversion
tristan-f-r Sep 1, 2023
dbb451f
fix: move MCT to ES6 class
tristan-f-r Sep 1, 2023
fc1297b
fix: default drop, correct imports
tristan-f-r Sep 1, 2023
381c263
fix: correct all imports
tristan-f-r Sep 1, 2023
bca638a
fix: property typo
tristan-f-r Sep 1, 2023
084d0d9
fix: avoid anonymous functions
tristan-f-r Sep 1, 2023
912b511
fix: correct typo
tristan-f-r Sep 1, 2023
c85c644
fix: use proper uuid format
tristan-f-r Sep 1, 2023
39466e7
Merge branch 'master' into master
tristan-f-r Sep 1, 2023
a5beda1
Merge branch 'master' into master
tristan-f-r Sep 4, 2023
3dad3f4
Merge remote-tracking branch 'upstream/master'
tristan-f-r Dec 21, 2023
000cdac
style: fmt
tristan-f-r Dec 21, 2023
cad0288
fix: import vue correctly, get correct layout
tristan-f-r Dec 21, 2023
a4a3c85
fix: createApp without JSON
tristan-f-r Dec 21, 2023
4e3e00d
fix: don't use default on InspectorDataVisualization
tristan-f-r Dec 22, 2023
8b84d41
fix: remove more .default calls
tristan-f-r Dec 22, 2023
951c92b
Update src/api/api.js
tristan-f-r Dec 23, 2023
3e97dfc
Update src/plugins/plugins.js
tristan-f-r Dec 23, 2023
b141453
Update src/plugins/plugins.js
tristan-f-r Dec 23, 2023
dec34ed
fix: suggestions
tristan-f-r Dec 23, 2023
3d75f35
fix: drop unnecessary this.annotation initialization
tristan-f-r Dec 23, 2023
3564a47
fix: move all initialization calls to constructor
tristan-f-r Dec 23, 2023
9dfbdaf
refactor: move vue dist import to webpack alias
tristan-f-r Dec 27, 2023
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
3 changes: 2 additions & 1 deletion .webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ const config = {
MCT: path.join(projectRootDir, 'src/MCT'),
testUtils: path.join(projectRootDir, 'src/utils/testUtils.js'),
objectUtils: path.join(projectRootDir, 'src/api/objects/object-utils.js'),
utils: path.join(projectRootDir, 'src/utils')
utils: path.join(projectRootDir, 'src/utils'),
vue: 'vue/dist/vue.esm-bundler'
}
},
plugins: [
Expand Down
260 changes: 128 additions & 132 deletions example/generator/GeneratorMetadataProvider.js
Original file line number Diff line number Diff line change
@@ -1,138 +1,134 @@
define(['lodash'], function (_) {
var METADATA_BY_TYPE = {
generator: {
values: [
{
key: 'name',
name: 'Name',
format: 'string'
},
{
key: 'utc',
name: 'Time',
format: 'utc',
hints: {
domain: 1
}
},
{
key: 'yesterday',
name: 'Yesterday',
format: 'utc',
hints: {
domain: 2
}
},
{
key: 'wavelengths',
name: 'Wavelength',
unit: 'nm',
format: 'string[]',
hints: {
range: 4
}
},
// Need to enable "LocalTimeSystem" plugin to make use of this
// {
// key: "local",
// name: "Time",
// format: "local-format",
// source: "utc",
// hints: {
// domain: 3
// }
// },
{
key: 'sin',
name: 'Sine',
unit: 'Hz',
formatString: '%0.2f',
hints: {
range: 1
}
},
{
key: 'cos',
name: 'Cosine',
unit: 'deg',
formatString: '%0.2f',
hints: {
range: 2
}
},
{
key: 'intensities',
name: 'Intensities',
format: 'number[]',
hints: {
range: 3
}
const METADATA_BY_TYPE = {
generator: {
values: [
{
key: 'name',
name: 'Name',
format: 'string'
},
{
key: 'utc',
name: 'Time',
format: 'utc',
hints: {
domain: 1
}
]
},
'example.state-generator': {
values: [
{
key: 'name',
name: 'Name',
format: 'string'
},
{
key: 'utc',
name: 'Time',
format: 'utc',
hints: {
domain: 1
}
},
{
key: 'local',
name: 'Time',
format: 'utc',
source: 'utc',
hints: {
domain: 2
}
},
{
key: 'state',
source: 'value',
name: 'State',
format: 'enum',
enumerations: [
{
value: 0,
string: 'OFF'
},
{
value: 1,
string: 'ON'
}
],
hints: {
range: 1
}
},
{
key: 'value',
name: 'Value',
hints: {
range: 2
},
{
key: 'yesterday',
name: 'Yesterday',
format: 'utc',
hints: {
domain: 2
}
},
{
key: 'wavelengths',
name: 'Wavelength',
unit: 'nm',
format: 'string[]',
hints: {
range: 4
}
},
// Need to enable "LocalTimeSystem" plugin to make use of this
// {
// key: "local",
// name: "Time",
// format: "local-format",
// source: "utc",
// hints: {
// domain: 3
// }
// },
{
key: 'sin',
name: 'Sine',
unit: 'Hz',
formatString: '%0.2f',
hints: {
range: 1
}
},
{
key: 'cos',
name: 'Cosine',
unit: 'deg',
formatString: '%0.2f',
hints: {
range: 2
}
},
{
key: 'intensities',
name: 'Intensities',
format: 'number[]',
hints: {
range: 3
}
}
]
},
'example.state-generator': {
values: [
{
key: 'name',
name: 'Name',
format: 'string'
},
{
key: 'utc',
name: 'Time',
format: 'utc',
hints: {
domain: 1
}
},
{
key: 'local',
name: 'Time',
format: 'utc',
source: 'utc',
hints: {
domain: 2
}
},
{
key: 'state',
source: 'value',
name: 'State',
format: 'enum',
enumerations: [
{
value: 0,
string: 'OFF'
},
{
value: 1,
string: 'ON'
}
],
hints: {
range: 1
}
]
}
};

function GeneratorMetadataProvider() {}
},
{
key: 'value',
name: 'Value',
hints: {
range: 2
}
}
]
}
};

GeneratorMetadataProvider.prototype.supportsMetadata = function (domainObject) {
return Object.prototype.hasOwnProperty.call(METADATA_BY_TYPE, domainObject.type);
};
export default function GeneratorMetadataProvider() {}

GeneratorMetadataProvider.prototype.getMetadata = function (domainObject) {
return Object.assign({}, domainObject.telemetry, METADATA_BY_TYPE[domainObject.type]);
};
GeneratorMetadataProvider.prototype.supportsMetadata = function (domainObject) {
return Object.prototype.hasOwnProperty.call(METADATA_BY_TYPE, domainObject.type);
};

return GeneratorMetadataProvider;
});
GeneratorMetadataProvider.prototype.getMetadata = function (domainObject) {
return Object.assign({}, domainObject.telemetry, METADATA_BY_TYPE[domainObject.type]);
};
Loading