1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-18 20:59:43 +02:00

EmberJS: FolderID to SpaceID

Co-Authored-By: Harvey Kandola <harvey@documize.com>
This commit is contained in:
sauls8t 2018-10-12 17:54:15 +01:00
parent 66d5e73ed1
commit e0457b40da
45 changed files with 170 additions and 99 deletions

View file

@ -121,16 +121,16 @@ func (h *Handler) GetBySpace(w http.ResponseWriter, r *http.Request) {
method := "block.space"
ctx := domain.GetRequestContext(r)
folderID := request.Param(r, "folderID")
if len(folderID) == 0 {
response.WriteMissingDataError(w, method, "folderID")
spaceID := request.Param(r, "spaceID")
if len(spaceID) == 0 {
response.WriteMissingDataError(w, method, "spaceID")
return
}
var b []block.Block
var err error
b, err = h.Store.Block.GetBySpace(ctx, folderID)
b, err = h.Store.Block.GetBySpace(ctx, spaceID)
if len(b) == 0 {
b = []block.Block{}

View file

@ -51,9 +51,9 @@ func (h *Handler) upload(w http.ResponseWriter, r *http.Request) (string, string
method := "conversion.upload"
ctx := domain.GetRequestContext(r)
folderID := request.Param(r, "folderID")
spaceID := request.Param(r, "spaceID")
if !permission.CanUploadDocument(ctx, *h.Store, folderID) {
if !permission.CanUploadDocument(ctx, *h.Store, spaceID) {
response.WriteForbiddenError(w)
return "", "", ""
}
@ -92,10 +92,10 @@ func (h *Handler) upload(w http.ResponseWriter, r *http.Request) (string, string
h.Runtime.Log.Info(fmt.Sprintf("Org %s (%s) [Uploaded] %s", ctx.OrgName, ctx.OrgID, filename.Filename))
return job, folderID, ctx.OrgID
return job, spaceID, ctx.OrgID
}
func (h *Handler) convert(w http.ResponseWriter, r *http.Request, job, folderID string, conversion api.ConversionJobRequest) {
func (h *Handler) convert(w http.ResponseWriter, r *http.Request, job, spaceID string, conversion api.ConversionJobRequest) {
method := "conversion.upload"
ctx := domain.GetRequestContext(r)
@ -145,7 +145,7 @@ func (h *Handler) convert(w http.ResponseWriter, r *http.Request, job, folderID
}
// Fetch space where document resides.
sp, err := h.Store.Space.Get(ctx, folderID)
sp, err := h.Store.Space.Get(ctx, spaceID)
if err != nil {
ctx.Transaction.Rollback()
response.WriteServerError(w, method, err)

View file

@ -29,12 +29,12 @@ type Handler struct {
// UploadConvert is an endpoint to both upload and convert a document
func (h *Handler) UploadConvert(w http.ResponseWriter, r *http.Request) {
job, folderID, orgID := h.upload(w, r)
job, spaceID, orgID := h.upload(w, r)
if job == "" {
return // error already handled
}
h.convert(w, r, job, folderID, api.ConversionJobRequest{
h.convert(w, r, job, spaceID, api.ConversionJobRequest{
Job: job,
IndexDepth: 4,
OrgID: orgID,

View file

@ -39,9 +39,9 @@ func (h *Handler) GetLinkCandidates(w http.ResponseWriter, r *http.Request) {
method := "link.Candidates"
ctx := domain.GetRequestContext(r)
folderID := request.Param(r, "folderID")
if len(folderID) == 0 {
response.WriteMissingDataError(w, method, "folderID")
spaceID := request.Param(r, "spaceID")
if len(spaceID) == 0 {
response.WriteMissingDataError(w, method, "spaceID")
return
}
@ -81,7 +81,7 @@ func (h *Handler) GetLinkCandidates(w http.ResponseWriter, r *http.Request) {
if p.RefID != pageID {
c := link.Candidate{
RefID: uniqueid.Generate(),
SpaceID: folderID,
SpaceID: spaceID,
DocumentID: documentID,
TargetID: p.RefID,
LinkType: p.Type,
@ -109,7 +109,7 @@ func (h *Handler) GetLinkCandidates(w http.ResponseWriter, r *http.Request) {
for _, f := range files {
c := link.Candidate{
RefID: uniqueid.Generate(),
SpaceID: folderID,
SpaceID: spaceID,
DocumentID: documentID,
TargetID: f.RefID,
LinkType: "file",

View file

@ -53,13 +53,13 @@ func (h *Handler) SavedList(w http.ResponseWriter, r *http.Request) {
method := "template.saved"
ctx := domain.GetRequestContext(r)
folderID := request.Param(r, "folderID")
if len(folderID) == 0 {
response.WriteMissingDataError(w, method, "folderID")
spaceID := request.Param(r, "spaceID")
if len(spaceID) == 0 {
response.WriteMissingDataError(w, method, "spaceID")
return
}
documents, err := h.Store.Document.TemplatesBySpace(ctx, folderID)
documents, err := h.Store.Document.TemplatesBySpace(ctx, spaceID)
if err != nil {
response.WriteServerError(w, method, err)
h.Runtime.Log.Error(method, err)
@ -77,7 +77,7 @@ func (h *Handler) SavedList(w http.ResponseWriter, r *http.Request) {
t.Dated = d.Created
t.Type = template.TypePrivate
if d.SpaceID == folderID {
if d.SpaceID == spaceID {
templates = append(templates, t)
}
}
@ -266,9 +266,9 @@ func (h *Handler) Use(w http.ResponseWriter, r *http.Request) {
method := "template.use"
ctx := domain.GetRequestContext(r)
folderID := request.Param(r, "folderID")
if len(folderID) == 0 {
response.WriteMissingDataError(w, method, "folderID")
spaceID := request.Param(r, "spaceID")
if len(spaceID) == 0 {
response.WriteMissingDataError(w, method, "spaceID")
return
}
@ -295,7 +295,7 @@ func (h *Handler) Use(w http.ResponseWriter, r *http.Request) {
d.Excerpt = "Add detailed description for document..."
d.Slug = stringutil.MakeSlug(d.Name)
d.Tags = ""
d.SpaceID = folderID
d.SpaceID = spaceID
documentID := uniqueid.Generate()
d.RefID = documentID
@ -321,7 +321,7 @@ func (h *Handler) Use(w http.ResponseWriter, r *http.Request) {
}
// Fetch space where document resides.
sp, err := h.Store.Space.Get(ctx, folderID)
sp, err := h.Store.Space.Get(ctx, spaceID)
if err != nil {
response.WriteServerError(w, method, err)
h.Runtime.Log.Error(method, err)
@ -339,7 +339,7 @@ func (h *Handler) Use(w http.ResponseWriter, r *http.Request) {
documentID = uniqueid.Generate()
d.RefID = documentID
d.Template = false
d.SpaceID = folderID
d.SpaceID = spaceID
d.UserID = ctx.UserID
d.Name = docTitle

View file

@ -127,7 +127,7 @@ export default Component.extend(ModalMixin, TooltipMixin, {
selection = {
context: '',
documentId: documentId,
folderId: folderId,
spaceId: folderId,
id: stringUtil.makeId(16),
linkType: 'network',
targetId: '',

View file

@ -147,7 +147,7 @@ export default Component.extend(ModalMixin, Tooltips, {
this.get('documentService').getPageMeta(this.get('document.id'), page.get('id')).then((pm) => {
let block = {
folderId: this.get('folder.id'),
spaceId: this.get('folder.id'),
contentType: page.get('contentType'),
pageType: page.get('pageType'),
title: blockTitle,

View file

@ -137,7 +137,7 @@ export default Component.extend(Notifier, {
// prepare links associated with document
link.forEach((l) => {
let t = {
folderId: folderId,
spaceId: folderId,
documentId: docId,
categoryId: l.get('id')
};
@ -148,7 +148,7 @@ export default Component.extend(Notifier, {
// prepare links no longer associated with document
unlink.forEach((l) => {
let t = {
folderId: folderId,
spaceId: folderId,
documentId: docId,
categoryId: l.get('id')
};

View file

@ -108,7 +108,7 @@ export default Component.extend(ModalMixin, TooltipMixin, Notifer, {
let c = {
category: cat,
folderId: this.get('space.id')
spaceId: this.get('space.id')
};
this.showWait();

View file

@ -41,11 +41,11 @@ export default Component.extend(AuthMixin, Notifier, {
let folder = this.get('space');
let spaceTypeOptions = A([]);
spaceTypeOptions.pushObject({id: constants.FolderType.Private, label: 'Private - viewable only by me'});
spaceTypeOptions.pushObject({id: constants.FolderType.Protected, label: 'Protected - access is restricted to selected users'});
spaceTypeOptions.pushObject({id: constants.FolderType.Public, label: 'Public - can be seen by everyone'});
spaceTypeOptions.pushObject({id: constants.SpaceType.Private, label: 'Private - viewable only by me'});
spaceTypeOptions.pushObject({id: constants.SpaceType.Protected, label: 'Protected - access is restricted to selected users'});
spaceTypeOptions.pushObject({id: constants.SpaceType.Public, label: 'Public - can be seen by everyone'});
this.set('spaceTypeOptions', spaceTypeOptions);
this.set('spaceType', spaceTypeOptions.findBy('id', folder.get('folderType')));
this.set('spaceType', spaceTypeOptions.findBy('id', folder.get('spaceType')));
this.set('allowLikes', folder.get('allowLikes'));
@ -75,7 +75,7 @@ export default Component.extend(AuthMixin, Notifier, {
if (!this.get('isSpaceAdmin')) return;
let space = this.get('space');
space.set('folderType', this.get('spaceType.id'));
space.set('spaceType', this.get('spaceType.id'));
let allowLikes = this.get('allowLikes');
space.set('likes', allowLikes ? this.get('likes') : '');

View file

@ -99,7 +99,7 @@ export default Component.extend(Notifier, Modals, {
let raw = {
id: stringUtil.makeId(16),
orgId: this.get('folder.orgId'),
folderId: this.get('folder.id'),
spaceId: this.get('folder.id'),
whoId: whoId,
who: who,
name: name,

View file

@ -92,7 +92,7 @@ export default Component.extend(ModalMixin, {
actions: {
jumpToPin(pin) {
let folderId = pin.get('folderId');
let folderId = pin.get('spaceId');
let documentId = pin.get('documentId');
if (_.isEmpty(documentId)) {

View file

@ -36,13 +36,13 @@ export default Component.extend(TooltipMixin, NotifierMixin, AuthMixin, {
let privateFolders = [];
_.each(folders, folder => {
if (folder.get('folderType') === constants.FolderType.Public) {
if (folder.get('spaceType') === constants.SpaceType.Public) {
publicFolders.pushObject(folder);
}
if (folder.get('folderType') === constants.FolderType.Private) {
if (folder.get('spaceType') === constants.SpaceType.Private) {
privateFolders.pushObject(folder);
}
if (folder.get('folderType') === constants.FolderType.Protected) {
if (folder.get('spaceType') === constants.SpaceType.Protected) {
protectedFolders.pushObject(folder);
}
});

View file

@ -92,7 +92,7 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, Notifier, {
let pin = {
pin: this.get('pinState.newName'),
documentId: this.get('document.id'),
folderId: this.get('space.id')
spaceId: this.get('space.id')
};
this.get('pinned').pinItem(pin).then((pin) => {

View file

@ -164,7 +164,7 @@ export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, Notifier, {
let pin = {
pin: this.get('pinState.newName'),
documentId: '',
folderId: this.get('space.id')
spaceId: this.get('space.id')
};
this.get('pinned').pinItem(pin).then((pin) => {

View file

@ -15,7 +15,7 @@ import EmberObject from "@ember/object";
// let constants = this.get('constants');
let constants = EmberObject.extend({
FolderType: { // eslint-disable-line ember/avoid-leaking-state-in-ember-objects
SpaceType: { // eslint-disable-line ember/avoid-leaking-state-in-ember-objects
Public: 1,
Private: 2,
Protected: 3

View file

@ -14,7 +14,7 @@ import attr from 'ember-data/attr';
export default Model.extend({
orgId: attr('string'),
folderId: attr('string'),
spaceId: attr('string'),
userId: attr('string'),
contentType: attr('string'),
pageType: attr('string'),

View file

@ -14,7 +14,7 @@ import attr from 'ember-data/attr';
export default Model.extend({
orgId: attr('string'),
folderId: attr('string'),
spaceId: attr('string'),
category: attr('string'),
created: attr(),
revised: attr(),

View file

@ -15,7 +15,7 @@ import attr from 'ember-data/attr';
export default Model.extend({
orgId: attr('string'),
folderId: attr('string'),
spaceId: attr('string'),
documentId: attr('string'),
pageId: attr('string'),
pageTitle: attr('string'),

View file

@ -20,7 +20,7 @@ export default Model.extend({
job: attr('string'),
location: attr('string'),
orgId: attr('string'),
folderId: attr('string'),
spaceId: attr('string'),
userId: attr('string'),
tags: attr('string'),
template: attr('boolean'),

View file

@ -18,7 +18,7 @@ export default Model.extend({
name: attr('string'),
orgId: attr('string'),
userId: attr('string'),
folderType: attr('number', { defaultValue: 2 }),
spaceType: attr('number', { defaultValue: 2 }),
lifecycle: attr('number', { defaultValue: 1 }),
likes: attr('string'),
@ -32,17 +32,17 @@ export default Model.extend({
markAsRestricted() {
let constants = this.get('constants');
this.set('folderType', constants.FolderType.Protected);
this.set('spaceType', constants.SpaceType.Protected);
},
markAsPrivate() {
let constants = this.get('constants');
this.set('folderType', constants.FolderType.Private);
this.set('spaceType', constants.SpaceType.Private);
},
markAsPublic() {
let constants = this.get('constants');
this.set('folderType', constants.FolderType.Public);
this.set('spaceType', constants.SpaceType.Public);
},
// client-side prop that holds who can see this folder

View file

@ -16,7 +16,7 @@ import { computed } from '@ember/object';
export default Model.extend({
orgId: attr('string'),
userId: attr('string'),
folderId: attr('string'),
spaceId: attr('string'),
documentId: attr('string'),
sequence: attr('number', { defaultValue: 99 }),
pin: attr('string'),

View file

@ -20,8 +20,8 @@ export default Model.extend({
firstname: attr('string'),
lastname: attr('string'),
name: attr('string'),
folderId: attr('string'),
folderType: attr('number', { defaultValue: 0 }),
spaceId: attr('string'),
spaceType: attr('number', { defaultValue: 0 }),
fullname: computed('firstname', 'lastname', function () {
return `${this.get('firstname')} ${this.get('lastname')}`;

View file

@ -14,7 +14,7 @@ import attr from 'ember-data/attr';
export default Model.extend({
orgId: attr('string'),
folderId: attr('string'),
spaceId: attr('string'),
whoId: attr('string'),
who: attr('string'),
spaceView: attr('boolean'),

View file

@ -16,7 +16,7 @@ import attr from 'ember-data/attr';
export default Model.extend({
documentName: attr('string'),
documentId: attr('string'),
folderId: attr('string'),
spaceId: attr('string'),
contributed: attr('string'),
viewed: attr('string'),
created: attr('string'),

View file

@ -20,6 +20,12 @@ export default Controller.extend({
if(this.get('session.isAdmin')) {
return this.get('global').backup(spec);
}
},
onRestore(spec, filedata) {
if(this.get('session.isAdmin')) {
return this.get('global').restore(spec, filedata);
}
}
}
});

View file

@ -1 +1 @@
{{customize/backup-restore onBackup=(action 'onBackup')}}
{{customize/backup-restore onBackup=(action 'onBackup') onRestore=(action 'onRestore')}}

View file

@ -65,7 +65,7 @@ export default Controller.extend(TooltipMixin, Notifier, {
this.set('deleteSpace.name', '');
this.get('folderService').adminList().then((folders) => {
let nonPrivateFolders = folders.rejectBy('folderType', 2);
let nonPrivateFolders = folders.rejectBy('spaceType', 2);
if (is.empty(nonPrivateFolders) || is.null(folders) || is.undefined(folders)) {
nonPrivateFolders = [];
}

View file

@ -27,7 +27,7 @@ export default Route.extend(AuthenticatedRouteMixin, {
},
setupController(controller, model) {
let nonPrivateFolders = model.rejectBy('folderType', 2);
let nonPrivateFolders = model.rejectBy('spaceType', 2);
if (is.empty(nonPrivateFolders) || is.null(model) || is.undefined(model)) {
nonPrivateFolders = [];
}

View file

@ -48,7 +48,7 @@ export default Controller.extend(NotifierMixin, {
all(promises1).then(() => {
promises1.forEach(function(doc, index) {
doc.then((d) => {
d.set('folderId', targetSpaceId);
d.set('spaceId', targetSpaceId);
d.set('selected', false);
promises2[index] = self.get('documentService').save(d);
});

View file

@ -410,7 +410,7 @@ export default Service.extend({
data.permissions = perms;
data.roles = roles;
data.folders = folders;
data.folder = folders.findBy('id', doc.get('folderId'));
data.folder = folders.findBy('id', doc.get('spaceId'));
data.links = response.links;
data.versions = response.versions;

View file

@ -82,7 +82,7 @@ export default Service.extend(Notifier, {
linkId: a.attributes["data-link-id"].value,
linkType: a.attributes["data-link-type"].value,
documentId: a.attributes["data-link-target-document-id"].value,
folderId: a.attributes["data-link-space-id"].value,
spaceId: a.attributes["data-link-space-id"].value,
targetId: a.attributes["data-link-target-id"].value,
externalId: is.undefined(a.attributes["data-link-external-id"]) ? '' : a.attributes["data-link-external-id"].value,
url: a.attributes["href"].value,

View file

@ -133,7 +133,7 @@ export default Service.extend({
return this.getUserPins().then((pins) => {
pins.forEach((pin) => {
if (pin.get('userId') === userId && pin.get('documentId') === '' && pin.get('folderId') === spaceId) {
if (pin.get('userId') === userId && pin.get('documentId') === '' && pin.get('spaceId') === spaceId) {
resolve(pin.get('id'));
}
});

View file

@ -8,17 +8,82 @@
</div>
<div class="view-customize">
<form class="mt-5 ">
<div class="form-group">
<p>It can take several minutes to complete the backup process &mdash; please be patient while the backup is running.</p>
<div class="btn btn-success my-5" {{action 'onBackup'}}>{{buttonLabel}}</div>
<div class="backup-restore">
<div class="backup-zone">
{{#if session.isGlobalAdmin}}
<div class="explain">
<p>
Documize is a multi-tenanted application enabling both "tech.mycompany.com" and "sales.mycompany.com" to run using the same executable/database.
As a Documize <b>Global</b> Administrator, you will be performing a complete system-wide backup across all tenants.
A regular Documize Administrator can login to perform just a tenant-level backup (e.g. marketing.mycompany.com).
</p>
</div>
{{/if}}
<p class="font-weight-bold">It can take several minutes to complete the backup process &mdash; please be patient while the backup operation is in progress</p>
<div class="margin-top-30 margin-bottom-20">
{{#ui/ui-checkbox selected=backupSpec.retain}}
Retain backup file on server
{{/ui/ui-checkbox}}
</div>
<button class="btn btn-success mb-3" {{action 'onBackup'}}>{{buttonLabel}}</button>
{{#if backupFailed}}
<p class="text-danger">Backup failed &mdash; please check server logs</p>
<div class="backup-fail">Backup failed &mdash; please check server logs</div>
{{/if}}
{{#if backupSuccess}}
<p class="font-weight-bold">Backup successful ({{backupFilename}})</p>
<div class="backup-success">Backup successful ({{backupFilename}})</div>
{{/if}}
</div>
</form>
</div>
<div class="backup-restore">
<div class="restore-zone">
{{#if session.isGlobalAdmin}}
<div class="explain">
<p class="font-weight-bold">WARNING:</p>
<p>
You should only perform a restore on a <b>new Documize instance</b> and NOT on the original instance.
Duplicate data might exist if you restore onto the same instance without first removing previous data.
</p>
</div>
{{/if}}
<p class="font-weight-bold">It can take up to an hour to complete the restore process &mdash; please be patient while the restore operation is in progress</p>
<div class="margin-top-30 margin-bottom-20">
<div class="custom-file">
<input type="file" class="custom-file-input" id="restore-file" accept="application/zip" multiple=false onchange={{action "upload"}}>
<label class="custom-file-label" for="restore-file">Choose backup file</label>
</div>
<div class="restore-upload-busy">
{{#if restoreUploadReady}}
<div class="ready">Ready to start restore</div>
{{/if}}
{{#if restoreUploading}}
<img src="/assets/img/busy-gray.gif" />
<div class="wait">Uploading file</div>
{{/if}}
</div>
<div class="margin-top-20"></div>
{{#ui/ui-checkbox selected=restoreSpec.overwriteOrg}}
Overwrite settings &mdash; SMTP, authentication, integrations and other settings
{{/ui/ui-checkbox}}
{{#ui/ui-checkbox selected=restoreSpec.recreateUsers}}
Recreate user accounts &mdash; users, groups, permissions
{{/ui/ui-checkbox}}
</div>
{{#if restoreFailed}}
<div class="restore-fail">Restore failed &mdash; please check server logs</div>
{{else if restoreSuccess}}
<div class="restore-success">Restore completed &mdash; restart your browser and log in</div>
{{else}}
{{#if restoreUploadReady}}
<button class="btn btn-danger mb-3" {{action 'onRestore'}}>{{restoreButtonLabel}}</button>
{{/if}}
{{/if}}
</div>
</div>
</div>

View file

@ -262,7 +262,7 @@ export default function () {
"name": name,
"orgId": "VzMuyEw_3WqiafcD",
"userId": "VzMuyEw_3WqiafcE",
"folderType": 2
"spaceType": 2
};
return schema.db.folders.insert(folder);
@ -346,7 +346,7 @@ export default function () {
"name": "Test Folder",
"orgId": "VzMuyEw_3WqiafcD",
"userId": "VzMuyEw_3WqiafcE",
"folderType": 2
"spaceType": 2
};
});

View file

@ -18,5 +18,5 @@ export default Mirage.Factory.extend({
"name": faker.list.cycle('My Project', 'Test'),
"orgId": "VzMuyEw_3WqiafcD",
"userId": "VzMuyEw_3WqiafcE",
"folderType": faker.list.cycle(1, 2)
"spaceType": faker.list.cycle(1, 2)
});

View file

@ -18,7 +18,7 @@ type UserActivity struct {
ID uint64 `json:"id"`
OrgID string `json:"orgId"`
UserID string `json:"userId"`
SpaceID string `json:"folderId"`
SpaceID string `json:"spaceId"`
DocumentID string `json:"documentId"`
SectionID string `json:"pageId"`
ActivityType Type `json:"activityType"`
@ -34,7 +34,7 @@ type UserActivity struct {
type DocumentActivity struct {
ID uint64 `json:"id"`
OrgID string `json:"orgId"`
SpaceID string `json:"folderId"`
SpaceID string `json:"spaceId"`
DocumentID string `json:"documentId"`
SectionID string `json:"pageId"`
SectionName string `json:"pageTitle"`

View file

@ -17,7 +17,7 @@ import "github.com/documize/community/model"
type Block struct {
model.BaseEntity
OrgID string `json:"orgId"`
SpaceID string `json:"folderId"`
SpaceID string `json:"spaceId"`
UserID string `json:"userId"`
ContentType string `json:"contentType"`
Type string `json:"pageType"`

View file

@ -17,7 +17,7 @@ import "github.com/documize/community/model"
type Category struct {
model.BaseEntity
OrgID string `json:"orgId"`
SpaceID string `json:"folderId"`
SpaceID string `json:"spaceId"`
Name string `json:"category"`
}
@ -26,7 +26,7 @@ type Member struct {
model.BaseEntity
OrgID string `json:"orgId"`
CategoryID string `json:"categoryId"`
SpaceID string `json:"folderId"`
SpaceID string `json:"spaceId"`
DocumentID string `json:"documentId"`
}

View file

@ -23,7 +23,7 @@ import (
type Document struct {
model.BaseEntity
OrgID string `json:"orgId"`
SpaceID string `json:"folderId"`
SpaceID string `json:"spaceId"`
UserID string `json:"userId"`
Job string `json:"job"`
Location string `json:"location"`

View file

@ -17,7 +17,7 @@ import "github.com/documize/community/model"
type Link struct {
model.BaseEntity
OrgID string `json:"orgId"`
SpaceID string `json:"folderId"`
SpaceID string `json:"spaceId"`
UserID string `json:"userId"`
LinkType string `json:"linkType"`
SourceDocumentID string `json:"sourceDocumentId"`
@ -32,7 +32,7 @@ type Link struct {
type Candidate struct {
RefID string `json:"id"`
LinkType string `json:"linkType"`
SpaceID string `json:"folderId"`
SpaceID string `json:"spaceId"`
DocumentID string `json:"documentId"`
TargetID string `json:"targetId"`
Title string `json:"title"` // what we label the link

View file

@ -21,7 +21,7 @@ import (
type SitemapDocument struct {
DocumentID string
Document string
FolderID string
SpaceID string
Folder string
Revised time.Time
}

View file

@ -17,7 +17,7 @@ package permission
type Record struct {
ID uint64 `json:"id"`
OrgID string `json:"orgId"`
SpaceID string `json:"folderId"`
SpaceID string `json:"spaceId"`
WhoID string `json:"whoId"`
Who WhoType `json:"who"`
SpaceView bool `json:"spaceView"`
@ -149,7 +149,7 @@ func EncodeRecord(r Record, a Action) (p Permission) {
// CategoryViewRequestModel represents who should be allowed to see a category.
type CategoryViewRequestModel struct {
OrgID string `json:"orgId"`
SpaceID string `json:"folderId"`
SpaceID string `json:"spaceId"`
CategoryID string `json:"categoryID"`
WhoID string `json:"whoId"`
Who WhoType `json:"who"`

View file

@ -18,7 +18,7 @@ type Pin struct {
model.BaseEntity
OrgID string `json:"orgId"`
UserID string `json:"userId"`
SpaceID string `json:"folderId"`
SpaceID string `json:"spaceId"`
DocumentID string `json:"documentId"`
Name string `json:"pin"`
Sequence int `json:"sequence"`

View file

@ -22,7 +22,7 @@ type Space struct {
Name string `json:"name"`
OrgID string `json:"orgId"`
UserID string `json:"userId"`
Type Scope `json:"folderType"`
Type Scope `json:"spaceType"`
// Lifecycle stores the default value all new documents are given upon creation.
Lifecycle workflow.Lifecycle `json:"lifecycle"`
@ -64,8 +64,8 @@ func (l *Space) IsRestricted() bool {
// Viewer details who can see a particular space
type Viewer struct {
Name string `json:"name"`
SpaceID string `json:"folderId"`
Type int `json:"folderType"`
SpaceID string `json:"spaceId"`
Type int `json:"spaceType"`
UserID string `json:"userId"`
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`