@finos/legend-application-studio
Version:
Legend Studio application core
81 lines • 3.57 kB
JavaScript
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { observe_AccessPoint, observe_AccessPointGroup, observe_SupportInfo, observe_Email, SupportInfo, } from '@finos/legend-graph';
import { addUniqueEntry, deleteEntry, swapEntry } from '@finos/legend-shared';
import { action } from 'mobx';
export const dataProduct_deleteAccessPoint = action((group, accessPoint) => {
deleteEntry(group.accessPoints, accessPoint);
});
export const dataProduct_addAccessPoint = action((group, accessPoint) => {
addUniqueEntry(group.accessPoints, observe_AccessPoint(accessPoint));
});
export const accessPoint_setClassification = action((accessPoint, classification) => {
accessPoint.classification = classification;
});
export const accessPoint_setReproducible = action((accessPoint, reproducible) => {
accessPoint.reproducible = reproducible;
});
export const accessPointGroup_setDescription = action((group, description) => {
group.description = description;
});
export const accessPointGroup_setName = action((group, name) => {
group.id = name;
});
export const accessPointGroup_swapAccessPoints = action((group, sourceAp, targetAp) => {
swapEntry(group.accessPoints, sourceAp, targetAp);
});
export const dataProduct_addAccessPointGroup = action((product, accessPointGroup) => {
addUniqueEntry(product.accessPointGroups, observe_AccessPointGroup(accessPointGroup));
});
export const dataProduct_deleteAccessPointGroup = action((product, accessPointGroup) => {
deleteEntry(product.accessPointGroups, accessPointGroup);
});
export const dataProduct_swapAccessPointGroups = action((product, sourceGroup, targetGroup) => {
swapEntry(product.accessPointGroups, sourceGroup, targetGroup);
});
export const dataProduct_setTitle = action((product, title) => {
product.title = title;
});
export const dataProduct_setDescription = action((product, description) => {
product.description = description;
});
export const dataProduct_setSupportInfoIfAbsent = action((product) => {
if (!product.supportInfo) {
product.supportInfo = observe_SupportInfo(new SupportInfo());
}
});
export const supportInfo_setDocumentationUrl = action((supportInfo, documentationUrl) => {
supportInfo.documentationUrl = documentationUrl;
});
export const supportInfo_setWebsite = action((supportInfo, website) => {
supportInfo.website = website;
});
export const supportInfo_setFaqUrl = action((supportInfo, faqUrl) => {
supportInfo.faqUrl = faqUrl;
});
export const supportInfo_setSupportUrl = action((supportInfo, supportUrl) => {
supportInfo.supportUrl = supportUrl;
});
export const supportInfo_addEmail = action((supportInfo, email) => {
addUniqueEntry(supportInfo.emails, observe_Email(email));
});
export const supportInfo_deleteEmail = action((supportInfo, email) => {
const index = supportInfo.emails.indexOf(email);
if (index !== -1) {
supportInfo.emails.splice(index, 1);
}
});
//# sourceMappingURL=DSL_DataProduct_GraphModifierHelper.js.map