Skip to content

Commit

Permalink
style: fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
smessie committed Dec 20, 2023
1 parent 4cc14db commit 13af5bb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
28 changes: 14 additions & 14 deletions app/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default class IndexController extends Controller {
this.model.fields.forEach((field) => {
// Find the original field.
const originalField = this.model.originalFields.find(
(f) => f.uuid === field.uuid
(f) => f.uuid === field.uuid,
);
if (originalField) {
// Check if the field has been updated.
Expand Down Expand Up @@ -194,12 +194,12 @@ export default class IndexController extends Controller {
${this.stringifyFormSubject(
this.model.loadedFormUri,
this.model.formTargetClass,
this.model.fields
this.model.fields,
)}
${this.stringifyFields(
this.model.loadedFormUri,
this.model.formTargetClass,
fieldsToInsert
fieldsToInsert,
)}
}`;
if (this.model.newForm) {
Expand All @@ -210,12 +210,12 @@ export default class IndexController extends Controller {
${this.stringifyFormSubject(
this.model.loadedFormUri,
this.model.originalFormTargetClass,
this.model.originalFields
this.model.originalFields,
)}
${this.stringifyFields(
this.model.loadedFormUri,
this.model.originalFormTargetClass,
fieldsToDelete
fieldsToDelete,
)}
} .
`;
Expand Down Expand Up @@ -243,8 +243,8 @@ export default class IndexController extends Controller {
// Remove all N3 rules that are Submit event policies as we are regenerating them after this.
const keepRules = await Promise.all(
matches.rules.map(
async (rule) => await this.isEventSubmitRule(rule, matches.prefixes)
)
async (rule) => await this.isEventSubmitRule(rule, matches.prefixes),
),
);
matches.rules = matches.rules.filter((rule, index) => !keepRules[index]);

Expand All @@ -257,17 +257,17 @@ export default class IndexController extends Controller {
matches.prefixes = this.model.addIfNotIncluded(
matches.prefixes,
'ex',
'http://example.org/'
'http://example.org/',
);
matches.prefixes = this.model.addIfNotIncluded(
matches.prefixes,
'fno',
'https://w3id.org/function/ontology#'
'https://w3id.org/function/ontology#',
);
matches.prefixes = this.model.addIfNotIncluded(
matches.prefixes,
'pol',
'https://www.example.org/ns/policy#'
'https://www.example.org/ns/policy#',
);

// Re-add the N3 rules to the resource.
Expand All @@ -277,7 +277,7 @@ export default class IndexController extends Controller {
// On successful save, update the original fields to the current fields.
this.model.originalFields = JSON.parse(JSON.stringify(this.model.fields));
this.model.originalPolicies = JSON.parse(
JSON.stringify(this.model.policies)
JSON.stringify(this.model.policies),
);
this.model.originalFormTargetClass = this.model.formTargetClass;
} else {
Expand Down Expand Up @@ -418,7 +418,7 @@ export default class IndexController extends Controller {
// Do call to prefix.cc to get the full URI
const [prefix, suffix] = binding.split(':');
const response = await fetch(
`https://prefixcc-proxy.smessie.com/${prefix}.file.json`
`https://prefixcc-proxy.smessie.com/${prefix}.file.json`,
);
const json = await response.json();
const uri = json[prefix];
Expand Down Expand Up @@ -551,7 +551,7 @@ export default class IndexController extends Controller {
const reasonerResult = await n3reasoner(
'?id <http://example.org/event> <http://example.org/Submit> .',
query,
options
options,
);
return reasonerResult.length > 0;
}
Expand Down Expand Up @@ -585,7 +585,7 @@ export default class IndexController extends Controller {
removePolicy(policy, event) {
event?.preventDefault();
this.model.policies = this.model.policies.filter(
(p) => p.uuid !== policy.uuid
(p) => p.uuid !== policy.uuid,
);
}

Expand Down
12 changes: 6 additions & 6 deletions app/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class IndexRoute extends Route {
if (this.solidAuth.loggedIn) {
const storageRoot = await findStorageRoot(
this.solidAuth.loggedIn,
fetch
fetch,
);
this.loadedFormUri = `${storageRoot}private/tests/forms/${uuid()}.n3#${uuid()}`;
} else {
Expand Down Expand Up @@ -102,7 +102,7 @@ export default class IndexRoute extends Route {
const reasonerResult = await n3reasoner(
`?id <http://example.org/event> <http://example.org/Submit> .`,
content,
options
options,
);

// Parse policies.
Expand Down Expand Up @@ -161,7 +161,7 @@ export default class IndexRoute extends Route {
new URL(this.loadedFormUri /*, await this.solidAuth.podBase*/).href,
{
method: 'GET',
}
},
);

if (!response.ok) {
Expand Down Expand Up @@ -373,7 +373,7 @@ export default class IndexRoute extends Route {
uri: row.get('field').value,
type: row.get('type')?.value,
widget: this.shaclTypeToWidget(
row.get('type')?.value || row.get('nodeKind')?.value
row.get('type')?.value || row.get('nodeKind')?.value,
),
nodeKind: row.get('nodeKind')?.value,
property: row.get('property')?.value,
Expand Down Expand Up @@ -556,7 +556,7 @@ export default class IndexRoute extends Route {
setTimeout(() => {
this.fields = fields;
resolve();
}, 0)
}, 0),
);
}

Expand All @@ -567,7 +567,7 @@ export default class IndexRoute extends Route {
setTimeout(() => {
this.policies = policies;
resolve();
}, 0)
}, 0),
);
}

Expand Down
1 change: 1 addition & 0 deletions app/styles/app.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.card {
margin-top: 1.5em;
}

.margin-top {
margin-top: 1.5em;
}
Expand Down

0 comments on commit 13af5bb

Please sign in to comment.